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
# -------------------------
fab run_preprocess:[input file name]
# Example:
fab run_preprocess:../../test_data/fearonLaitin.csv
# -------------------------
# Preprocess a single file,
# Write output to file
# -------------------------
fab run_preprocess:[input file name],[output file]
fab run_preprocess:../../test_data/fearonLaitin.csv,/tmp/fearonLaitin.json
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.1.tar.gz
(21.5 kB
view hashes)
Built Distribution
Close
Hashes for tworavens_preprocess-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 770c0ae498f4a4fef6ec5045f6443025ac215b0e3aeb33b89ee9afc5c3b1bd63 |
|
MD5 | 59a7087e307c459e1355e0aca8c0a240 |
|
BLAKE2b-256 | 3ee59fcf02049c8039ad085cbd8ebed0f1f83ccd829129d3b25fa3e4c1178298 |
Close
Hashes for tworavens_preprocess-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7876e9c57dbe7b24f3cdcd0d2bf52a6e2ab542ac180e1bd2f68a9b26c9dfeb62 |
|
MD5 | 7b5a2ddd050a016a829da6b5001b749e |
|
BLAKE2b-256 | bc8ca817ace755e6ea569c6dbbb4f17b5f33b24307beaaccf60c4196e2dc5820 |