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

update documentation

This commit is contained in:
Kelly Brazil
2021-04-08 12:42:01 -07:00
parent a4b6846f63
commit e28c08b136
46 changed files with 976 additions and 1209 deletions

View File

@ -9,6 +9,17 @@ Usage (module):
import jc.parsers.hosts
result = jc.parsers.hosts.parse(hosts_file_output)
Schema:
[
{
"ip": string,
"hostname": [
string
]
}
]
Compatibility:
'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'
@ -66,7 +77,8 @@ import jc.utils
class info():
version = '1.2'
"""Provides parser metadata (version, author, etc.)"""
version = '1.3'
description = '`/etc/hosts` file parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
@ -78,7 +90,7 @@ class info():
__version__ = info.version
def process(proc_data):
def _process(proc_data):
"""
Final processing to conform to the schema.
@ -88,16 +100,7 @@ def process(proc_data):
Returns:
List of Dictionaries. Structured data with the following schema:
[
{
"ip": string,
"hostname": [
string
]
}
]
List of Dictionaries. Structured data to conform to the schema.
"""
# no additional processing needed
@ -157,4 +160,4 @@ def parse(data, raw=False, quiet=False):
if raw:
return raw_output
else:
return process(raw_output)
return _process(raw_output)