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}]
```
> 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.

View File

@ -65,7 +65,7 @@ Parameters:
Returns:
Standard Parsers: Dictionary or List of Dictionaries
Streaming Parsers: Generator Object
Streaming Parsers: Generator Object containing Dictionaries
## parser_mod_list
@ -78,10 +78,13 @@ Returns a list of all available parser module names.
```python
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
```python
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
to dictionaries and lists of dictionaries.
For documentation on each parser, see the
[documentation site](https://kellyjonbrazil.github.io/jc/) or use
`jc.get_help('parser_module_name')`
Interactive Documentation
>>> 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:

View File

@ -5,9 +5,16 @@
This package serializes the output of many standard unix command line tools
to dictionaries and lists of dictionaries.
For documentation on each parser, see the
[documentation site](https://kellyjonbrazil.github.io/jc/) or use
`jc.get_help('parser_module_name')`
Interactive Documentation
>>> 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:

View File

@ -183,7 +183,7 @@ def parse(parser_mod_name, data,
Returns:
Standard Parsers: Dictionary or List of Dictionaries
Streaming Parsers: Generator Object
Streaming Parsers: Generator Object containing Dictionaries
"""
jc_parser = _get_parser(parser_mod_name)
@ -198,9 +198,12 @@ def parser_mod_list():
return [_cliname_to_modname(p) for p in parsers]
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]
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))

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
jc \- JSONifies the output of many CLI tools and file-types
.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}]
```
> 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.