mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-23 00:29:59 +02:00
doc update
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user