Skip to main content

Wickra Time Machine — Python

Python bindings for the Wickra Time Machine, built with PyO3 and maturin. A TimeMachine handle is driven over a JSON boundary, so seeking a recorded feed to a timestamp yields the byte-identical snapshot as every other Wickra Time Machine binding.

Install

pip install wickra-timemachine

Usage

import json
from wickra_timemachine import TimeMachine

feed = "\n".join(json.dumps(line) for line in [
    {"ts": 10, "symbol": "BTC-USDT", "feed": {"kind": "market", "type": "trade",
     "symbol": {"base": "BTC", "quote": "USDT"}, "price": "100", "quantity": "1",
     "aggressor": "Buy", "timestamp": 10}},
    {"ts": 20, "symbol": "BTC-USDT", "feed": {"kind": "market", "type": "trade",
     "symbol": {"base": "BTC", "quote": "USDT"}, "price": "110", "quantity": "2",
     "aggressor": "Sell", "timestamp": 20}},
])

tm = TimeMachine("{}")
tm.command(json.dumps({"cmd": "load", "data": feed}))
snapshot = json.loads(tm.command(json.dumps({"cmd": "seek", "ts": 20})))
print(snapshot["symbols"]["BTC-USDT"]["last"])  # 110.0

Surface

  • TimeMachine(spec_json) — construct a handle from a TimelineSpec JSON ("{}" uses the default spec). Raises ValueError on an invalid spec.
  • TimeMachine.command(cmd_json) — apply a command envelope ({"cmd":"...", ...}) and return the response JSON. Commands: load, seek, state_at, play, version. Raises RuntimeError on a command failure.
  • TimeMachine.version() — the library version.

Determinism

The re-fold lives only in the Rust core; this binding forwards the command string verbatim, so seeking to a given timestamp produces the byte-identical snapshot here and in every other binding — the exact cross-language golden invariant.

See also

License

Dual-licensed under either MIT or Apache-2.0, at your option.

Release files for wickra-timemachine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wickra-timemachine 0.1.0
File Size Uploaded
wickra_timemachine-0.1.0.tar.gz 46.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for wickra-timemachine 0.1.0
File
wickra_timemachine-0.1.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
wickra_timemachine-0.1.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
wickra_timemachine-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
wickra_timemachine-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
wickra_timemachine-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
wickra_timemachine-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
wickra_timemachine-0.1.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
wickra_timemachine-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 6.1 MB

Release files / wickra_timemachine-0.1.0.tar.gz

Download URL wickra_timemachine-0.1.0.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
36ca55b71edce41daffd1983b442bf05339b9e6fc499987fb6172098a6aecf98
BLAKE2b-256 checksum
How to use checksums
a41e8703e182147d2daff9a2412c0550c557a0bc7c88cfbf7bb271c298324193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-win_arm64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-win_arm64.whl
Size 585.3 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
31f2d8b66accc96109d80e8f1e439846bedf85cf428ee52481d0ee08880743d3
BLAKE2b-256 checksum
How to use checksums
809e612978f6f7361e9361b89af973135a92608c632b24f0e92f4b98a02905a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-win_amd64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-win_amd64.whl
Size 662.5 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
6938c88c1a17c9fdf3e92266d7ff26c8a5ba502164f1ba7b3f55b04e5c89b398
BLAKE2b-256 checksum
How to use checksums
a92782a7f74f595a8f836d002a6420b3b4ec1e9dcfb3c57adca037d78ad31a77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.0 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
8ba9396be153ee53d7ec8e79860e913dc0113fa74f8cae3453b0ed032b7ad05e
BLAKE2b-256 checksum
How to use checksums
01b8de473e219e2bf49f144afab2596c215c01f3fc679aa334eccfb566e53b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 896.1 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
c94efb604a8cce8d630d436896bfb977e45edfe0399013759532209176ce3598
BLAKE2b-256 checksum
How to use checksums
e410ae973a04c355cf02bec17682edffa93f64a8167990f615f3d4ec5e5aaa32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 794.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
614ad865e005f3688cc8b6b12552befca8d65328aef29478818ac8870c7c0008
BLAKE2b-256 checksum
How to use checksums
483619a3289d0faeddf386f4e542235339a0ff541f96a34538b584218457bb6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 718.4 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
cc644c19f29989bda6b19e3fb6ded89965ead5f5e5c27021bd626395dc8943d5
BLAKE2b-256 checksum
How to use checksums
2d9b3f7bc7be2ad27c7b57bf047e15ae9e85ebc165faaa61971ef3a116ef645f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Size 650.9 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
277b65973aea21124f162cc33c749c53bc430fcee24389de2fc6ccae63de180f
BLAKE2b-256 checksum
How to use checksums
e847dbdd6703aab1fda76fc6b79bf34011fe465be505e3d7c3f385b56337e168
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / wickra_timemachine-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL wickra_timemachine-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 748.7 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
63577cdea9d4c08dd789203c5ca3634255cb4cfded5276a9c9d57e5e8c09e917
BLAKE2b-256 checksum
How to use checksums
3260dff338b42efb4aad7916816b97854a23686f380c8c0b110a4313413ef18a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release history Release notifications | RSS feed

0.1.4

9 release files

0.1.3

9 release files

0.1.2

9 release files

0.1.1

9 release files

This release

0.1.0 This release

9 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page