-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from kellyjonbrazil/dev
Dev v1.14.0
- Loading branch information
Showing
47 changed files
with
2,222 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
|
||
# jc.parsers.cksum | ||
jc - JSON CLI output utility `cksum` command output parser | ||
|
||
This parser works with the following checksum calculation utilities: | ||
- `sum` | ||
- `cksum` | ||
|
||
Usage (cli): | ||
|
||
$ cksum file.txt | jc --cksum | ||
|
||
or | ||
|
||
$ jc cksum file.txt | ||
|
||
Usage (module): | ||
|
||
import jc.parsers.cksum | ||
result = jc.parsers.cksum.parse(cksum_command_output) | ||
|
||
Compatibility: | ||
|
||
'linux', 'darwin', 'cygwin', 'aix', 'freebsd' | ||
|
||
Examples: | ||
|
||
$ cksum * | jc --cksum -p | ||
[ | ||
{ | ||
"filename": "__init__.py", | ||
"checksum": 4294967295, | ||
"blocks": 0 | ||
}, | ||
{ | ||
"filename": "airport.py", | ||
"checksum": 2208551092, | ||
"blocks": 3745 | ||
}, | ||
{ | ||
"filename": "airport_s.py", | ||
"checksum": 1113817598, | ||
"blocks": 4572 | ||
}, | ||
... | ||
] | ||
|
||
|
||
## info | ||
```python | ||
info() | ||
``` | ||
|
||
|
||
## process | ||
```python | ||
process(proc_data) | ||
``` | ||
|
||
Final processing to conform to the schema. | ||
|
||
Parameters: | ||
|
||
proc_data: (dictionary) raw structured data to process | ||
|
||
Returns: | ||
|
||
List of dictionaries. Structured data with the following schema: | ||
|
||
[ | ||
{ | ||
"filename": string, | ||
"checksum": integer, | ||
"blocks": integer | ||
} | ||
] | ||
|
||
|
||
## parse | ||
```python | ||
parse(data, raw=False, quiet=False) | ||
``` | ||
|
||
Main text parsing function | ||
|
||
Parameters: | ||
|
||
data: (string) text data to parse | ||
raw: (boolean) output preprocessed JSON if True | ||
quiet: (boolean) suppress warning messages if True | ||
|
||
Returns: | ||
|
||
List of dictionaries. Raw or processed structured data. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
|
||
# jc.parsers.hash | ||
jc - JSON CLI output utility `hash` command output parser | ||
|
||
Usage (cli): | ||
|
||
$ hash | jc --hash | ||
|
||
Usage (module): | ||
|
||
import jc.parsers.hash | ||
result = jc.parsers.hash.parse(hash_command_output) | ||
|
||
Compatibility: | ||
|
||
'linux', 'darwin', 'cygwin', 'aix', 'freebsd' | ||
|
||
Examples: | ||
|
||
$ hash | jc --hash -p | ||
[ | ||
{ | ||
"hits": 2, | ||
"command": "/bin/cat" | ||
}, | ||
{ | ||
"hits": 1, | ||
"command": "/bin/ls" | ||
} | ||
] | ||
|
||
|
||
## info | ||
```python | ||
info() | ||
``` | ||
|
||
|
||
## process | ||
```python | ||
process(proc_data) | ||
``` | ||
|
||
Final processing to conform to the schema. | ||
|
||
Parameters: | ||
|
||
proc_data: (dictionary) raw structured data to process | ||
|
||
Returns: | ||
|
||
List of dictionaries. Structured data with the following schema: | ||
|
||
[ | ||
{ | ||
"command": string, | ||
"hits": integer | ||
} | ||
] | ||
|
||
|
||
## parse | ||
```python | ||
parse(data, raw=False, quiet=False) | ||
``` | ||
|
||
Main text parsing function | ||
|
||
Parameters: | ||
|
||
data: (string) text data to parse | ||
raw: (boolean) output preprocessed JSON if True | ||
quiet: (boolean) suppress warning messages if True | ||
|
||
Returns: | ||
|
||
List of dictionaries. Raw or processed structured data. | ||
|
Oops, something went wrong.