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.4.tar.gz
(591.6 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.4-py3-none-any.whl
(314.2 kB
view details)
File details
Details for the file krons-0.2.4.tar.gz.
File metadata
- Download URL: krons-0.2.4.tar.gz
- Upload date:
- Size: 591.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41380508c311aa1c9b57d856631e850674e287513f3aa547748508da1a8f1d73
|
|
| MD5 |
9e1a0f46b7ba428edea20c3cb3ca33f8
|
|
| BLAKE2b-256 |
55415d2cec172dd68486ec4d0857445733b1b2dfe7828acadb96620737dddd07
|
File details
Details for the file krons-0.2.4-py3-none-any.whl.
File metadata
- Download URL: krons-0.2.4-py3-none-any.whl
- Upload date:
- Size: 314.2 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 |
0f579db0d8199aa0c310decb01a2214d05c1987957c0bcca0f557aa816cbabd0
|
|
| MD5 |
4fc81dc121ce99404d2ab937f0180751
|
|
| BLAKE2b-256 |
d198c471e0c9ef1e3a3a0f3ce6440af82e456ddba646dc2de1a6597dba44e9ca
|