Lazypp
Lazy execution parallel pipeline.
Installation
To install Lazypp, simply run:
pip install lazypp
Usage
- First, create the input and output
TypedDict. - Inherit from
BaseTaskand override thetaskmember function.
Here's an example:
import asyncio
from pathlib import Path
from typing import TypedDict
from lazypp import BaseTask
# Define a base class for your tasks
class TestBaseTask(BaseTask[INPUT, OUTPUT]):
def __init__(self, input: INPUT):
super().__init__(
cache_dir=Path("cache").resolve(),
input=input,
)
# Define input and output types
class Fin(TypedDict):
your_name: str
class Fout(TypedDict):
output: str
# Define a specific task that says hello
class Hello(TestBaseTask[Fin, Fout]):
async def task(self, input: Fin) -> Fout:
await asyncio.sleep(3) # Simulating a long-running task
return {"output": f"Hello, {input['your_name']}"}
# Create and execute the task
hello_task = Hello(
input={"your_name": "John"},
)
print(hello_task.result())
Features
Cached Output
The output is automatically cached in the cache_dir according to the input and the code of the task member function. As a result, running the task a second time is much faster than the first execution.
Parallel Execution
Tasks can be nested, and Lazypp will automatically parallelize these tasks to save time and optimize performance.
Metadata
Release files for lazypp 0.2.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 | |
|---|---|---|---|---|
| lazypp-0.2.0.tar.gz | 8.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lazypp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.0 kB
Release files / lazypp-0.2.0.tar.gz
| Download URL | lazypp-0.2.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95c3559aa59b36b2e783150fa660889da736306b8fa529ccb275f7e07d0eeacf
|
|
BLAKE2b-256 checksum How to use checksums |
4eff7d6b7ab6774c0a50747c7ae7ca6f2a43cd11bbf003ce78b344e16b82ad03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2024.
Transparency logRelease files / lazypp-0.2.0-py3-none-any.whl
| Download URL | lazypp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
641b978975fee5ca749d12fddcbc5ad192d298cd039d71f82223d4f9bca34931
|
|
BLAKE2b-256 checksum How to use checksums |
254780b719b01b292457772e30908ebf400ed2824917cf00cb30e0dab3033b25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2024.
Transparency logSecurity for lazypp 0.2.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for lazypp-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2024.
Transparency logA 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.