-
Notifications
You must be signed in to change notification settings - Fork 0
How to options
To use options, you need to add a third parameters which is an object with options.
Example :
parsedFile = parseFile("myfile.csv", schema, {
debug: True
})
-
For options, when it is written
boolean
, in reality, it can be anyTrue
value of python. Same forFalse
. -
command to run test
python3 -m unittest
- name:
debug
- default:
False
- value: boolean:
True
orFalse
This options show the parsed result of your schema (can be useful sometimes)
This options also allow log from the function (example, a mistake)
Test
python3 -m unittest tests/test_debug.py
- name:
separator
- default:
,
- values: string
.csv
stands for "Comma Separated Values", but if you're a rebel, this options is made for you :)
Test
python3 -m unittest tests/test_custom_separator.py
- name:
parse
- default:
True
- value: boolean:
True
orFalse
This function deactivates the parsing of values: function
, int
, float
, string
With this function all is string
Test
python3 -m unittest tests/test_stop_parse_value.py
- name:
lineCallBack
- default:
null
- value: function (async or not)
It activates the callBack after each line, can be useful if ou want to do a insert in database (for example)
Test
python3 -m unittest tests/test_line_callBack.py
python3 -m unittest tests/test_line_callBack_force.py
python3 -m unittest tests/test_line_callBack_value.py
- name:
callBackForce
- default:
False
- value: boolean:
True
orFalse
This options allow you to force taking the result of the callBackLine even if it's undefined
or null
Test
python3 -m unittest tests/test_callBack_force.py
python3 -m unittest tests/test_callBack_force_2.py
- name:
arrayParse
- default:
True
- value: boolean:
True
orFalse
This options allow you to disable the parsing in an array.
Test
python3 -m unittest tests/test_array_parse.py
- name:
overrideFirstLine
- default:
False
- value:
array of string
orFalse
This options allow you to override the first line.
Test
python3 -m unittest tests/test_override_first_line.py
- name:
privateSeparator
- default:
...
- value:
string
This options allow you to change the internal separator of the script. It can be useful if values contain .
in their names
Test
python3 -m unittest tests/test_private_separator.test.js test/private_separator_2.py
- name:
avoidVoidLine
- default:
False
- value:
boolean
This options allow you to not parse void line
Test
python3 -m unittest tests/test_avoidVoidLine.test.js tests/avoidVoidLine2.test.js tests/test_avoidVoidLine3.py