1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +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

@ -17,6 +17,19 @@ Usage (module):
import jc.parsers.uname
result = jc.parsers.uname.parse(uname_command_output)
Schema:
{
"kernel_name": string,
"node_name": string,
"kernel_release": string,
"operating_system": string,
"hardware_platform": string,
"processor": string,
"machine": string,
"kernel_version": string
}
Compatibility:
'linux', 'darwin', 'freebsd'
@ -40,34 +53,7 @@ Example:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (Dictionary) raw structured data to process
Returns:
Dictionary. Structured data with the following schema:
{
"kernel_name": string,
"node_name": string,
"kernel_release": string,
"operating_system": string,
"hardware_platform": string,
"processor": string,
"machine": string,
"kernel_version": string
}
Provides parser metadata (version, author, etc.)
## parse
```python

View File

@ -19,6 +19,68 @@ Usage (module):
import jc.parsers.upower
result = jc.parsers.upower.parse(upower_command_output)
Schema:
[
{
"type": string,
"device_name": string,
"native_path": string,
"power_supply": boolean,
"updated": string,
"updated_epoch": integer, # null if date-time conversion fails
"updated_epoch_utc": integer, # null if date-time conversion fails
"updated_seconds_ago": integer,
"has_history": boolean,
"has_statistics": boolean,
"detail": {
"type": string,
"warning_level": string, # null if none
"online": boolean,
"icon_name": string
"present": boolean,
"rechargeable": boolean,
"state": string,
"energy": float,
"energy_unit": string,
"energy_empty": float,
"energy_empty_unit": string,
"energy_full": float,
"energy_full_unit": string,
"energy_full_design": float,
"energy_full_design_unit": string,
"energy_rate": float,
"energy_rate_unit": string,
"voltage": float,
"voltage_unit": string,
"time_to_full": float,
"time_to_full_unit": string,
"percentage": float,
"capacity": float,
"technology": string
},
"history_charge": [
{
"time": integer,
"percent_charged": float,
"status": string
}
],
"history_rate":[
{
"time": integer,
"percent_charged": float,
"status": string
}
],
"daemon_version": string,
"on_battery": boolean,
"lid_is_closed": boolean,
"lid_is_present": boolean,
"critical_action": string
}
]
Compatibility:
'linux'
@ -138,83 +200,7 @@ Examples:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (List of Dictionaries) raw structured data to process
Returns:
List of Dictionaries. Structured data with the following schema:
[
{
"type": string,
"device_name": string,
"native_path": string,
"power_supply": boolean,
"updated": string,
"updated_epoch": integer, # null if date-time conversion fails
"updated_epoch_utc": integer, # null if date-time conversion fails
"updated_seconds_ago": integer,
"has_history": boolean,
"has_statistics": boolean,
"detail": {
"type": string,
"warning_level": string, # null if none
"online": boolean,
"icon_name": string
"present": boolean,
"rechargeable": boolean,
"state": string,
"energy": float,
"energy_unit": string,
"energy_empty": float,
"energy_empty_unit": string,
"energy_full": float,
"energy_full_unit": string,
"energy_full_design": float,
"energy_full_design_unit": string,
"energy_rate": float,
"energy_rate_unit": string,
"voltage": float,
"voltage_unit": string,
"time_to_full": float,
"time_to_full_unit": string,
"percentage": float,
"capacity": float,
"technology": string
},
"history_charge": [
{
"time": integer,
"percent_charged": float,
"status": string
}
],
"history_rate":[
{
"time": integer,
"percent_charged": float,
"status": string
}
],
"daemon_version": string,
"on_battery": boolean,
"lid_is_closed": boolean,
"lid_is_present": boolean,
"critical_action": string
}
]
Provides parser metadata (version, author, etc.)
## parse
```python

View File

