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
.pyfile — that's where AI assistants should look. Opencore.pyorobservers.pyand 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 spine
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
└── README.md this file
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maelspine-0.1.0.tar.gz.
File metadata
- Download URL: maelspine-0.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db13bd6c9ffa618fdc77013b804ce9455df94532ade317917b7dcd0ede966320
|
|
| MD5 |
807ab12fc0eb64fa59fe1ae1625457ad
|
|
| BLAKE2b-256 |
5d6696be2fc1e029560cd5fd617cd67c9066151a5b2430bed6db26fd09f302eb
|
File details
Details for the file maelspine-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maelspine-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ab13a1ea787dddf8aeae879c9dcbb669ddc1c1bda9fccedcaae5a6cec230d9e
|
|
| MD5 |
357a8d2527abf061d9bc6bed98c70a31
|
|
| BLAKE2b-256 |
30286aa51e1b291ef951694c52406e2d96c76b18c9b83e91dbbd9c9b2959b7d6
|