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.1

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.1
File Size Uploaded
wickra_timemachine-0.1.1.tar.gz 46.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for wickra-timemachine 0.1.1
File
wickra_timemachine-0.1.1-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
wickra_timemachine-0.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
wickra_timemachine-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
wickra_timemachine-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
wickra_timemachine-0.1.1-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.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
wickra_timemachine-0.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
wickra_timemachine-0.1.1-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.1.tar.gz

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

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

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

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

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

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

Download URL wickra_timemachine-0.1.1-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
65b5a266abc6c37b604db2a96ba74e85d8cb8231681a585007d7ffac6e7656f6
BLAKE2b-256 checksum
How to use checksums
7a079c497be44e094e7d4bb70a6356d21871d0cebe4cf0002ed4b0df05d30f79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

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

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

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

Download URL wickra_timemachine-0.1.1-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
819fd963d4d9beab6184735d96d8832a8536015921bb51641066c1b7967c334b
BLAKE2b-256 checksum
How to use checksums
b675381252531a30cd756d84d88576d899a3fd7d1e20b10a89dd7553b78c3f5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

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

Download URL wickra_timemachine-0.1.1-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
5041380de04826aef58b5626d0ecbabdd418e2b30292cb889cb56ece9ff869f2
BLAKE2b-256 checksum
How to use checksums
bb81fa8f7a32e09e679638a4bd57e86cb800f01399521c7cb124ca0ebc7fd2d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

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

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

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

Download URL wickra_timemachine-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 748.8 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
5667999951c2ca56a74bc57087efdb2943df800fc7fe49e7c424a0735a60779d
BLAKE2b-256 checksum
How to use checksums
82696ff4a20b208bb9b006f650f9758978bb6d0a72a237c3e4ac2319a61e9954
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

This release

0.1.1 This release

9 release files

0.1.0

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