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
Metadata
Release files for apis-datamodel 0.1.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 | |
|---|---|---|---|---|
| apis_datamodel-0.1.0.tar.gz | 42.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apis_datamodel-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.6 kB
Release files / apis_datamodel-0.1.0.tar.gz
| Download URL | apis_datamodel-0.1.0.tar.gz |
|---|---|
| Size | 42.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd9cc764e13ea7b033fb96e0e5c864588be9292cbbd3e543f451589ac2d6767b
|
|
BLAKE2b-256 checksum How to use checksums |
848613c0db7441f23d53d66dbc165aab052e161c47b62c0263f9a0359c93cd0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency logRelease files / apis_datamodel-0.1.0-py3-none-any.whl
| Download URL | apis_datamodel-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e415888f59c5c73a3c6cf1ca60c81c3ed65abd83b3871d4e4118f20f691f02a
|
|
BLAKE2b-256 checksum How to use checksums |
42913a4736bc16b06287101a7c3b32b6a83d8b2a80bf664e240c11a6cb15c17b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency logSecurity for apis-datamodel 0.1.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for apis_datamodel-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency logA 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.