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.3.tar.gz
(21.3 kB
view hashes)
Built Distribution
Close
Hashes for tworavens_preprocess-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fabba39ddf6efe124dcee477f5653c384e08a38acc512e1a34ead8be69af065 |
|
MD5 | 0616d5b9333e1fdac0c059a9b87e1173 |
|
BLAKE2b-256 | eeab5d4ecbc0973eec930bf48b4a8142617a4e3ecc09584888ad4a876cf2d38c |
Close
Hashes for tworavens_preprocess-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e958a234c88be3702f8c38d87dd9e72d8c8e140aaac5c0ee4b4b97ae0978c718 |
|
MD5 | dd143045a9321df07e3ebfa22e32efbd |
|
BLAKE2b-256 | 570fe002f06f767111aa49cc11676f20560130b686c877d827dc7baf81164d51 |