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.0.3.tar.gz (63.2 kB view details)

Uploaded Source

Built Distribution

drf_amsterdam-1.0.3-py3-none-any.whl (65.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for drf_amsterdam-1.0.3.tar.gz
Algorithm Hash digest
SHA256 fe9955ec4ed0f69dec1920954b4bff1f1b060ec40b5fcdc6e9ee0ba0d119c2ad
MD5 6671b45b82bf894c45044e5e61c2528e
BLAKE2b-256 d63b134cea1e17dfd3855ed2002fa7dab406c7d341e9ab532ef8acdb922e887b

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for drf_amsterdam-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b784c6f7c32042b590a31e39b5d1b0b15c578419492124919bba16e1fa4905f
MD5 4bd4a47344cbb642e19232951588cbd6
BLAKE2b-256 33794c0a188eada155cb16d071715170bf2eba5af27fff603b926ec8a7115b0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for drf_amsterdam-1.0.3-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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page