Spec-based composable framework for building type-safe systems
Project description
krons
Spec-based composable framework for building type-safe systems.
Installation
pip install krons
Features
- Spec/Operable: Type-safe field definitions with validation, defaults, and DB metadata
- Node: Polymorphic content containers with DB serialization
- Services: Unified service interfaces (iModel) with hooks and rate limiting
- Enforcement: Policy evaluation and action handlers with typed I/O
- Protocols: Runtime-checkable protocols with
@implementsdecorator
Quick Start
from krons.specs import Spec, Operable
# Define specs
name_spec = Spec(str, name="name")
count_spec = Spec(int, name="count", default=0, ge=0)
# Compose into structure
operable = Operable([name_spec, count_spec])
MyModel = operable.compose_structure("MyModel")
Requirements
- Python 3.11+
- pydantic 2.x
- anyio
- httpx
- orjson
License
Apache-2.0
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
krons-0.2.0.tar.gz
(587.0 kB
view details)
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
krons-0.2.0-py3-none-any.whl
(322.0 kB
view details)
File details
Details for the file krons-0.2.0.tar.gz.
File metadata
- Download URL: krons-0.2.0.tar.gz
- Upload date:
- Size: 587.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6f3a82ea4e49de0237ba41ec6a11c01c9ca0155695c83e1c36dd6ea4235f79b
|
|
| MD5 |
fe71b7b1abf85b88f3e20a8b5502cdbc
|
|
| BLAKE2b-256 |
02fcc836e4cb269ee48bf671fd186e1f8f5e8db500191b5bf261fedf3eb0fac6
|
File details
Details for the file krons-0.2.0-py3-none-any.whl.
File metadata
- Download URL: krons-0.2.0-py3-none-any.whl
- Upload date:
- Size: 322.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35d8d49d1601413028bf65bdcca590e9d4c5685ed50b86bc71b30e8c4f8b277d
|
|
| MD5 |
39b2306fe18607bfc76ca091b4f6fa79
|
|
| BLAKE2b-256 |
0c727689e3f7659e9fbf522ae2fc30fd6b0a3825707998b1145e033393884269
|