Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

chronomap-examples

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.

Running an example

pip install -r requirements.txt
python config_manager/main.py

Every example is independent; you don't need to run them in order.

What's here

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

Why these particular five

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.

Installing chronomap for these examples

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.

Running the smoke tests

pip install -r requirements-dev.txt
pytest tests/ -v

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

Adding a new example

  1. New directory, one main.py, a def main(): entry point guarded by if __name__ == "__main__":.
  2. Add it to EXAMPLE_NAMES in tests/test_examples_run.py.
  3. 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.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages