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.0.tar.gz
(21.5 kB
view hashes)
Built Distribution
Close
Hashes for tworavens_preprocess-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf8f5df986421a415ed8c468fab5f12db2aa88993ca37d4191bbbc797a643bdf |
|
MD5 | b3bfc38e5b3fd86c7844c5d4b4d06454 |
|
BLAKE2b-256 | d3fd12ceac975ab735538233d1c73f5bd8ad0656c117d6a4cbb2e772c72518e4 |
Close
Hashes for tworavens_preprocess-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4f4e6e2ba1468bb2e4d79d44fbe9eb63916db9c704c1ac35c4621034ae67097 |
|
MD5 | 4d3f6ffec0690540dad0c8a5749c66bb |
|
BLAKE2b-256 | 39157b60c5c19e987d4ace34e265b41943b48e4ff82eda86a09b34585c20cb4c |