Skip to main content

stapel-categories

CI coverage pypi downloads python license llms.txt

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.6
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
Function categories.path {"category_ids": [int, ...]} -> {"<id>": ["<root_id>", ..., "<id>"]} — root->leaf ancestry, one query for the batch; segments are ids, an unknown id is absent
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. categories.path is the provider stapel-search declares by canonical name for category rollup — without it a search index degrades to a single path segment and a filter on a parent category finds none of its descendants.

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

stapel_categories-0.5.6.tar.gz (102.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stapel_categories-0.5.6-py3-none-any.whl (79.9 kB view details)

Uploaded Python 3

File details

Details for the file stapel_categories-0.5.6.tar.gz.

File metadata

  • Download URL: stapel_categories-0.5.6.tar.gz
  • Upload date:
  • Size: 102.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stapel_categories-0.5.6.tar.gz
Algorithm Hash digest
SHA256 5a40729413c3fe8988513153ee277cba20fe62cc461d5a3cea6970eb87adba1d
MD5 3c15f343429c442e6098383bd33853b4
BLAKE2b-256 c8a9d15e7cf1b53540ebe49ae6caa9d4a38c2dd3601229b3c691aeb6ece5ba4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_categories-0.5.6.tar.gz:

Publisher: publish.yml on usestapel/stapel-categories

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stapel_categories-0.5.6-py3-none-any.whl.

File metadata

File hashes

Hashes for stapel_categories-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0edff45393174386f587c2eab1703ba3a5dd4e10a99e0b2379bd6d4979a70de1
MD5 6ac578420f9bb3d748f0d9e8b82487eb
BLAKE2b-256 2fa68a6cfdfe11dc0f75a0f0ff7717c056751515e3ece07bad3ccac929aa2788

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_categories-0.5.6-py3-none-any.whl:

Publisher: publish.yml on usestapel/stapel-categories

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.20.5

2 files

0.20.4

2 files

0.20.3

2 files

0.20.2

2 files

0.20.1

2 files

0.20.0

2 files

0.19.1

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.1

2 files

0.16.0

2 files

0.15.2

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.0

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

This release

0.5.6 This release

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page