Skip to main content

postcodeapi

postcodeapi is a tiny Python wrapper around the Postcode API V2.

PyPI version Build Status Requirements Status Coverage Status

Installation and usage

Installation

postcodeapi can be installed by running pip install postcodeapi.

Usage

Here is an example of how to use the API client. First you initialize a client with your API key, after that you use one of the four getter methods to fetch the data you need. They all return the actual JSON response converted to a Python dictionary.

# Import the PostcodeAPIClient
from postcodeapi.client import PostcodeAPIClient

# Initialize a client with your API key
client = PostcodeAPIClient(api_key="YOUR_API_KEY")

# Fetch a list of addresses (for a given postal_code and number)
# The postal_code and number parameters are optional
# The number parameter only works together with postal_code
data = client.get_all_addresses(postal_code="5038EA", number=19)
addresses = data["results"] # List of addresses

# Fetch a single address
address = client.get_address(address_id="0855200000046355")

# Fetch a list of postal codes (within a specific area)
# The area parameter is optional
data = client.get_all_postal_codes(area="5038")
postal_codes = data["results"] # List of postal codes

# Fetch a single postal code
postal_code = client.get_postal_code("5038EA")

Documentation

For more information about the data that is returned, please refer to the official API documentation. It is written in Dutch.

Running tests

To run the tests, make sure you have the dev dependencies installed, and run pytest in the root of the project.

Issues

If you have any issues with the API wrapper, please post them here. If you have issues with the actual API, please post them in the official issue tracker of Postcode API.

Metadata

Release files for postcodeapi 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for postcodeapi 1.1.0
File Size Uploaded Provenance Actions
postcodeapi-1.1.0.tar.gz 4.4 kB Without provenance Details for postcodeapi-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for postcodeapi 1.1.0
File Interpreter ABI Platform Actions
postcodeapi-1.1.0-py3-none-any.whl Python 3 none any Details for postcodeapi-1.1.0-py3-none-any.whl

Total release size: 9.3 kB

Release files / postcodeapi-1.1.0.tar.gz

Download URL postcodeapi-1.1.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
71585af45acad2c0e83047faea4f0cbaaf0aaee345986ec693f0cf7632b5e472
BLAKE2b-256 checksum
How to use checksums
9ade783e5f9236bb0c6b68b94426fddaf936e7638a8c238df9a04ba7ece8bdeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release files / postcodeapi-1.1.0-py3-none-any.whl

Download URL postcodeapi-1.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1d37ccac8854b7307202c34fa3a15703e362b987ff757001c5c30ca9f5e4142
BLAKE2b-256 checksum
How to use checksums
f79566f6f78243aed4338b207f8f7603eb9640c1e637e7e3d8ecb7337e15e6f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for postcodeapi 1.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page