Skip to main content

Frozen capability registry — register, boot, done.

Project description

spine

Minimal runtime coordination layer for Python projects.

One registry. One freeze. One place where reality gets decided.

This README is for humans browsing GitHub. The complete technical reference lives as inline comments at the top of each .py file — that's where AI assistants should look. Open core.py or observers.py and read the comment block before the imports.

The problem

Every Python project past ~5 files ends up with the same mess. File A imports a path from file B, file C hardcodes a different path, file D assumes the working directory, file E does its own config loading, and file F has no idea what file E decided. Nothing agrees on where things are, how things are loaded, or what things are called.

The fix

A single coordination layer every file reads from. Two rules: before boot, register capabilities. After boot, registry is frozen and read-only for the entire run. No dependency injection. No plugin forest. No abstract factories.

Install

pip install maelspine

Quick start

from spine import Core

c = Core()
c.register("paths.data", Path("./data").resolve())
c.register("paths.logs", Path("./logs").resolve())
c.register("db.backend", SQLiteBackend())
c.boot(env="dev")

data_dir = c.get("paths.data")    # always the same answer
backend  = c.get("db.backend")    # always the same instance
run_id   = c.context.run_id       # unique per run

After boot(), calling register() raises CoreFrozen. That's the entire point.

Full documentation

Open core.py. The first 160 lines are a complete reference — API, design decisions, error types, hit counter usage, file layout, and future split strategy. All as comments. You can't miss it.

Observer (fully detachable)

observers.py watches the core's hit counter and error diagnostics, then sends formatted messages through pluggable backends (Slack, WhatsApp, stdout, custom callbacks). The core has zero knowledge it exists. Delete the file and nothing breaks.

Open observers.py for its full inline documentation.

File layout

spine/
├── __init__.py      re-exports (the stable contract)
├── core.py          Core, RunContext, errors, test harness
└── observers.py     detachable: Observer + backends

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maelspine-0.1.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maelspine-0.1.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file maelspine-0.1.1.tar.gz.

File metadata

  • Download URL: maelspine-0.1.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for maelspine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 41d32bca641d355f968534a077e662cf8209091b64a6f4166d2c0d81bafe5ab5
MD5 66a0a5633b1adb3a1f3aa987701bf77e
BLAKE2b-256 8fc561addbb88e63a880ae519ed06279119538e11b75f435e0a803a6a884f96d

See more details on using hashes here.

File details

Details for the file maelspine-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: maelspine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for maelspine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd12a4b98db4736b5b4310c5aab7405a1938bd73c6aa265aa8d2283a0c0e0ad
MD5 e803ef4b01558e8b5a1fb9c9e2abdb4c
BLAKE2b-256 de6c3641ecdc666195317fe3678488f4a1cff14978c34c85c0afa238c6fc1453

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page