brevis
Pass context between the steps of a Brevis workflow. That is all it does.
pip install brevis
from brevis import context
bucket = context.get("extract.bucket")
context.set(rows=48213, watermark="2026-09-07T03:00:00Z")
No dependencies, ever. It reads one environment variable and writes one file. There is no API call, no token and no port: the engine hands a step its input when it starts it and reads the output back when it ends.
This is not a port of the Go SDK. No drivers, no pagination, no ingestion ids — Python already has better tools for those, and this exists so a team can use pandas, Polars or dbt and still get the one thing an orchestrator is for.
Reading
A key is always qualified by the step that published it:
context.get("extract.bucket") # the value
context.get("extract.nope", default=0) # absent is not an error
context.of("extract") # everything that step published
context.get("bucket") with no step is refused, naming the steps that
published it. Steps are isolated — extract and transform can both publish
bucket without either losing it — and a bare key throws that away the moment
two of them do. Searching and picking one is precedence by accident: it works
until it silently does not.
Reading a step this one does not depends_on is an error pointing at the fix.
Writing
context.set(name="Daniel")
context.set(label="Nome")
# both survive: {"name": "Daniel", "label": "Nome"}
Calls merge. Setting the same key twice keeps the last write; setting a different key leaves the first alone. There is no step argument — the only namespace a process can write is its own, which is what makes the isolation structural rather than a rule.
Nothing reaches the disk until the process exits, so a step that dies hard publishes nothing. That is correct: a crashed step's output described work that did not finish.
What it refuses
| because | |
|---|---|
| more than 4096 bytes | the platform truncates rather than refuses, so an oversized object arrives cut in half and reads downstream as "published nothing" |
| a value that is not JSON | a datetime becomes "..." or vanishes depending on who serializes it. The error names the key and suggests .isoformat() |
| a non-string key | {1: "x"} comes back as {"1": "x"} and the lookup misses |
The ceiling is the platform's number, not ours. Every "context between tasks" feature fails the same way — somebody puts data where only context fits. Four kilobytes hold a watermark, a count or a list of partitions. Publish a reference and leave the rows where they are.
Running it by hand
Outside Brevis there is no input and nothing reads the output. get() returns
the default, set() accepts and discards, and the library says so once at INFO.
It does not raise: a script that cannot be run by hand cannot be developed. The
validation still runs, so a value that works on your laptop works in production.
This is not a secret store
Everything published is visible to anyone who can see the run — it is in the pod's status and in the run history. Publish a path, not a signed URL.
Testing your step
The whole contract is two environment variables, so there is nothing to mock:
def test_my_step(monkeypatch, tmp_path):
monkeypatch.setenv("BREVIS_INPUT", '{"extract": {"rows": 42}}')
monkeypatch.setenv("BREVIS_OUTPUT", str(tmp_path / "out"))
assert context.get("extract.rows") == 42
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brevis-0.1.1.tar.gz.
File metadata
- Download URL: brevis-0.1.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e2048b803bb8cce1e8213cbbe870f110248a61f92e689e0b5cd81cc08826833
|
|
| MD5 |
f858a38b20b8c2fca44cc30e91faebc3
|
|
| BLAKE2b-256 |
b97b2bccf7241360bfada930ca67aeaa82ddbc2dd6ff581bfdd8f28341ce6e70
|
Provenance
The following attestation bundles were made for brevis-0.1.1.tar.gz:
Publisher:
publish-python.yml on AreteAcademy/brevis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brevis-0.1.1.tar.gz -
Subject digest:
8e2048b803bb8cce1e8213cbbe870f110248a61f92e689e0b5cd81cc08826833 - Sigstore transparency entry: 2751671234
- Sigstore integration time:
-
Permalink:
AreteAcademy/brevis@1f5c9002a051eab49e3c5b1fa5516a0f31b9ec62 -
Branch / Tag:
refs/tags/py/v0.1.1 - Owner: https://github.com/AreteAcademy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@1f5c9002a051eab49e3c5b1fa5516a0f31b9ec62 -
Trigger Event:
push
-
Statement type:
File details
Details for the file brevis-0.1.1-py3-none-any.whl.
File metadata
- Download URL: brevis-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebdd3f539251848ace5310688e3da7146af0cebe4b06a05b9dad188e5359942e
|
|
| MD5 |
fe843093f70733b8aa7fd76417840205
|
|
| BLAKE2b-256 |
9dc2dea8108f21d03753c7765a921768f2b6d1203bd185600126f62bee01190a
|
Provenance
The following attestation bundles were made for brevis-0.1.1-py3-none-any.whl:
Publisher:
publish-python.yml on AreteAcademy/brevis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brevis-0.1.1-py3-none-any.whl -
Subject digest:
ebdd3f539251848ace5310688e3da7146af0cebe4b06a05b9dad188e5359942e - Sigstore transparency entry: 2751671263
- Sigstore integration time:
-
Permalink:
AreteAcademy/brevis@1f5c9002a051eab49e3c5b1fa5516a0f31b9ec62 -
Branch / Tag:
refs/tags/py/v0.1.1 - Owner: https://github.com/AreteAcademy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@1f5c9002a051eab49e3c5b1fa5516a0f31b9ec62 -
Trigger Event:
push
-
Statement type: