1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-23 00:29:59 +02:00

doc update

This commit is contained in:
Kelly Brazil
2022-10-19 08:33:09 -07:00
parent 5763ce6160
commit af7c4ce8ec
5 changed files with 16 additions and 12 deletions

View File

@ -41,7 +41,7 @@ Examples:
### parse ### parse
```python ```python
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
``` ```
Main text parsing function Main text parsing function

View File

@ -83,7 +83,10 @@ Examples:
```python ```python
@add_jc_meta @add_jc_meta
def parse(data, raw=False, quiet=False, ignore_exceptions=False) def parse(data: Iterable[str],
raw: bool = False,
quiet: bool = False,
ignore_exceptions: bool = False) -> StreamingOutputType
``` ```
Main text parsing generator function. Returns an iterable object. Main text parsing generator function. Returns an iterable object.
@ -104,4 +107,4 @@ Returns:
### Parser Information ### Parser Information
Compatibility: linux, darwin, freebsd Compatibility: linux, darwin, freebsd
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)

View File

@ -19,7 +19,7 @@ jc - JSON Convert streaming utils
### streaming\_input\_type\_check ### streaming\_input\_type\_check
```python ```python
def streaming_input_type_check(data: Iterable) -> None def streaming_input_type_check(data: Iterable[Union[str, bytes]]) -> None
``` ```
Ensure input data is an iterable, but not a string or bytes. Raises Ensure input data is an iterable, but not a string or bytes. Raises
@ -40,7 +40,8 @@ Ensure each line is a string. Raises `TypeError` if not.
### stream\_success ### stream\_success
```python ```python
def stream_success(output_line: Dict, ignore_exceptions: bool) -> Dict def stream_success(output_line: JSONDictType,
ignore_exceptions: bool) -> JSONDictType
``` ```
Add `_jc_meta` object to output line if `ignore_exceptions=True` Add `_jc_meta` object to output line if `ignore_exceptions=True`
@ -50,7 +51,7 @@ Add `_jc_meta` object to output line if `ignore_exceptions=True`
### stream\_error ### stream\_error
```python ```python
def stream_error(e: BaseException, line: str) -> Dict def stream_error(e: BaseException, line: str) -> Dict[str, MetadataType]
``` ```
Return an error `_jc_meta` field. Return an error `_jc_meta` field.
@ -106,7 +107,7 @@ In all cases above:
```python ```python
def raise_or_yield(ignore_exceptions: bool, e: BaseException, def raise_or_yield(ignore_exceptions: bool, e: BaseException,
line: str) -> tuple line: str) -> Tuple[BaseException, str]
``` ```
Return the exception object and line string if ignore_exceptions is Return the exception object and line string if ignore_exceptions is

View File

@ -125,7 +125,7 @@ Returns:
### convert\_to\_int ### convert\_to\_int
```python ```python
def convert_to_int(value: Union[str, float]) -> Optional[int] def convert_to_int(value: object) -> Optional[int]
``` ```
Converts string and float input to int. Strips all non-numeric Converts string and float input to int. Strips all non-numeric
@ -144,7 +144,7 @@ Returns:
### convert\_to\_float ### convert\_to\_float
```python ```python
def convert_to_float(value: Union[str, int]) -> Optional[float] def convert_to_float(value: object) -> Optional[float]
``` ```
Converts string and int input to float. Strips all non-numeric Converts string and int input to float. Strips all non-numeric
@ -163,7 +163,7 @@ Returns:
### convert\_to\_bool ### convert\_to\_bool
```python ```python
def convert_to_bool(value: Union[str, int, float]) -> bool def convert_to_bool(value: object) -> bool
``` ```
Converts string, integer, or float input to boolean by checking Converts string, integer, or float input to boolean by checking
@ -201,7 +201,7 @@ class timestamp()
### \_\_init\_\_ ### \_\_init\_\_
```python ```python
def __init__(datetime_string: str, def __init__(datetime_string: Optional[str],
format_hint: Optional[Iterable[int]] = None) -> None format_hint: Optional[Iterable[int]] = None) -> None
``` ```

View File

@ -1,4 +1,4 @@
.TH jc 1 2022-10-18 1.22.1 "JSON Convert" .TH jc 1 2022-10-19 1.22.1 "JSON Convert"
.SH NAME .SH NAME
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types, and strings \fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types, and strings
.SH SYNOPSIS .SH SYNOPSIS