|
| 1 | +# CLI Documentation |
| 2 | + |
| 3 | +I will lay out how to use the comamnd line! |
| 4 | + |
| 5 | +<br /> |
| 6 | +<details> |
| 7 | + <summary>Jump to</summary> |
| 8 | + <ul> |
| 9 | + <li><a href='#importing-the-class'> Import the class</a></li> |
| 10 | + <li><a href='#initializing-a-thread'> Initialize a thread </a></li> |
| 11 | + <li><a href='#parameters'> Parameters </a></li> |
| 12 | + <li><a href='#attributes'> Attributes </a></li> |
| 13 | + <li><a href='#methods'> Class Methods </a></li> |
| 14 | + <li><a href='#behviours'> Behaviours </a></li> |
| 15 | + </ul> |
| 16 | +</details> |
| 17 | + |
| 18 | + |
| 19 | +Don't have the thread library? [See here](./getting-started.md) for installing thread |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Getting started |
| 24 | + |
| 25 | +Try running the help command! |
| 26 | +```sh |
| 27 | +$ thread -h/--help |
| 28 | +``` |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +<br /> |
| 33 | + |
| 34 | + |
| 35 | +## Log levels |
| 36 | + |
| 37 | +Thread CLI uses the [python logging library.](https://docs.python.org/3/library/logging.html) |
| 38 | + |
| 39 | +-------------- |
| 40 | +| Name | Level | |
| 41 | +| :-----: | :---: | |
| 42 | +| NOTSET | 0 | |
| 43 | +| DEBUG | 10 | |
| 44 | +| INFO | 20 | |
| 45 | +| WARN | 30 | |
| 46 | +| ERROR | 40 | |
| 47 | +| CRITICAL | 50 | |
| 48 | + |
| 49 | +<br /> |
| 50 | + |
| 51 | + |
| 52 | +## Commands |
| 53 | + |
| 54 | +List of commands |
| 55 | + |
| 56 | +<br /> |
| 57 | + |
| 58 | + |
| 59 | +### Documentation (thread docs) |
| 60 | + |
| 61 | +Ran with no arguments and options, this command will attempt to open your brower to this MD file! |
| 62 | +<br /> |
| 63 | +If unable, will instead print out the link. |
| 64 | + |
| 65 | +<br /> |
| 66 | + |
| 67 | + |
| 68 | +### Help (thread help) |
| 69 | + |
| 70 | +Ran with no arguments and options, this command will attempt to open your brower to the issue tracker! |
| 71 | +<br /> |
| 72 | +If unable, will instead print out the link. |
| 73 | + |
| 74 | +<br /> |
| 75 | + |
| 76 | + |
| 77 | +### Report (thread report) |
| 78 | + |
| 79 | +Ran with no arguments and options, this command will attempt to open your brower to this MD file! |
| 80 | +<br /> |
| 81 | +If unable, will instead print out the link. |
| 82 | + |
| 83 | +<br /> |
| 84 | + |
| 85 | + |
| 86 | +### Configuration (thread config ...) |
| 87 | + |
| 88 | +Comming soon. |
| 89 | + |
| 90 | + |
| 91 | +<br /> |
| 92 | + |
| 93 | + |
| 94 | +### Parallel Processing (thread process ...) |
| 95 | + |
| 96 | +Invokes the [parallel processing class](parallel-processing.md#importing-the-class)<br /> |
| 97 | + |
| 98 | +> **Help Command Output** |
| 99 | +
|
| 100 | + |
| 101 | + |
| 102 | +> **Example Usage** |
| 103 | +```sh |
| 104 | +$ thread process 'lambda x: x**2' '[ i for i in range(1000) ]' |
| 105 | +=> Writes to "output.json" every number from 0 to 1000 squared. |
| 106 | + |
| 107 | +$ thread process home.Downloads.clean_data:clean ./dataset.csv -t 20 |
| 108 | +=> The same as: |
| 109 | + from home.Downloads.clean_data import clean |
| 110 | + dataset = open('dataset.csv', 'r') |
| 111 | + |
| 112 | + newProcess = ParallelProcess( |
| 113 | + target = clean, |
| 114 | + dataset = dataset, |
| 115 | + max_threads = 20 |
| 116 | + ) |
| 117 | + newProcess.start() |
| 118 | + |
| 119 | + prints or writes to file the result |
| 120 | +``` |
| 121 | + |
| 122 | +<br /> |
| 123 | + |
| 124 | + |
| 125 | +Now you know how to use the [`Thread CLI`](#cli-documentation)! |
| 126 | + |
| 127 | +[See here](./parallel-processing.md) for how to using the `thread.ParallelProcessing` class! |
0 commit comments