1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

doc update

This commit is contained in:
Kelly Brazil
2021-04-08 16:14:11 -07:00
parent da611f0ac6
commit b55b02687c
19 changed files with 371 additions and 441 deletions

View File

@ -13,6 +13,17 @@ Usage (module):
import jc.parsers.wc
result = jc.parsers.wc.parse(wc_command_output)
Schema:
[
{
"filename": string,
"lines": integer,
"words": integer,
"characters": integer
}
]
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
@ -46,7 +57,8 @@ import jc.utils
class info():
version = '1.0'
"""Provides parser metadata (version, author, etc.)"""
version = '1.1'
description = '`wc` command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
@ -59,7 +71,7 @@ class info():
__version__ = info.version
def process(proc_data):
def _process(proc_data):
"""
Final processing to conform to the schema.
@ -69,16 +81,7 @@ def process(proc_data):
Returns:
List of Dictionaries. Structured data with the following schema:
[
{
"filename": string,
"lines": integer,
"words": integer,
"characters": integer
}
]
List of Dictionaries. Structured data to conform to the schema.
"""
for entry in proc_data:
@ -126,4 +129,4 @@ def parse(data, raw=False, quiet=False):
if raw:
return raw_output
else:
return process(raw_output)
return _process(raw_output)