Skip to main content

Pluggable postcode lookup endpoint

Project description

This Django app providers a pluggable postcode django rest framework endpoint. It currently only works for postcodes in The Netherlands.

Currently supports the following services:
  • ApiWise

  • Webservices.nl

  • postcodeapi.nu

Status

https://travis-ci.org/LabD/django-postcode-lookup.svg?branch=master http://codecov.io/github/LabD/django-postcode-lookup/coverage.svg?branch=master https://img.shields.io/pypi/v/django-postcode-lookup.svg

Installation

pip install django_postcode_lookup

Usage

Add the following to your urls.py:

path('postcode-lookup/', include('django_postcode_lookup.urls')),

Add a setting with the required backend

Webservices:

POSTCODE_LOOKUP = {
    'default': {
        'backend': 'django_postcode_lookup.backends.Webservices',
        'OPTIONS': {
            'username': 'someuser',
            'password': 'somepassword',
        }
    }
}

ApiWise:

POSTCODE_LOOKUP = {
    'default': {
        'backend': 'django_postcode_lookup.backends.ApiWise',
        'OPTIONS': {
            'api_key': 'somekey',
        }
    }
}

postcodeapi.nu:

POSTCODE_LOOKUP = {
    'default': {
        'backend': 'django_postcode_lookup.backends.PostcodeApiNu',
        'OPTIONS': {
            'api_key': 'somekey',
            'base_url': 'https://somebaseurl.com',
        }
    }
}

To offer some form of protection to the api endpoint for usage by others a valid csrf token is required.

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

django-postcode-lookup-1.0.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

django_postcode_lookup-1.0.1-py2.py3-none-any.whl (9.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-postcode-lookup-1.0.1.tar.gz.

File metadata

  • Download URL: django-postcode-lookup-1.0.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for django-postcode-lookup-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5799645156a8b6e3a6000c58575a05acb0ca312190602097da79da7fe1bcfcf4
MD5 753140f07f15c5c79f196de29a0b0ed5
BLAKE2b-256 a9f459732a32ccb77b45c4b45af0418ec10493bdcced81357629383d43c5d34b

See more details on using hashes here.

Provenance

File details

Details for the file django_postcode_lookup-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_postcode_lookup-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for django_postcode_lookup-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e5f5bce3f54853000c43903e1d839990c42ffe4c5e0a9083d03de21a4728ed5d
MD5 3d6981203ca8ca35e986347c0caba5d9
BLAKE2b-256 8d5bcc1a13d0c5df0e426df6543d4c659041416e42528e10642b3511829002b2

See more details on using hashes here.

Provenance

Supported by

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