django PID
django_pid: Extensible PID Pool Management for Django
django_pid is a Django app for managing persistent identifiers (PIDs) such as Handle, DOI, ARK, and more. It provides:
- PID pool management: Pre-registers and reserves PIDs, ensuring a ready supply for assignment to resources.
- Server abstraction: Supports multiple PID server types via a flexible factory pattern.
- Asynchronous operations: Uses Celery tasks for pool replenishment, health checks, and retry logic.
Key Features
- Extensible PIDService Factories: Easily add support for new PID systems by registering custom service builders (see
object_factory.py). The default implementation uses the PID4Cat Handle server, but you can plug in other PID services by implementing and registering a compatible factory. - Robust pool lifecycle: Handles server outages gracefully, with local handle generation and exponential back-off retries.
- Django ORM integration: Models for PID servers, types, and pool entries, with custom managers for pool logic.
Installation
This project uses uv as the default Python package manager and runtime. Do not use pip directly.
uv sync # Install all dependencies from pyproject.toml
For development tools and formatting:
uv run ruff check --fix .
uv run ruff format .
Usage
Add django_pid to your Django INSTALLED_APPS and migrate:
python manage.py makemigrations django_pid
python manage.py migrate
Configure PID servers and types via the Django admin or fixtures. The app will maintain PID pools and handle assignment automatically.
Extending with Custom PID Services
To support additional PID systems, implement a service class with the required interface (see pid_service_builders/pid4cat.py) and register it in the object factory (object_factory.py). This allows seamless integration of new PID backends without modifying core logic.
Project Structure
src/django_pid/models.py: ORM models for servers, types, and PIDssrc/django_pid/tasks.py: Celery tasks for pool managementsrc/django_pid/object_factory.py: Generic factory for service builderssrc/django_pid/pid_service_builders/: Service implementations (default: PID4Cat)
License
See LICENSE for details.
Features
Installation
pip install django_pid --index-url https://gitlab.com/api/v4/projects/<gitlab-project-id>/packages/pypi/simple
Usage
django_pid --help
Development
git clone gitlab.com/opensourcelab/django-pid
# create a virtual environment and activate it then run
pip install -e .[dev]
# run unittests
invoke test # use the invoke environment to manage development
Documentation
The Documentation can be found here: https://opensourcelab.gitlab.io/django-pid or django-pid.gitlab.io
Credits
This package was created with Cookiecutter and the gitlab.com/opensourcelab/software-dev/cookiecutter-pypackage project template.
Metadata
Release files for django-pid 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 | Actions |
|---|---|---|---|---|
| django_pid-0.1.0.tar.gz | 21.1 kB | Without provenance | Details for django_pid-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_pid-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for django_pid-0.1.0-py3-none-any.whl |
Total release size: 52.6 kB
Release files / django_pid-0.1.0.tar.gz
| Download URL | django_pid-0.1.0.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52e22e450c012697eadeafea1b77263b1a9e4b8848d5079a5908f86d9a6f7bb4
|
|
BLAKE2b-256 checksum How to use checksums |
d115b697dfa0a6646e5a89ff0422287287a9813e0948559868d37f163b4cb56c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / django_pid-0.1.0-py3-none-any.whl
| Download URL | django_pid-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a328c285668718dac4ee2a5a6f8e6665c0028dff5c578c3f96f5a550755f93c
|
|
BLAKE2b-256 checksum How to use checksums |
02b781168cea2468ebe1fdd81fe72ba47d0801f027157f99ebe868e51d7de755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for django-pid 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.
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.