marque
marque (mark) is a minimal library for building workflows and pipelines in python. It has basic primitives for storing long-term data (keep()/recall()), passing runtime context (put()/get()), and dynamically extending the flow as it's executing (push()).
Flow: Defines the workflow and orchestrates itContext: Runtime object storage for flexible dependenciesStep: Individual function in the workflowScope: A storage object provided to each step for artifacts/taggingTag: Astr, float | Nonepair you can use to label a scopeArtifact: Arbitrary data you want to keep and recall later
The output of a flow is essentially a set of Scope objects which represent all the important data generated during the workflow run. You can use the search() function to find prior scopes and use their data to prepare new steps.
Here is a basic example:
from random import Random
from marque import Flow, repeat
from marque.storage import PolarsStorage
def add(flow: Flow):
a, b = flow.get(int, ["a", "b"]) # pull values from the current context
flow.tag(f"{a} + {b}") # add tags for faster analytics/filtering
flow.keep("data", {"answer": a + b}) # persist data to recall later
def sub(flow: Flow):
a, b = flow.get(int, ["a", "b"])
flow.tag(f"{a} - {b}")
flow.keep("data", {"answer": a - b})
def simple_math(flow: Flow):
random = flow.get(Random) # pull context values using only types
a = random.randint(10, 100)
b = random.randint(10, 100)
flow.push(
random.choice([add, sub]), # extend the workflow with a new step
a=a, b=b # pass required context values
)
def inspect_add(flow: Flow):
for scope in flow.search( # search prior scopes and filter
"*", # glob syntax is supported
where=lambda tag: "+" in tag.content
):
for tag in scope.tags:
flow.log(tag.content)
def inspect_sub(flow: Flow):
for scope in flow.search(sub): # or just pass the function
flow.log(scope.recall("data")["answer"]) # and pull data from the scope
flow = (
Flow("test", PolarsStorage("test.parquet")) # persist data to a parquet file
.fail_fast() # don't ignore errors
.put(random=Random(42)) # prepare a seeded random generator
.push(repeat(simple_math, 5)) # add 5 steps for simple_math
.push([inspect_add, inspect_sub]) # run after everything else
)
flow() # Execute our flow
print(flow.run) # The run id (2-part slug)
print(flow.logs) # list of any logs
print(flow.scopes) # list of all scopes
print(flow.errors) # any errors if we don't fail_fast
Metadata
Release files for marque 0.1.1
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 |
|---|---|---|---|---|
| marque-0.1.1.tar.gz | 10.8 kB | Without provenance | Details for marque-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| marque-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for marque-0.1.1-py3-none-any.whl |
Total release size: 22.2 kB
Release files / marque-0.1.1.tar.gz
| Download URL | marque-0.1.1.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bee34aa2d22a874cf7f0a1e14ab58a632746cd03d848d142999f16a075c57e49
|
|
BLAKE2b-256 checksum How to use checksums |
40175f4bc1a3fdb3cb071833af7d87cd198106fab2a8da948f35a5ae5d7c3ee2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / marque-0.1.1-py3-none-any.whl
| Download URL | marque-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f97d0bfb744c96c810627b3f2d88403b5313a6dc06a97e5478cd1b319dd2f99d
|
|
BLAKE2b-256 checksum How to use checksums |
57c7c8a9450b05eab01a1272ee4538a7fc5ae80a3742548a6249bbe576e7b1df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for marque 0.1.1
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.