wire
A tiny, broker-neutral order-intent wire schema for a producer/consumer
transport (Redis Streams or anything else). A strategy process produces
OrderIntents; an executor process consumes them and reports back with
ResultEvents. wire is the vendor-free contract both sides agree on: pure
stdlib dataclasses with explicit JSON (de)serialisation, no broker, transport,
or networking imports.
Install
pip install dollarsmore-wire
# or
uv add dollarsmore-wire
from wire import OrderIntent, ResultEvent, IntentAction, OrderType
The distribution is dollarsmore-wire; the import package is wire.
What's in it
OrderIntent— an order command:OPEN/CLOSE/CANCEL, 1-4IntentLegs, order type, price (positive-magnitudeDecimal) with an explicitPriceEffect(DEBIT/CREDIT), time-in-force, correlation id, strategy tag.OpenBracketIntent— an entry plus a pre-staged take-profit as one OTO bracket.ResultEvent— the executor's reply:ACCEPTED/REJECTED/FILLED/CANCELLED/ERROR, broker order id, fill price, detail.- Enums:
IntentAction,LegAction,OptionType,OrderType,PriceEffect,ResultStatus.
Every type round-trips through .to_wire() / .from_wire() plain dicts, so the
transport only ever moves JSON.
Redis-Streams transport (wire.transport)
wire.transport is the shared Redis-Streams envelope both producer and consumer
agree on — stream names (orders:intents / :results / :deadletter), the
consumer group, and pure encode_* / decode_* helpers that wrap a wire object
in a {kind, payload} dict. It has no redis import (stdlib + wire only); the
caller drives its own redis client (client.xadd(INTENTS_STREAM, encode_bracket(intent))). Keeping it here stops producer and consumer drifting
on the wire format.
Versioning
WIRE_VERSION is stamped into every serialised payload (the v field). Bump it
on any breaking change to the wire shape so producer and consumer can detect a
mismatch.
Design rules
- Stdlib only — no third-party dependencies, ever.
- Money is a positive-magnitude
Decimalplus an explicitPriceEffect; never a signed float. - Times are ISO 8601 strings on the wire; enums travel by value.
Develop
uv sync
uv run pytest -q
uv run ruff check .
uv run mypy wire tests
Metadata
Release files for dollarsmore-wire 0.4.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 |
|---|---|---|---|---|
| dollarsmore_wire-0.4.1.tar.gz | 387.8 kB | Without provenance | Details for dollarsmore_wire-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dollarsmore_wire-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for dollarsmore_wire-0.4.1-py3-none-any.whl |
Total release size: 395.8 kB
Release files / dollarsmore_wire-0.4.1.tar.gz
| Download URL | dollarsmore_wire-0.4.1.tar.gz |
|---|---|
| Size | 387.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6eccf2430581f0a1dc480f861ed2caf8eeaa9ff8820ea853829c95b4f741ab86
|
|
BLAKE2b-256 checksum How to use checksums |
ef58b2a47b9daaed6a38dda495a88a9ba08f6071caf125d1982eccd9a4dc9ace
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / dollarsmore_wire-0.4.1-py3-none-any.whl
| Download URL | dollarsmore_wire-0.4.1-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f6f940f3d27bc6f8d43bd4dfcb59239da115b1419c151f6a4119138ec40f8ae
|
|
BLAKE2b-256 checksum How to use checksums |
d90d4ab0485a46cd5eb429006dd3448e491b2a160d7e57b8e3e76921bc79a6a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for dollarsmore-wire 0.4.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.