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.2.tar.gz
(21.4 kB
view hashes)
Built Distribution
Close
Hashes for tworavens_preprocess-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bb37947e0b1163b513265ea3a0535fa4ec84de670ef3a1d6183ee23b4bf8b09 |
|
MD5 | 057e0a61e8cf875b9e31e93b23b0873e |
|
BLAKE2b-256 | 7928c01e5d7f6fafdf92b70997d071d2b22635b08c9394a57562e5ed35b8a77d |
Close
Hashes for tworavens_preprocess-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e65ca02cacf31a45a044f8382606fc2669d9915d80117e1d8d3ebc012044b655 |
|
MD5 | 22d452a51a5d218a8c9642b6bf483d20 |
|
BLAKE2b-256 | 9b20e4c9aa519438000ce497597e958cce87461caf6d57cb11012da4981b2be2 |