mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
add type hints
This commit is contained in:
@ -15,7 +15,7 @@ jc - JSON CLI output utility universal Parsers
|
|||||||
### simple\_table\_parse
|
### simple\_table\_parse
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def simple_table_parse(data)
|
def simple_table_parse(data: List[str]) -> List[Dict]
|
||||||
```
|
```
|
||||||
|
|
||||||
Parse simple tables. The last column may contain data with spaces.
|
Parse simple tables. The last column may contain data with spaces.
|
||||||
@ -40,7 +40,7 @@ Returns:
|
|||||||
### sparse\_table\_parse
|
### sparse\_table\_parse
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def sparse_table_parse(data, delim='\u2063')
|
def sparse_table_parse(data: List[str], delim: Optional[str] = '\u2063') -> List[Dict]
|
||||||
```
|
```
|
||||||
|
|
||||||
Parse tables with missing column data or with spaces in column data.
|
Parse tables with missing column data or with spaces in column data.
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
|
|
||||||
import string
|
import string
|
||||||
|
from typing import List, Dict, Optional
|
||||||
|
|
||||||
|
|
||||||
def simple_table_parse(data):
|
def simple_table_parse(data: List[str]) -> List[Dict]:
|
||||||
"""
|
"""
|
||||||
Parse simple tables. The last column may contain data with spaces.
|
Parse simple tables. The last column may contain data with spaces.
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ def simple_table_parse(data):
|
|||||||
return raw_output
|
return raw_output
|
||||||
|
|
||||||
|
|
||||||
def sparse_table_parse(data, delim='\u2063'):
|
def sparse_table_parse(data: List[str], delim: Optional[str] ='\u2063') -> List[Dict]:
|
||||||
"""
|
"""
|
||||||
Parse tables with missing column data or with spaces in column data.
|
Parse tables with missing column data or with spaces in column data.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user