Runnable, standalone examples for ChronoMap.
Each one is a single main.py you can read top to bottom and run directly
— no shared framework, no fixtures, no hidden setup.
pip install -r requirements.txt
python config_manager/main.pyEvery example is independent; you don't need to run them in order.
| Example | Demonstrates |
|---|---|
config_manager/ |
Automatic change logging via on_change(), snapshot_context() for auto-rollback on a failed health check |
session_store/ |
TTL-based expiry, background cleanup thread, per-key subscribe() — and a real limitation: subscribers don't fire on TTL-driven expiry, only on writes |
metrics_collector/ |
Time-series data, get_range(), and optional to_dataframe() export |
audit_log/ |
Event sourcing via on_change(), idempotent get_or_set(), comparing two points in time with diff()/diff_detailed() |
game_state/ |
snapshot()/rollback() as a checkpoint system, max_history as a bounded replay buffer, merge() for reconciling state from two sources |
They're the use cases from the original project README, rebuilt as code you can actually run instead of prose describing what the code would do if you wrote it. If you find a gap between what an example claims and what actually happens when you run it, that's a bug report, not a misunderstanding — open an issue.
The main package isn't on PyPI yet, so requirements.txt installs
directly from the Chronomap repo's main branch:
chronomap[pandas] @ git+https://github.com/Chronomap-org/Chronomap.git@main
Once it's published, swap that for a normal version pin
(chronomap[pandas]>=3.0.0) — don't forget to update this file when
that happens.
pip install -r requirements-dev.txt
pytest tests/ -vThese just confirm each example runs to completion without raising —
they don't assert on exact output, since the examples are meant to be
read. CI also runs them weekly on a schedule (not just on push/PR),
specifically to catch breakage from changes landing on Chronomap's
main branch that this repo doesn't otherwise notice.
- New directory, one
main.py, adef main():entry point guarded byif __name__ == "__main__":. - Add it to
EXAMPLE_NAMESintests/test_examples_run.py. - Add a row to the table above.
Keep it runnable standalone with no external services, no API keys, no network calls beyond installing the package itself.