Checkpointed - A library for management of nonlinear processing pipelines.
Introduction
The Checkpointed library provides a small interface for chaining pipelines of different operations. The main functionality of the library is the ability to maintain checkpoints for every performed operation.
Examples
from checkpointed import Pipeline, NoopStep
pipeline = Pipeline('example-pipeline')
# A regular input
input1 = pipeline.add_source(
NoopStep, name='input-1'
)
# An input whose result is also stored as an output in the file
# 'input-2-output.txt'
input2 = pipeline.add_source(
NoopStep, name='input-2', is_sink=True, filename='input-2-output.txt'
)
# A processing step which depends on input1
node3 = pipeline.add_step(NoopStep, name='node-3')
pipeline.connect(input1, node3)
# A processing step which depends on both input2 and node3
node4 = pipeline.add_step(NoopStep, name='node-4')
pipeline.connect(input2, node4)
pipeline.connect(node3, node4)
# Output step which depends on node4
out5 = pipeline.add_sink(NoopStep, name='out-5', filename='out-5-output.txt')
pipeline.connect(node4, out5)
# Build the execution plan
plan = pipeline.build()
# Configuration information for all the steps.
# Empty because NoopStep does not require configuration.
config = {
input1: {},
input2: {},
node3: {},
node4: {},
out5: {}
}
# (optional) setup a logger
import logging
logger = logging.getLogger('example-pipeline')
logger.addHandler(logging.StreamHandler())
# Run the pipeline
plan.execute(
# Configuration used to instantiate the steps in the pipeline.
# Must have one entry for every step.
config_by_step=config,
# Store `input-2-output.txt' and `out-5-output.txt'
# in directory ./out/example-pipeline
output_directory='out',
# Store checkpoints for every pipeline step
# in directory ./checkpoints/example-pipeline
checkpoint_directory='checkpoints',
# Pass in a logger object in order to enable logging.
logger=logger
)
With some actual arguments applied:
from checkpointed import Pipeline, NoopStep
pipeline = Pipeline('example-pipeline')
node = pipeline.add_source(NoopStep, is_sink=True, filename='out.txt')
plan = pipeline.build()
import logging
logger = logging.getLogger('example-pipeline')
logger.addHandler(logging.StreamHandler())
plan.execute(
config_by_step={
node: {'echo-io': True}
},
output_directory='out',
checkpoint_directory='checkpoints',
logger=logger
)
You will get an error on an invalid argument:
from checkpointed import Pipeline, NoopStep
pipeline = Pipeline('example-pipeline')
node = pipeline.add_source(NoopStep, is_sink=True, filename='out.txt')
plan = pipeline.build()
import logging
logger = logging.getLogger('example-pipeline')
logger.addHandler(logging.StreamHandler())
plan.execute(
config_by_step={
node: {'echo-execute': True, 'echo-io': False}
},
output_directory='out',
checkpoint_directory='checkpoints',
logger=logger
)
Metadata
Release files for checkpointed-core 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| checkpointed-core-1.0.0.tar.gz | 57.1 kB | Without provenance | Details for checkpointed-core-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| checkpointed_core-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for checkpointed_core-1.0.0-py3-none-any.whl |
Total release size: 107.4 kB
Release files / checkpointed-core-1.0.0.tar.gz
| Download URL | checkpointed-core-1.0.0.tar.gz |
|---|---|
| Size | 57.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d29fc22855560245413d7ba302dd375e75054405b185ea9cabf2e632be930035
|
|
BLAKE2b-256 checksum How to use checksums |
8dd5f8534bbc23208849fc7379bf1c5d0d2bf16f8f0d68a5d91e61ca0e821a25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / checkpointed_core-1.0.0-py3-none-any.whl
| Download URL | checkpointed_core-1.0.0-py3-none-any.whl |
|---|---|
| Size | 50.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b7f4d6155a5d911470bf9361c49f6f225bc8733da81005db9f6b86a3b651e50
|
|
BLAKE2b-256 checksum How to use checksums |
14b970932036c2deb52d0b72cf3237d4e93f4879a5448069a3624091e106712e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Security for checkpointed-core 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.