1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

add table result examples

This commit is contained in:
Kelly Brazil
2022-03-10 16:50:55 -08:00
parent def7aa5764
commit 54e8f58145
2 changed files with 28 additions and 2 deletions

View File

@ -28,6 +28,12 @@ Example Table:
carrot squash celery spinach my favorite veggies carrot squash celery spinach my favorite veggies
chicken beef pork eggs my favorite proteins chicken beef pork eggs my favorite proteins
[{'col1': 'apple', 'col2': 'orange', 'col3': 'pear', 'col4':
'banana', 'col5': 'my favorite fruits'}, {'col1': 'carrot', 'col2':
'squash', 'col3': 'celery', 'col4': 'spinach', 'col5':
'my favorite veggies'}, {'col1': 'chicken', 'col2': 'beef', 'col3':
'pork', 'col4': 'eggs', 'col5': 'my favorite proteins'}]
Parameters: Parameters:
data: (list) Text data to parse that has been split into lines data: (list) Text data to parse that has been split into lines
@ -52,7 +58,8 @@ def sparse_table_parse(data: List[str], delim: 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.
Data elements must line up within column boundaries. Blank cells are converted to None in the resulting dictionary. Data
elements must line up within column boundaries.
Example Table: Example Table:
@ -61,6 +68,12 @@ Example Table:
green beans celery spinach my favorite veggies green beans celery spinach my favorite veggies
chicken beef brown eggs my favorite proteins chicken beef brown eggs my favorite proteins
[{'col1': 'apple', 'col2': 'orange', 'col3': None, 'col4':
'fuzzy peach', 'col5': 'my favorite fruits'}, {'col1':
'green beans', 'col2': None, 'col3': 'celery', 'col4': 'spinach',
'col5': 'my favorite veggies'}, {'col1': 'chicken', 'col2': 'beef',
'col3': None, 'col4': 'brown eggs', 'col5': 'my favorite proteins'}]
Parameters: Parameters:
data: (list) Text data to parse that has been split into lines data: (list) Text data to parse that has been split into lines

View File

@ -17,6 +17,12 @@ def simple_table_parse(data: List[str]) -> List[Dict]:
carrot squash celery spinach my favorite veggies carrot squash celery spinach my favorite veggies
chicken beef pork eggs my favorite proteins chicken beef pork eggs my favorite proteins
[{'col1': 'apple', 'col2': 'orange', 'col3': 'pear', 'col4':
'banana', 'col5': 'my favorite fruits'}, {'col1': 'carrot', 'col2':
'squash', 'col3': 'celery', 'col4': 'spinach', 'col5':
'my favorite veggies'}, {'col1': 'chicken', 'col2': 'beef', 'col3':
'pork', 'col4': 'eggs', 'col5': 'my favorite proteins'}]
Parameters: Parameters:
data: (list) Text data to parse that has been split into lines data: (list) Text data to parse that has been split into lines
@ -44,7 +50,8 @@ def simple_table_parse(data: List[str]) -> List[Dict]:
def sparse_table_parse(data: List[str], delim: str = '\u2063') -> List[Dict]: def sparse_table_parse(data: List[str], delim: 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.
Data elements must line up within column boundaries. Blank cells are converted to None in the resulting dictionary. Data
elements must line up within column boundaries.
Example Table: Example Table:
@ -53,6 +60,12 @@ def sparse_table_parse(data: List[str], delim: str = '\u2063') -> List[Dict]:
green beans celery spinach my favorite veggies green beans celery spinach my favorite veggies
chicken beef brown eggs my favorite proteins chicken beef brown eggs my favorite proteins
[{'col1': 'apple', 'col2': 'orange', 'col3': None, 'col4':
'fuzzy peach', 'col5': 'my favorite fruits'}, {'col1':
'green beans', 'col2': None, 'col3': 'celery', 'col4': 'spinach',
'col5': 'my favorite veggies'}, {'col1': 'chicken', 'col2': 'beef',
'col3': None, 'col4': 'brown eggs', 'col5': 'my favorite proteins'}]
Parameters: Parameters:
data: (list) Text data to parse that has been split into lines data: (list) Text data to parse that has been split into lines