TwoRavens Preprocess package
Project description
TwoRavens Preprocess
Python package to produce TwoRavens metadata
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,
# 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-0.1.4.tar.gz
(23.6 kB
view hashes)
Built Distribution
Close
Hashes for tworavens_preprocess-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c837f9ca4603ae90e0d65791dcc603138fabf0cddb47cd6f9f1e7ed7e839fcfd |
|
MD5 | 34441b356fc2899e8d6855dde93b3958 |
|
BLAKE2b-256 | 292cb1b887584347fe41b4daaa28276bdad6e1931c7674c461c6221dbf92895b |
Close
Hashes for tworavens_preprocess-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bb298ed2576489ed3d04fa6e665a07071365c2f8790e59df5e54de39ef4b483 |
|
MD5 | 9a368222e3ba3e01eeb3c8ba0d4bbd1a |
|
BLAKE2b-256 | 68773e5afe70371f716fc6a2e0519839b13df44733dcb98dcee8e7d6351a276e |