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.1.tar.gz (62.8 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.1-py3-none-any.whl (64.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: drf_amsterdam-1.1.1.tar.gz
  • Upload date:
  • Size: 62.8 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.1.tar.gz
Algorithm Hash digest
SHA256 df98fc2b9d7f19b140020ea005ec986341b46191aff222bf86caf7d031525351
MD5 012bb196ea73ce78dc15e1007c926d69
BLAKE2b-256 ade092128be0e064c171bb80953ec5b9a805750a80e520de4c788046c5430b90

See more details on using hashes here.

Provenance

The following attestation bundles were made for drf_amsterdam-1.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: drf_amsterdam-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 64.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 077ca0e421a29ee8e381eca8457b2ef526df955a942e77fffc63aa3a82ebc335
MD5 41e29ae8381521e3ad181f2c7becfd89
BLAKE2b-256 e1a7fd66eab6c80444669bcaaa609f8edcd3534393dda5b06d1ae7eb389a7648

See more details on using hashes here.

Provenance

The following attestation bundles were made for drf_amsterdam-1.1.1-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