Skip to main content

Amsterdam Datapunt code and style for Django REST Framework.

Project description

Django REST Framework extensions by Amsterdam Datapunt

Extensions to Django REST Framework by Amsterdam Datapunt. Amsterdam Datapunt provides access to municipal data through, at times, public APIs. This project provides some basic classes and instructions to set the behavior of Django REST Framework API to the standards of Amsterdam Datapunt.

Installation instructions

Given that you have a Django project that generates a REST API using Django REST Framework:

pip install drf_amsterdam

To use the API page styling provided by this package, you need to add datapunt_api to the INSTALLED_APPS list in your Django settings file — before 'rest_framework'. This ensures that the templates and static files included in datapunt_api override those provided by Django REST Framework, so the custom styling is applied correctly.

Building and running the application

If you want to use this package in a local project setup:

pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Note: This package itself is not a standalone application, but is designed to be integrated into an existing Django project.

Running tests

Run the tests in a virtualenv and run the script runtests.py from project root.

requirements: spatialite, sqlite extension

or use docker-compose:

docker compose build
docker compose run --rm tests pytest --cov

Changelog

1.0.0

  • Added types
  • Tidied up code
  • Added tests to reach 100% code coverage

Breaking changes

  • LinksField now extends RelatedField instead of HyperLinkedIdentityField. The reason for this is that HyperLinkedIdentityField has to return a HyperLink object in order to comply with the rules of covariance, which is not what we desire it to return.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drf_amsterdam-1.1.0.tar.gz (63.2 kB view details)

Uploaded Source

Built Distribution

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

drf_amsterdam-1.1.0-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file drf_amsterdam-1.1.0.tar.gz.

File metadata

  • Download URL: drf_amsterdam-1.1.0.tar.gz
  • Upload date:
  • Size: 63.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for drf_amsterdam-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5837c1e5e447d32923aa675c09e9fd7252f63ba417949831027cfbbd12344471
MD5 b21ab8db5abed8c71bc4dcaa25aa88f3
BLAKE2b-256 3deff6f23ca66859fb014f97d489a88b2eabef3b07f24b45b972cb5cac54a794

See more details on using hashes here.

Provenance

The following attestation bundles were made for drf_amsterdam-1.1.0.tar.gz:

Publisher: publish.yaml on Amsterdam/drf_amsterdam

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

File details

Details for the file drf_amsterdam-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: drf_amsterdam-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 65.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for drf_amsterdam-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4cda1d12fc9ae2a060713e8d5871a9a050c53ca6323ca1cf73028e2e1035aac
MD5 caab9dc570348111bbb9656fd0b0d194
BLAKE2b-256 658d668d0d1308db0bd8555bb1b573bba18fe51fb203ce5280def105f8e815c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for drf_amsterdam-1.1.0-py3-none-any.whl:

Publisher: publish.yaml on Amsterdam/drf_amsterdam

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page