Capsule Core book
💊⚛️
Installation
Ensure you have your environment ready (recommended to use uv or pip):
pip install capsulecore-book
Usage
Here is a simple example using the standard JSONLexicon.
from cc_book_kit.capsule import JSONLexicon,
from cc_book_kit.core import Codex, CodexPolicy
# 1. Initialize the storage (Lexicon)
repository = JSONLexicon(storage_path="my_knowledge_base.json")
# 2. Define your business policies
policy = CodexPolicy(
title_unique=True,
tags_lowercase=True,
category_required=True
)
# 3. Create the Codex engine
codex = Codex(repository=repository, policy=policy)
# 4. Create entries
entry_a = codex.create_entry(
title="Python Programming",
content="A high-level programming language.",
tags=["coding", "backend"],
category="Technology"
)
entry_b = codex.create_entry(
title="Knowledge Graphs",
content="A way to represent interconnected data.",
tags=["data", "graph"],
category="Science"
)
# 5. Create a relation between them
relation = codex.create_relation(
from_id=entry_a.id,
to_id=entry_b.id,
connection_type="related_to"
)
print(f"Created entry: {entry_a.title} with ID: {entry_a.id}")
Choosing a Lexicon
Depending on your performance needs, you can swap the storage engine easily:
| Lexicon | Best For... |
|---|---|
| JSONLexicon | Portability and no extra dependencies. |
| UJSONLexicon | Faster serialization than standard json. |
| ORJSONLexicon | Maximum performance, native Datetime/UUID support. |
| PydanticLexicon | Strict data validation and schema integrity. |
Customizing Policies
You can adjust how the Codex behaves by modifying the CodexPolicy:
custom_policy = CodexPolicy(
title_max_length=50,
category_default="Uncategorized",
tags_sort=True
)
codex = Codex(repository=repository, policy=custom_policy)
Key Features
- Hexagonal Architecture: Decouples core logic from storage implementation.
- Graph Structure: Manage data as a network of entries and connections.
- Multiple Lexicons: Out-of-the-box support for standard JSON, ujson, orjson, and Pydantic validation.
- Policy-Driven: Configurable rules for title uniqueness, tag formatting, and category management.
Metadata
Release files for cc.book-kit 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cc_book_kit-0.9.0.tar.gz | 27.9 kB | Without provenance | Details for cc_book_kit-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cc_book_kit-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for cc_book_kit-0.9.0-py3-none-any.whl |
Total release size: 46.5 kB
Release files / cc_book_kit-0.9.0.tar.gz
| Download URL | cc_book_kit-0.9.0.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
829d36dbeb75395d777538ba60fec845fd64836641c1794a69bc3264b6d32514
|
|
BLAKE2b-256 checksum How to use checksums |
c11d16a503ecc670b18aa7eca433869fb75dc95a9c360f4cf39b0dba2c458817
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / cc_book_kit-0.9.0-py3-none-any.whl
| Download URL | cc_book_kit-0.9.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7f39af0577fa83fcb8cf620919ce30fcb671f8b56e83bbab440c92a7f0990f0
|
|
BLAKE2b-256 checksum How to use checksums |
ea6aa15cdbaa207e623985cdc516ec3ea87e8c4c897fe5afbdee9e157f40875b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for cc.book-kit 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.