stapel-categories
Category tree with typed features: a hierarchical category tree (django-treenode) and a parallel feature tree whose typed config is validated by stapel-attributes, an ordered category<->feature M2M, feature inheritance, and a feature-editor lifecycle (keep/add/edit/inherit/remove/create/replace) with optimistic-concurrency apply over a category subtree.
Part of the Stapel framework — composable Django apps that deploy as a monolith or as microservices without changing module code.
Install
pip install stapel-categories
At a glance
| Fact | Value |
|---|---|
| Version | 0.5.5 |
| Python | >=3.11 (3.11, 3.12, 3.13, 3.14) |
| HTTP operations | 27 |
| Config axes | 1 |
| Usage surface | 18 |
| Extension points | 4 |
| Fleet dependencies | stapel-attributes · stapel-core |
Documentation
capabilities.json · llms.txt (for agents)
What this is
A hierarchical category tree (django-treenode) and a parallel feature
tree whose typed config is validated by
stapel-attributes. Categories
own the tree structure, feature inheritance, the ordered category↔feature M2M,
and the feature-editor lifecycle; the attribute engine (types, config/DTO/DAO
validation, polymorphic serializers, admin widgets) lives in stapel-attributes
and is imported, never re-implemented.
Quick start
INSTALLED_APPS = [
# ...
"treenode", # django-treenode (tree-cache signals)
"stapel_categories",
]
# urls.py — the host chooses the prefix
path("categories/", include("stapel_categories.urls"))
stapel-attributes is an imported library (no app to install); its config
editor ships static assets, so run collectstatic if you use the admin.
Settings
All configuration lives in the STAPEL_CATEGORIES namespace (dict setting,
flat setting, or env var — resolved lazily):
| Key | Default | Meaning |
|---|---|---|
CAROUSEL_CACHE_TIMEOUT |
300 |
Seconds the carousel response is cached. |
FEATURE_DISPLAY_CACHE_TIMEOUT |
60 |
Seconds an admin feature display label is memoized. |
DISPLAY_TRANSLATOR |
stapel_categories.translation.identity_translator |
Dotted path (key)->str for rendering translation keys (default: identity). |
comm surface
| Kind | Name | Contract |
|---|---|---|
| Function | categories.features |
{"category_id": int} -> {"category_id", "revision", "features":[{id,slug,name,mandatory,config}]} — resolved schema (own + inherited), cacheable by revision |
| Action (emit) | category.changed |
{"category_id": int, "revision": int} on any category/feature mutation — for downstream cache invalidation |
categories.features lets stapel-listings validate attribute values against a
category's schema without importing this module.
Extension points
See MODULE.md — the agent-facing map of every fork-free seam (settings, serializer seams, comm surface, feature-editor actions, admin-UI pointer to stapel-attributes).
Development
pip install -e . && pip install pytest pytest-django ruff
./setup-hooks.sh
pytest tests/
License
MIT — see LICENSE.
This page is assembled by stapel-readme from docs/readme.md plus the contract artifacts in docs/. Edit the prose in docs/readme.md; the badges, facts and links above and below it are generated — do not hand-edit README.md.
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 stapel_categories-0.5.5.tar.gz.
File metadata
- Download URL: stapel_categories-0.5.5.tar.gz
- Upload date:
- Size: 100.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eac27d522a888cfcd99dbcdd5a1812a1e74992de45619b499f4d8e12c3084ba9
|
|
| MD5 |
066aa62e88673d5ef31524bb56d797f2
|
|
| BLAKE2b-256 |
3aa6a1f6386c455194edbc6061044f79e20c1a3deebc085c1a3d8b121d3d76a3
|
Provenance
The following attestation bundles were made for stapel_categories-0.5.5.tar.gz:
Publisher:
publish.yml on usestapel/stapel-categories
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stapel_categories-0.5.5.tar.gz -
Subject digest:
eac27d522a888cfcd99dbcdd5a1812a1e74992de45619b499f4d8e12c3084ba9 - Sigstore transparency entry: 2477748198
- Sigstore integration time:
-
Permalink:
usestapel/stapel-categories@d46ce6df0fe42f77e2b7ba1d2152f2ecb4aafeb7 -
Branch / Tag:
refs/tags/v0.5.5 - Owner: https://github.com/usestapel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d46ce6df0fe42f77e2b7ba1d2152f2ecb4aafeb7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file stapel_categories-0.5.5-py3-none-any.whl.
File metadata
- Download URL: stapel_categories-0.5.5-py3-none-any.whl
- Upload date:
- Size: 77.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
552a8e9ea937a616743f26fe6f68c79cb9680ca22425df6d1d760723ef0f5060
|
|
| MD5 |
ddcff7289a26a7cfb7b107cbfa4f70a4
|
|
| BLAKE2b-256 |
4a349ca87da9d97976eddbf32f2e99deeb0c91d5d920aed3f02b45b29507ad8e
|
Provenance
The following attestation bundles were made for stapel_categories-0.5.5-py3-none-any.whl:
Publisher:
publish.yml on usestapel/stapel-categories
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stapel_categories-0.5.5-py3-none-any.whl -
Subject digest:
552a8e9ea937a616743f26fe6f68c79cb9680ca22425df6d1d760723ef0f5060 - Sigstore transparency entry: 2477748239
- Sigstore integration time:
-
Permalink:
usestapel/stapel-categories@d46ce6df0fe42f77e2b7ba1d2152f2ecb4aafeb7 -
Branch / Tag:
refs/tags/v0.5.5 - Owner: https://github.com/usestapel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d46ce6df0fe42f77e2b7ba1d2152f2ecb4aafeb7 -
Trigger Event:
push
-
Statement type: