Records the inputs and outputs of scripts
Project description
Pirec is a Python package for wrapping scripts so that their inputs and outputs are preserved in a consistent way and results are recorded.
Example
from pirec import call, record, pipeline
from pirec.artefacts import TextFile
@record()
def pipeline_stage_1(f):
call(['/bin/cat', f.filename])
@record()
def pipeline_stage_2(f):
call(['/bin/cat', f.filename])
def my_pipeline(file1, file2):
pipeline_stage_1(file1)
pipeline_stage_2(file2)
def example_pipeline():
pipeline.run(
'example',
my_pipeline,
'/my/data/directory',
TextFile('month00/data.txt'), TextFile('month12/data.txt')
)
if __name__ == '__main__':
example_pipeline()
Installation
pip install pirec
Requirements
Pirec is tested with Python v2.7 - 3.6. Use of the MongoDB or SQLDatabase result recorders requires the installation of the pymongo or sqlalchemy modules as appropriate. Depending on your database SQLAlchemy may require additional support libraries to be installed.
Documentation
Full documentation is hosted on Read the Docs.
Contribute
Issue Tracker: github.com/jstutters/pirec/issues
Source Code: github.com/jstutters/pirec
Support
If you are having problems, please let me know by submitting an issue in the tracker.
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
File details
Details for the file pirec-0.11.0.linux-x86_64.tar.gz
.
File metadata
- Download URL: pirec-0.11.0.linux-x86_64.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8b5097595aa8478da23a8c61fd5d68ade9b104c25b5a0e4c7dcad41ee57744a |
|
MD5 | 1b61cf1875640913050eadb896c3d47a |
|
BLAKE2b-256 | 005bb1c6dfe2f34944dd7deb2c7cfb5870a33f088a9aeec418f9a10cccb69f25 |
File details
Details for the file pirec-0.11.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pirec-0.11.0-py2.py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 331fc849b9442bb6a443c007f44412945463949a00ede28e6e3ce217d270dfaf |
|
MD5 | c964f0c39bfbb15c8411e6ace14a2d56 |
|
BLAKE2b-256 | 1ab4c1f8fd4dbce9f11a868417eb4ba4f64085cbeb56571bf3930b804567145c |