1
0
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:
Kelly Brazil
2022-01-26 17:08:03 -08:00
parent 50adc05fbd
commit e156b0db45
2 changed files with 5 additions and 4 deletions

View File

@ -15,7 +15,7 @@ jc - JSON CLI output utility universal Parsers
### simple\_table\_parse
```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.
@ -40,7 +40,7 @@ Returns:
### sparse\_table\_parse
```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.

View File

@ -2,9 +2,10 @@
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.
@ -32,7 +33,7 @@ def simple_table_parse(data):
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.