TwoRavens Preprocess package
Project description
TwoRavens Preprocess
Python package to produce TwoRavens metadata:
pip install tworavens-preprocess
Preprocess a data file
- Open a python shell
from raven_preprocess.preprocess_runner import PreprocessRunner
# process a data file
#
run_info = PreprocessRunner.load_from_file('input/path/my-data-file.csv')
# Did it work?
#
if not run_info.success:
# nope :(
#
print(run_info.err_msg)
else:
# yes :)
#
runner = run_info.result_obj
# show the JSON (string)
#
print(runner.get_final_json(indent=4))
# retrieve the data as a python OrderedDict
#
metadata = runner.get_final_dict()
# iterate through the variables
#
for vkey, vinfo in metadata['variables'].items():
print('-' * 40)
print(f'--- {vkey} ---')
print('nature:', vinfo['nature'])
print('invalidCount:', vinfo['invalidCount'])
print('validCount:', vinfo['validCount'])
print('uniqueCount:', vinfo['uniqueCount'])
print('median:', vinfo['median'])
print('etc...')
Preprocess a single file: output to screen or file
# -------------------------
# Preprocess a single file,
# Write output to screen
# -------------------------
from raven_preprocess.preprocess import run_preprocess
run_preprocess('path-to-input-file.csv')
# -------------------------
# Preprocess a single file,
# Write output to file
# -------------------------
from raven_preprocess.preprocess import run_preprocess
run_preprocess('path-to-input-file.csv', 'path-to-OUTPUT-file.csv')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tworavens_preprocess-1.1.2.tar.gz
(25.7 kB
view hashes)
Built Distribution
Close
Hashes for tworavens_preprocess-1.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9173d9034df9d1826efb04daf4e96c84fdfcbd726ebd6ddb9ed8762c3c776d55 |
|
MD5 | 26711a65b1d06c096d16c054e9100084 |
|
BLAKE2b-256 | 5894eb5c66d82256a1b0a247f7639471918236820e225898603b49e9caeffafb |
Close
Hashes for tworavens_preprocess-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 369df1bcab48dfe1e99a81aaed3825cb49493f07e1e46ed32c13fd2359e59e0d |
|
MD5 | b0de1cad7bc79ec61b56bb6abcc95964 |
|
BLAKE2b-256 | 6d4e7d7690275f5a1e34a5e374dd1bbd1c60d952319134dd422123956eb32aa2 |