1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-08-08 22:36:48 +02:00

module doc update

This commit is contained in:
Kelly Brazil
2022-01-20 07:49:45 -08:00
parent 6962b9ee8a
commit 49c5568577
7 changed files with 35 additions and 15 deletions

View File

@ -46,7 +46,7 @@ The `jc` parsers can also be used as python modules. In this case the output wil
'when_epoch': 1618614780, 'when_epoch_utc': None}] 'when_epoch': 1618614780, 'when_epoch_utc': None}]
``` ```
> For `jc` Python package documentation, use `help('jc')`, `help('jc.lib')`, or see the [online documentation](https://kellyjonbrazil.github.io/jc/docs/). > For `jc` Python package documentation, use `help('jc')`, `help('jc.lib')`, or see the [online documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs).
Two representations of the data are available. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added. Two representations of the data are available. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added.

View File

@ -65,7 +65,7 @@ Parameters:
Returns: Returns:
Standard Parsers: Dictionary or List of Dictionaries Standard Parsers: Dictionary or List of Dictionaries
Streaming Parsers: Generator Object Streaming Parsers: Generator Object containing Dictionaries
## parser_mod_list ## parser_mod_list
@ -78,10 +78,13 @@ Returns a list of all available parser module names.
```python ```python
plugin_parser_mod_list() plugin_parser_mod_list()
``` ```
Returns a list of plugin parser module names.
Returns a list of plugin parser module names. This function is a
subset of `parser_mod_list()`.
## get_help ## get_help
```python ```python
get_help(parser_mod_name) get_help(parser_mod_name)
``` ```
Show help screen for the selected parser Show help screen for the selected parser.

View File

@ -7,9 +7,16 @@ JC - JSON CLI output utility
This package serializes the output of many standard unix command line tools This package serializes the output of many standard unix command line tools
to dictionaries and lists of dictionaries. to dictionaries and lists of dictionaries.
For documentation on each parser, see the Interactive Documentation
[documentation site](https://kellyjonbrazil.github.io/jc/) or use
`jc.get_help('parser_module_name')` >>> help(jc)
>>> help(jc.lib)
>>> help(jc.util)
>>> jc.get_help('parser_module_name')
Online Documentation
https://github.com/kellyjonbrazil/jc/tree/master/docs
Example: Example:

View File

@ -5,9 +5,16 @@
This package serializes the output of many standard unix command line tools This package serializes the output of many standard unix command line tools
to dictionaries and lists of dictionaries. to dictionaries and lists of dictionaries.
For documentation on each parser, see the Interactive Documentation
[documentation site](https://kellyjonbrazil.github.io/jc/) or use
`jc.get_help('parser_module_name')` >>> help(jc)
>>> help(jc.lib)
>>> help(jc.util)
>>> jc.get_help('parser_module_name')
Online Documentation
https://github.com/kellyjonbrazil/jc/tree/master/docs
Example: Example:

View File

@ -183,7 +183,7 @@ def parse(parser_mod_name, data,
Returns: Returns:
Standard Parsers: Dictionary or List of Dictionaries Standard Parsers: Dictionary or List of Dictionaries
Streaming Parsers: Generator Object Streaming Parsers: Generator Object containing Dictionaries
""" """
jc_parser = _get_parser(parser_mod_name) jc_parser = _get_parser(parser_mod_name)
@ -198,9 +198,12 @@ def parser_mod_list():
return [_cliname_to_modname(p) for p in parsers] return [_cliname_to_modname(p) for p in parsers]
def plugin_parser_mod_list(): def plugin_parser_mod_list():
"""Returns a list of plugin parser module names.""" """
Returns a list of plugin parser module names. This function is a
subset of `parser_mod_list()`.
"""
return [_cliname_to_modname(p) for p in local_parsers] return [_cliname_to_modname(p) for p in local_parsers]
def get_help(parser_mod_name): def get_help(parser_mod_name):
"""Show help screen for the selected parser""" """Show help screen for the selected parser."""
help(_get_parser(parser_mod_name)) help(_get_parser(parser_mod_name))

View File

@ -1,4 +1,4 @@
.TH jc 1 2022-01-19 1.18.0 "JSON CLI output utility" .TH jc 1 2022-01-20 1.18.0 "JSON CLI output utility"
.SH NAME .SH NAME
jc \- JSONifies the output of many CLI tools and file-types jc \- JSONifies the output of many CLI tools and file-types
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -46,7 +46,7 @@ The `jc` parsers can also be used as python modules. In this case the output wil
'when_epoch': 1618614780, 'when_epoch_utc': None}] 'when_epoch': 1618614780, 'when_epoch_utc': None}]
``` ```
> For `jc` Python package documentation, use `help('jc')`, `help('jc.lib')`, or see the [online documentation](https://kellyjonbrazil.github.io/jc/docs/). > For `jc` Python package documentation, use `help('jc')`, `help('jc.lib')`, or see the [online documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs).
Two representations of the data are available. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added. Two representations of the data are available. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added.