diff --git a/docs/parsers/pci_ids.md b/docs/parsers/pci_ids.md index a98e96bb..88a160eb 100644 --- a/docs/parsers/pci_ids.md +++ b/docs/parsers/pci_ids.md @@ -41,7 +41,7 @@ Examples: ### parse ```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 diff --git a/docs/parsers/stat_s.md b/docs/parsers/stat_s.md index 0c9fda3e..0cd4321c 100644 --- a/docs/parsers/stat_s.md +++ b/docs/parsers/stat_s.md @@ -83,7 +83,10 @@ Examples: ```python @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. @@ -104,4 +107,4 @@ Returns: ### Parser Information Compatibility: linux, darwin, freebsd -Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/streaming.md b/docs/streaming.md index 71e61b8a..6060e9eb 100644 --- a/docs/streaming.md +++ b/docs/streaming.md @@ -19,7 +19,7 @@ jc - JSON Convert streaming utils ### streaming\_input\_type\_check ```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 @@ -40,7 +40,8 @@ Ensure each line is a string. Raises `TypeError` if not. ### stream\_success ```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` @@ -50,7 +51,7 @@ Add `_jc_meta` object to output line if `ignore_exceptions=True` ### stream\_error ```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. @@ -106,7 +107,7 @@ In all cases above: ```python 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 diff --git a/docs/utils.md b/docs/utils.md index 87bd7511..6770229f 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -125,7 +125,7 @@ Returns: ### convert\_to\_int ```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 @@ -144,7 +144,7 @@ Returns: ### convert\_to\_float ```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 @@ -163,7 +163,7 @@ Returns: ### convert\_to\_bool ```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 @@ -201,7 +201,7 @@ class timestamp() ### \_\_init\_\_ ```python -def __init__(datetime_string: str, +def __init__(datetime_string: Optional[str], format_hint: Optional[Iterable[int]] = None) -> None ``` diff --git a/man/jc.1 b/man/jc.1 index cc6cf579..05a57fb7 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -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 \fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types, and strings .SH SYNOPSIS