Simple data processing library
Project description
DataProcessingLibrary
Python port for Skivsoft.Processor
Simple data processing library.
The key features are:
- Easy idea for running tasks step-by-step
- Synchronous and asynchronous way for executing steps
- Support SOLID
Example of usage
from uuid import uuid4
from data_processing_library.processor import AbstractProcessor, Context
from data_processing_library.group import ProcessorGroup
class HelloContext(Context):
def __init__(self):
self.name = None
def set_name(self, name: str) -> None:
self.name = name
def get_name(self) -> str:
return self.name
class InputName(AbstractProcessor):
def execute(self, context: HelloContext):
context.set_name(uuid4().hex)
class OutputGreeting(AbstractProcessor):
def execute(self, context: HelloContext):
print(f'Hello, {context.get_name()}!')
def run_processor():
hello_context = HelloContext()
steps = [
InputName(),
OutputGreeting(),
]
processor = ProcessorGroup(steps)
processor.execute(hello_context)
if __name__ == '__main__':
run_processor()
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
Close
Hashes for data_processing_library-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e1354212ce291e00b09266355ef03b275fc7ef7cf0072d71b3d38475c70e472 |
|
MD5 | 1649eab4454b77d0a8cc1c9f3a7c1a86 |
|
BLAKE2b-256 | e99f873090b45a7ad70d3f0a943489b28ea8e10269baf53986d94590d3e818d9 |
Close
Hashes for data_processing_library-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 073a037e48a3bc73b46ccc39b77131445ecc84b3e9e122bfb54bc9c5db296a69 |
|
MD5 | d72ed133d8741630252ca44bcdd2f75a |
|
BLAKE2b-256 | 8c8d06518ef765f9e309ecdb38a67732a5165191fa63e88b02251651788c3397 |