Skip to main content

beelzebub

Beelzebub is a lightweight framework to transform input to output. The base classes aren't meant to be used directly, rather they establish the interfaces of the framework, and provide a basis with which to derive classes for defining a particular transformation workflow.

A workflow consists of a reader class, a writer class, and a processor class. The workflow class instantiates one of each of these classes, and then executes the workflow of reading input from a given source via the reader class, writing output to a given sink via the writer class, and the processor class calls the reader and passes the read input to the writer.

Both the reader and writer classes are based on a common context manager class. In particular, the open() method can read/write to one of a set of supported iostream types. The iotype should be one of ['file','url','str'] and defaults to str.

The workflow class can optionally setup logging for the workflow (based on the existence of a logger section in the optional configuration dict), and then calls the run() method, passing the source and sink.

As mentioned, an optional configuration dict can be passed when instantiating the workflow object. As a particular workflow will have specific reader, writer and processor classes, the configuration items for each of these components is arbitrary, suited to the particular workflow. However, the framework will look for a toplevel key called reader to pass to the reader class, writer to pass to the writer class, and processor to pass to the processor class. In addition, if a logger key exists, then this will be used to configure logging, via a call to logging.config.dictConfig(logging_conf).

One of the main uses of the configuration is to specify the iotype for the reader and writer. For example, if the input is read from a file, but the output is to be written to a string, then at least a reader configuration is required, as file is not the default iotype for the reader:

conf = {'reader': {'iotype': 'file'}, 'writer': {'iotype': 'str'}}
in_file = sys.argv[1]
out_file = None

x = BaseWorkflow(conf=conf)
x.run(in_file, out_file)
print(x.writer.output)

Note that if the output is to be written to a string, then the sink argument (here, out_file) to run() is redundant, and can be set to None. In this case, access the output string via the workflow's writer's output attribute.

Metadata

Release files for beelzebub 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beelzebub 0.1.2
File Size Uploaded Provenance Actions
beelzebub-0.1.2.tar.gz 8.0 kB Without provenance Details for beelzebub-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for beelzebub 0.1.2
File Interpreter ABI Platform Actions
beelzebub-0.1.2-py3-none-any.whl Python 3 none any Details for beelzebub-0.1.2-py3-none-any.whl

Total release size: 16.3 kB

Release files / beelzebub-0.1.2.tar.gz

Download URL beelzebub-0.1.2.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
90e784e01cee40a86932397ad8cd6a686aa43b5cfaf6a097cc2ad0520f9364ca
BLAKE2b-256 checksum
How to use checksums
be3870c3d5ea6889fe5aeb1caf7e4254c48ecf94a3e6c810fde5888c5cdeaa71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.10 Linux/5.4.0-125-generic

Release files / beelzebub-0.1.2-py3-none-any.whl

Download URL beelzebub-0.1.2-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6d2915b13e0e7c1c3e52807fb4cfad87c49581a4a5fac19d42b04ae455cd733
BLAKE2b-256 checksum
How to use checksums
a58e5b2935ef6661cdd3c7337ba8c383108231fdad4b1a8bf7cfd36ce2b0bd7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.10 Linux/5.4.0-125-generic

Security for beelzebub 0.1.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page