TwoRavens Preprocess package
Project description
TwoRavens Preprocess
Python package to produce TwoRavens metadata:
pip install tworavens-preprocess
Preprocess a data file
- Open a python shell
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: output to screen or file
# -------------------------
# 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tworavens_preprocess-1.1.5.tar.gz.
File metadata
- Download URL: tworavens_preprocess-1.1.5.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfde367efe18371fb6221cb9ea4f4269d1c4c42b59af0bcc8e472360bb59dfa8
|
|
| MD5 |
0850f5f36705665734acbba4ea35f75b
|
|
| BLAKE2b-256 |
54ddc11ea8d926951de330f87c52d8f69b83a3afd7364f441c36c95357c77dc0
|
File details
Details for the file tworavens_preprocess-1.1.5-py3-none-any.whl.
File metadata
- Download URL: tworavens_preprocess-1.1.5-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fcb2350e0667e851674893ed95884545cf2a4ee246608086fe677c5a905f4e8
|
|
| MD5 |
2560ed6311cc5464c22c3218d968351c
|
|
| BLAKE2b-256 |
60cc988e1d38fd601c05be8c38838f4b0e7819b38d7813609eb0a583dfc01cec
|