@ -15,6 +15,24 @@ Usage (module):
import jc.parsers.uptime
result = jc.parsers.uptime.parse(uptime_command_output)
Schema:
{
"time": string,
"time_hour": integer,
"time_minute": integer,
"time_second": integer, # null if not displayed
"uptime": string,
"uptime_days": integer,
"uptime_hours": integer,
"uptime_minutes": integer,
"uptime_total_seconds": integer,
"users": integer,
"load_1m": float,
"load_5m": float,
"load_15m": float
}
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
@ -53,39 +71,7 @@ Example:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (Dictionary) raw structured data to process
Returns:
Dictionary. Structured data with the following schema:
{
"time": string,
"time_hour": integer,
"time_minute": integer,
"time_second": integer, # null if not displayed
"uptime": string,
"uptime_days": integer,
"uptime_hours": integer,
"uptime_minutes": integer,
"uptime_total_seconds": integer,
"users": integer,
"load_1m": float,
"load_5m": float,
"load_15m": float
}
Provides parser metadata (version, author, etc.)
## parse
```python

View File

@ -15,6 +15,21 @@ Usage (module):
import jc.parsers.w
result = jc.parsers.w.parse(w_command_output)
Schema:
[
{
"user": string, # '-'' = null
"tty": string, # '-'' = null
"from": string, # '-'' = null
"login_at": string, # '-'' = null
"idle": string, # '-'' = null
"jcpu": string,
"pcpu": string,
"what": string # '-'' = null
}
]
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
@ -94,36 +109,7 @@ Examples:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (List of Dictionaries) raw structured data to process
Returns:
List of Dictionaries. Structured data with the following schema:
[
{
"user": string, # '-'' = null
"tty": string, # '-'' = null
"from": string, # '-'' = null
"login_at": string, # '-'' = null
"idle": string, # '-'' = null
"jcpu": string,
"pcpu": string,
"what": string # '-'' = null
}
]
Provides parser metadata (version, author, etc.)
## parse
```python

View File

@ -15,6 +15,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'
@ -49,32 +60,7 @@ Examples:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (List of Dictionaries) raw structured data to process
Returns:
List of Dictionaries. Structured data with the following schema:
[
{
"filename": string,
"lines": integer,
"words": integer,
"characters": integer
}
]
Provides parser metadata (version, author, etc.)
## parse
```python

View File

@ -19,6 +19,23 @@ Usage (module):
import jc.parsers.who
result = jc.parsers.who.parse(who_command_output)
Schema:
[
{
"user": string,
"event": string,
"writeable_tty": string,
"tty": string,
"time": string,
"epoch": integer, # naive timestamp. null if time cannot be converted
"idle": string,
"pid": integer,
"from": string,
"comment": string
}
]
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
@ -121,38 +138,7 @@ Examples:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (List of Dictionaries) raw structured data to process
Returns:
List of Dictionaries. Structured data with the following schema:
[
{
"user": string,
"event": string,
"writeable_tty": string,
"tty": string,
"time": string,
"epoch": integer, # naive timestamp. null if time cannot be converted
"idle": string,
"pid": integer,
"from": string,
"comment": string
}
]
Provides parser metadata (version, author, etc.)
## parse
```python

View File

@ -11,6 +11,16 @@ Usage (module):
import jc.parsers.xml
result = jc.parsers.xml.parse(xml_file_output)
Schema:
XML Document converted to a Dictionary
See https://github.com/martinblech/xmltodict for details
{
"key1": string/object,
"key2": string/object
}
Compatibility:
'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'
@ -66,28 +76,7 @@ Examples:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (Dictionary) raw structured data to process
Returns:
Dictionary representing an XML document:
{
XML Document converted to a Dictionary
See https://github.com/martinblech/xmltodict for details
}
Provides parser metadata (version, author, etc.)
## parse
```python

View File

@ -11,6 +11,18 @@ Usage (module):
import jc.parsers.yaml
result = jc.parsers.yaml.parse(yaml_file_output)
Schema:
YAML Document converted to a Dictionary
See https://pypi.org/project/ruamel.yaml for details
[
{
"key1": string/int/float/boolean/null/array/object,
"key2": string/int/float/boolean/null/array/object
}
]
Compatibility:
'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'
@ -78,30 +90,7 @@ Examples:
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (List of Dictionaries) raw structured data to process
Returns:
List of Dictionaries. Each dictionary represents a YAML document:
[
{
YAML Document converted to a Dictionary
See https://pypi.org/project/ruamel.yaml for details
}
]
Provides parser metadata (version, author, etc.)
## parse
```python