Datamodel showing entities and relationships
Project description
apis-datamodel
A reusable Django app that introspects your APIS Core data model and displays a matrix of relations between entity types.
Features
- Automatically discovers all
Relationsubclasses defined in your project - Renders a subject × object matrix where each cell shows the
nameandreverse_nameof the relation - Overridable templates via Django's standard app template loading order
- Django system checks to catch missing dependencies and misconfigured
INSTALLED_APPS/ URL includes early
Requirements
- Python ≥ 3.13
- Django (any version supported by
apis-core-rdf) apis-core-rdf >= 0.62.0
Installation
pip install apis-datamodel
Setup
1. Add to INSTALLED_APPS
apis_datamodel must appear after your project app so project-level template overrides are discovered first:
INSTALLED_APPS = [
...
"apis_core.apis_metainfo",
"apis_core.relations",
"apis_core.apis_entities",
"your_project", # must come before apis_datamodel
"apis_datamodel",
]
2. Include the URLs
# urls.py
from django.urls import include, path
urlpatterns = [
...
path("datamodel/", include("apis_datamodel.urls")),
]
The matrix view is then available at /datamodel/.
Template customisation
The package ships with two templates:
| Template | Purpose |
|---|---|
apis_datamodel/base.html |
Wrapper — provides dm_head and dm_content blocks |
apis_datamodel/datamodel.html |
Renders the relation matrix |
To customise the layout, place a file at the same path inside your own app's templates/ directory. Because your app is listed before apis_datamodel in INSTALLED_APPS, Django will pick yours up first.
The package template for datamodel.html extends apis_datamodel/base.html by default, but you can point it at your own base template by passing a parent_template context variable:
# e.g. in a subclassed view
def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx["parent_template"] = "base.html"
return ctx
System checks
The app registers three Django system checks that run with manage.py check:
| ID | What it validates |
|---|---|
apis_datamodel.E001 |
Required APIS Core apps are present in INSTALLED_APPS |
apis_datamodel.E002 |
apis_datamodel.urls is included in the root URLconf |
apis_datamodel.E003 |
apis_datamodel appears after the host project app in INSTALLED_APPS |
License
MIT
Project details
Release history Release notifications | RSS feed
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 apis_datamodel-0.1.0.tar.gz.
File metadata
- Download URL: apis_datamodel-0.1.0.tar.gz
- Upload date:
- Size: 42.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd9cc764e13ea7b033fb96e0e5c864588be9292cbbd3e543f451589ac2d6767b
|
|
| MD5 |
f0bdd59ff081481c0dcc66f7d0c20503
|
|
| BLAKE2b-256 |
848613c0db7441f23d53d66dbc165aab052e161c47b62c0263f9a0359c93cd0a
|
Provenance
The following attestation bundles were made for apis_datamodel-0.1.0.tar.gz:
Publisher:
publish.yml on gythaogg/apis-datamodel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apis_datamodel-0.1.0.tar.gz -
Subject digest:
cd9cc764e13ea7b033fb96e0e5c864588be9292cbbd3e543f451589ac2d6767b - Sigstore transparency entry: 1786809146
- Sigstore integration time:
-
Permalink:
gythaogg/apis-datamodel@6e07f9531507f6086dea21ee19bf6a17c0a3da91 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gythaogg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e07f9531507f6086dea21ee19bf6a17c0a3da91 -
Trigger Event:
push
-
Statement type:
File details
Details for the file apis_datamodel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: apis_datamodel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e415888f59c5c73a3c6cf1ca60c81c3ed65abd83b3871d4e4118f20f691f02a
|
|
| MD5 |
4cac219c1e75eb106d350a85fa1dfd89
|
|
| BLAKE2b-256 |
42913a4736bc16b06287101a7c3b32b6a83d8b2a80bf664e240c11a6cb15c17b
|
Provenance
The following attestation bundles were made for apis_datamodel-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on gythaogg/apis-datamodel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apis_datamodel-0.1.0-py3-none-any.whl -
Subject digest:
9e415888f59c5c73a3c6cf1ca60c81c3ed65abd83b3871d4e4118f20f691f02a - Sigstore transparency entry: 1786809218
- Sigstore integration time:
-
Permalink:
gythaogg/apis-datamodel@6e07f9531507f6086dea21ee19bf6a17c0a3da91 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gythaogg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e07f9531507f6086dea21ee19bf6a17c0a3da91 -
Trigger Event:
push
-
Statement type: