Skip to main content

t4racker

PyPI Tests

Transparent time-travel tracker for Python objects. Records mutations to dicts, sets, lists, and custom objects—then replay state at any step.

Install

pip install t4racker

Usage

from t4racker import TTTTracker, TrackReplayer


class Algorithm:
    def __init__(self):
        self.visited = set()
        self.path = []


tracker = TTTTracker()
algo = Algorithm()
tracker.track(algo, tracked_fields=['visited', 'path'])
tracker.capture_snapshot('start')

algo.visited.add('A')
algo.path.append('A')
algo.visited.add('B')
algo.path.append('B')

# Export
data = tracker.to_dict()

# Replay
replayer = TrackReplayer(data)
state = replayer.state_at(2)  # State after step 2
print(state)  # {'visited': {'A', 'B'}, 'path': ['A']}

What it tracks

  • dict: __setitem__, __delitem__
  • set: add, remove, discard
  • list: append, pop, __setitem__, clear, extend
  • Custom objects: attribute assignments

Nested containers are tracked recursively.

Tests

pytest

License

MIT

Metadata

Release files for t4racker 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 t4racker 0.1.0
File Size Uploaded
t4racker-0.1.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for t4racker 0.1.0
File Interpreter ABI Platform
t4racker-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / t4racker-0.1.0.tar.gz

Download URL t4racker-0.1.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cd0c7b54af105a012c518918f5a063f9cbad4dcd1c74ceb09d7b3335dac92372
BLAKE2b-256 checksum
How to use checksums
f9ceb9876ad6401f4b0bed0222f845ac308bffa5330d5dcf31a950477e0b1028
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.3 Darwin/23.4.0

Release files / t4racker-0.1.0-py3-none-any.whl

Download URL t4racker-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c94cd761a4c238b304453359f37b1c2ce4987425c04ae7d23bdeab382ff58ea3
BLAKE2b-256 checksum
How to use checksums
23e345710bc016e8094fd8cd906daea0d3e24cf83d2fad72bcb950d3bcbc63c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.3 Darwin/23.4.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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