diff --git a/CHANGELOG b/CHANGELOG index f3dcc4d0..0d45a820 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -581,7 +581,7 @@ jc changelog 20200211 v1.7.3 - Add alternative 'magic' syntax: e.g. `jc ls -al` -- Options can now be condensed (e.g. -prq is equivalant to -p -r -q) +- Options can now be condensed (e.g. -prq is equivalent to -p -r -q) 20200208 v1.7.2 - Include test fixtures in wheel and sdist diff --git a/README.md b/README.md index 9cc8b396..a87745e5 100644 --- a/README.md +++ b/README.md @@ -390,7 +390,7 @@ option. ### Streaming Parsers Most parsers load all of the data from `STDIN`, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. `ls-s` and -`ping-s`) that immediately start processing and outputing the data line-by-line +`ping-s`) that immediately start processing and outputting the data line-by-line as [JSON Lines](https://jsonlines.org/) (aka [NDJSON](http://ndjson.org/)) while it is being received from `STDIN`. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. `ls -lR /`) and diff --git a/docs/parsers/datetime_iso.md b/docs/parsers/datetime_iso.md index e99b9d7a..1fe13fee 100644 --- a/docs/parsers/datetime_iso.md +++ b/docs/parsers/datetime_iso.md @@ -6,7 +6,7 @@ jc - JSON Convert ISO 8601 Datetime string parser This parser supports standard ISO 8601 strings that include both date and -time. If no timezone or offset information is available in the sring, then +time. If no timezone or offset information is available in the string, then UTC timezone is used. Usage (cli): diff --git a/docs/parsers/dig.md b/docs/parsers/dig.md index 27bcdd6f..a664daee 100644 --- a/docs/parsers/dig.md +++ b/docs/parsers/dig.md @@ -106,7 +106,7 @@ Schema: ] [0] naive timestamp if "when" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null Examples: diff --git a/docs/parsers/git_log.md b/docs/parsers/git_log.md index 44ae89af..a8694d36 100644 --- a/docs/parsers/git_log.md +++ b/docs/parsers/git_log.md @@ -61,7 +61,7 @@ Schema: ] [0] naive timestamp if "date" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null Examples: diff --git a/docs/parsers/git_log_s.md b/docs/parsers/git_log_s.md index 7a055137..c736ae3b 100644 --- a/docs/parsers/git_log_s.md +++ b/docs/parsers/git_log_s.md @@ -68,7 +68,7 @@ Schema: } [0] naive timestamp if "date" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null Examples: diff --git a/docs/parsers/proc.md b/docs/parsers/proc.md index 76ce794a..19e14f34 100644 --- a/docs/parsers/proc.md +++ b/docs/parsers/proc.md @@ -6,7 +6,7 @@ jc - JSON Convert Proc file output parser This parser automatically identifies the Proc file and calls the -corresponding parser to peform the parsing. +corresponding parser to perform the parsing. Magic syntax for converting `/proc` files is also supported by running `jc /proc/`. Any `jc` options must be specified before the diff --git a/docs/parsers/syslog.md b/docs/parsers/syslog.md index 2d05e5a9..3b62a57c 100644 --- a/docs/parsers/syslog.md +++ b/docs/parsers/syslog.md @@ -53,7 +53,7 @@ Blank values converted to `null`/`None`. ] [0] naive timestamp if "timestamp" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null [2] this field exists if the syslog line is not parsable. The value is the original syslog line. diff --git a/docs/parsers/syslog_s.md b/docs/parsers/syslog_s.md index d15b05f7..f09b853b 100644 --- a/docs/parsers/syslog_s.md +++ b/docs/parsers/syslog_s.md @@ -64,7 +64,7 @@ Blank values converted to `null`/`None`. } [0] naive timestamp if "timestamp" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null [2] this field exists if the syslog line is not parsable. The value is the original syslog line. diff --git a/docs/utils.md b/docs/utils.md index b6387b06..fc57b97e 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -91,7 +91,7 @@ Parameters: the parser. compatible options: linux, darwin, cygwin, win32, aix, freebsd - quiet: (bool) supress compatibility message if True + quiet: (bool) suppress compatibility message if True Returns: diff --git a/jc/parsers/asn1crypto/algos.py b/jc/parsers/asn1crypto/algos.py index cdd0020a..f3fa72af 100644 --- a/jc/parsers/asn1crypto/algos.py +++ b/jc/parsers/asn1crypto/algos.py @@ -567,7 +567,7 @@ class DSASignature(Sequence): @classmethod def from_p1363(cls, data): """ - Reads a signature from a byte string encoding accordint to IEEE P1363, + Reads a signature from a byte string encoding according to IEEE P1363, which is used by Microsoft's BCryptSignHash() function. :param data: diff --git a/jc/parsers/asn1crypto/core.py b/jc/parsers/asn1crypto/core.py index 364c6b5c..0908fd0d 100644 --- a/jc/parsers/asn1crypto/core.py +++ b/jc/parsers/asn1crypto/core.py @@ -247,7 +247,7 @@ class Asn1Value(object): :param no_explicit: If explicit tagging info should be removed from this instance. - Used internally to allow contructing the underlying value that + Used internally to allow constructing the underlying value that has been wrapped in an explicit tag. :param tag_type: @@ -697,7 +697,7 @@ class Castable(object): if other_class.tag != self.__class__.tag: raise TypeError(unwrap( ''' - Can not covert a value from %s object to %s object since they + Can not convert a value from %s object to %s object since they use different tags: %d versus %d ''', type_name(other_class), @@ -1349,7 +1349,7 @@ class Choice(Asn1Value): class Concat(object): """ - A class that contains two or more encoded child values concatentated + A class that contains two or more encoded child values concatenated together. THIS IS NOT PART OF THE ASN.1 SPECIFICATION! This exists to handle the x509.TrustedCertificate() class for OpenSSL certificates containing extra information. @@ -3757,7 +3757,7 @@ class Sequence(Asn1Value): def _make_value(self, field_name, field_spec, value_spec, field_params, value): """ - Contructs an appropriate Asn1Value object for a field + Constructs an appropriate Asn1Value object for a field :param field_name: A unicode string of the field name @@ -3766,7 +3766,7 @@ class Sequence(Asn1Value): An Asn1Value class that is the field spec :param value_spec: - An Asn1Value class that is the vaue spec + An Asn1Value class that is the value spec :param field_params: None or a dict of params for the field spec diff --git a/jc/parsers/cef.py b/jc/parsers/cef.py index 0a754fb1..a834c0ce 100644 --- a/jc/parsers/cef.py +++ b/jc/parsers/cef.py @@ -185,7 +185,7 @@ def _pycef_parse(str_input): # If the input entry had any blanks in the required headers, that's wrong # and we should return. Note we explicitly don't check the last item in the - # split list becuase the header ends in a '|' which means the last item + # split list because the header ends in a '|' which means the last item # will always be an empty string (it doesn't exist, but the delimiter does). if "" in spl[0:-1]: raise ParseError('Blank field(s) in CEF header. Is it valid CEF format?') diff --git a/jc/parsers/datetime_iso.py b/jc/parsers/datetime_iso.py index 3b11eb79..2da60b62 100644 --- a/jc/parsers/datetime_iso.py +++ b/jc/parsers/datetime_iso.py @@ -1,7 +1,7 @@ """jc - JSON Convert ISO 8601 Datetime string parser This parser supports standard ISO 8601 strings that include both date and -time. If no timezone or offset information is available in the sring, then +time. If no timezone or offset information is available in the string, then UTC timezone is used. Usage (cli): diff --git a/jc/parsers/dig.py b/jc/parsers/dig.py index a093e84b..be7bcd2e 100644 --- a/jc/parsers/dig.py +++ b/jc/parsers/dig.py @@ -101,7 +101,7 @@ Schema: ] [0] naive timestamp if "when" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null Examples: diff --git a/jc/parsers/git_log.py b/jc/parsers/git_log.py index 088b813e..e65249d5 100644 --- a/jc/parsers/git_log.py +++ b/jc/parsers/git_log.py @@ -56,7 +56,7 @@ Schema: ] [0] naive timestamp if "date" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null Examples: diff --git a/jc/parsers/git_log_s.py b/jc/parsers/git_log_s.py index 63a27a1b..f3ffc725 100644 --- a/jc/parsers/git_log_s.py +++ b/jc/parsers/git_log_s.py @@ -63,7 +63,7 @@ Schema: } [0] naive timestamp if "date" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null Examples: diff --git a/jc/parsers/ip_address.py b/jc/parsers/ip_address.py index 5610d142..ba5f62d7 100644 --- a/jc/parsers/ip_address.py +++ b/jc/parsers/ip_address.py @@ -560,7 +560,7 @@ def _process(proc_data: Dict) -> Dict: def _b2a(byte_string: bytes) -> str: """Convert a byte string to a colon-delimited hex ascii string""" - # need try/except since seperator was only introduced in python 3.8. + # need try/except since separator was only introduced in python 3.8. # provides compatibility for python 3.6 and 3.7. try: return binascii.hexlify(byte_string, ':').decode('utf-8') diff --git a/jc/parsers/iw_scan.py b/jc/parsers/iw_scan.py index ea453ef0..607dca0c 100644 --- a/jc/parsers/iw_scan.py +++ b/jc/parsers/iw_scan.py @@ -180,7 +180,7 @@ def _post_parse(data): ssid = {k: v for k, v in ssid.items() if v} cleandata.append(ssid) - # remove asterisks from begining of values + # remove asterisks from beginning of values for ssid in cleandata: for key in ssid: if ssid[key].startswith('*'): diff --git a/jc/parsers/jwt.py b/jc/parsers/jwt.py index 27724ff7..0f293fda 100644 --- a/jc/parsers/jwt.py +++ b/jc/parsers/jwt.py @@ -78,7 +78,7 @@ def _process(proc_data: Dict) -> Dict: def _b2a(byte_string: bytes) -> str: """Convert a byte string to a colon-delimited hex ascii string""" - # need try/except since seperator was only introduced in python 3.8. + # need try/except since separator was only introduced in python 3.8. # provides compatibility for python 3.6 and 3.7. try: return binascii.hexlify(byte_string, ':').decode('utf-8') diff --git a/jc/parsers/nmcli.py b/jc/parsers/nmcli.py index c9a78f7a..91644a6a 100644 --- a/jc/parsers/nmcli.py +++ b/jc/parsers/nmcli.py @@ -228,7 +228,7 @@ def _normalize_header(keyname: str) -> str: def _add_text_kv(key: str, value: Optional[str]) -> Optional[Dict]: """ Add keys with _text suffix if there is a text description inside - paranthesis at the end of a value. The value of the _text field will + parenthesis at the end of a value. The value of the _text field will only be the text inside the parenthesis. This allows cleanup of the original field (convert to int/float/etc) without losing information. """ diff --git a/jc/parsers/pidstat_s.py b/jc/parsers/pidstat_s.py index f27cd9bf..4ac40245 100644 --- a/jc/parsers/pidstat_s.py +++ b/jc/parsers/pidstat_s.py @@ -161,7 +161,7 @@ def parse( continue if not line.startswith('#') and not found_first_hash: - # skip preample lines before header row + # skip preamble lines before header row continue if line.startswith('#') and not found_first_hash: diff --git a/jc/parsers/plist.py b/jc/parsers/plist.py index 8cce3837..fa313069 100644 --- a/jc/parsers/plist.py +++ b/jc/parsers/plist.py @@ -80,7 +80,7 @@ def _process(proc_data: Dict) -> Dict: def _b2a(byte_string: bytes) -> str: """Convert a byte string to a colon-delimited hex ascii string""" - # need try/except since seperator was only introduced in python 3.8. + # need try/except since separator was only introduced in python 3.8. # provides compatibility for python 3.6 and 3.7. try: return binascii.hexlify(byte_string, ':').decode('utf-8') diff --git a/jc/parsers/proc.py b/jc/parsers/proc.py index a7385e29..147a201c 100644 --- a/jc/parsers/proc.py +++ b/jc/parsers/proc.py @@ -1,7 +1,7 @@ """jc - JSON Convert Proc file output parser This parser automatically identifies the Proc file and calls the -corresponding parser to peform the parsing. +corresponding parser to perform the parsing. Magic syntax for converting `/proc` files is also supported by running `jc /proc/`. Any `jc` options must be specified before the diff --git a/jc/parsers/syslog.py b/jc/parsers/syslog.py index 38b924c2..9029061a 100644 --- a/jc/parsers/syslog.py +++ b/jc/parsers/syslog.py @@ -48,7 +48,7 @@ Blank values converted to `null`/`None`. ] [0] naive timestamp if "timestamp" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null [2] this field exists if the syslog line is not parsable. The value is the original syslog line. diff --git a/jc/parsers/syslog_s.py b/jc/parsers/syslog_s.py index aa790b03..5f3e41e6 100644 --- a/jc/parsers/syslog_s.py +++ b/jc/parsers/syslog_s.py @@ -59,7 +59,7 @@ Blank values converted to `null`/`None`. } [0] naive timestamp if "timestamp" field is parsable, else null - [1] timezone aware timestamp availabe for UTC, else null + [1] timezone aware timestamp available for UTC, else null [2] this field exists if the syslog line is not parsable. The value is the original syslog line. diff --git a/jc/parsers/x509_cert.py b/jc/parsers/x509_cert.py index 790122d2..b3b909d8 100644 --- a/jc/parsers/x509_cert.py +++ b/jc/parsers/x509_cert.py @@ -441,7 +441,7 @@ def _i2b(integer: int) -> bytes: def _b2a(byte_string: bytes) -> str: """Convert a byte string to a colon-delimited hex ascii string""" - # need try/except since seperator was only introduced in python 3.8. + # need try/except since separator was only introduced in python 3.8. # provides compatibility for python 3.6 and 3.7. try: return binascii.hexlify(byte_string, ':').decode('utf-8') diff --git a/jc/utils.py b/jc/utils.py index dbc0d13b..bc27566a 100644 --- a/jc/utils.py +++ b/jc/utils.py @@ -141,7 +141,7 @@ def compatibility(mod_name: str, compatible: List[str], quiet: bool = False) -> the parser. compatible options: linux, darwin, cygwin, win32, aix, freebsd - quiet: (bool) supress compatibility message if True + quiet: (bool) suppress compatibility message if True Returns: diff --git a/man/jc.1 b/man/jc.1 index c0d7998b..f17b34a8 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -1072,7 +1072,7 @@ JC_COLORS=default,default,default,default You can set the \fBNO_COLOR\fP environment variable to any value to disable color output in \fBjc\fP. Note that using the \fB-C\fP option to force color output will override both the \fBNO_COLOR\fP environment variable and the \fB-m\fP option. .SH STREAMING PARSERS -Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP, \fBping-s\fP, etc.) that immediately start processing and outputing the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below. +Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP, \fBping-s\fP, etc.) that immediately start processing and outputting the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below. .RS Note: Streaming parsers cannot be used with the "magic" syntax diff --git a/mangen.py b/mangen.py index 9b0a7106..ab35045c 100755 --- a/mangen.py +++ b/mangen.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Genereate man page from jc metadata using jinja2 templates +# Generate man page from jc metadata using jinja2 templates from datetime import date import jc.cli from jinja2 import Environment, FileSystemLoader diff --git a/readmegen.py b/readmegen.py index 30ab0d83..592f48b3 100755 --- a/readmegen.py +++ b/readmegen.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Genereate README.md from jc metadata using jinja2 templates +# Generate README.md from jc metadata using jinja2 templates import jc.cli import jc.lib from jinja2 import Environment, FileSystemLoader diff --git a/templates/manpage_template b/templates/manpage_template index 8854f421..2536c2a3 100644 --- a/templates/manpage_template +++ b/templates/manpage_template @@ -182,7 +182,7 @@ JC_COLORS=default,default,default,default You can set the \fBNO_COLOR\fP environment variable to any value to disable color output in \fBjc\fP. Note that using the \fB-C\fP option to force color output will override both the \fBNO_COLOR\fP environment variable and the \fB-m\fP option. .SH STREAMING PARSERS -Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP, \fBping-s\fP, etc.) that immediately start processing and outputing the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below. +Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP, \fBping-s\fP, etc.) that immediately start processing and outputting the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below. .RS Note: Streaming parsers cannot be used with the "magic" syntax diff --git a/templates/readme_template b/templates/readme_template index 086ce823..76a99b9a 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -262,7 +262,7 @@ option. ### Streaming Parsers Most parsers load all of the data from `STDIN`, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. `ls-s` and -`ping-s`) that immediately start processing and outputing the data line-by-line +`ping-s`) that immediately start processing and outputting the data line-by-line as [JSON Lines](https://jsonlines.org/) (aka [NDJSON](http://ndjson.org/)) while it is being received from `STDIN`. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. `ls -lR /`) and