Skip to main content

This is a redistribution of the ONS dataset on Lower Tier Local Authority toUpper Tier Local Authority Lookup packaged for the Quality Lac Data project.Source: Office for National Statistics licensed under the Open Government Licence v.3.0

Project description

Quality LAC Data Reference - Postcodes

This is a redistribution of the ONS Postcode Directory shaped to be used in the Quality Lac Data project.

This repository contains PyPI and npm distributions of subsets of this dataset as well as the scripts to generate them from source.

Source: Office for National Statistics licensed under the Open Government Licence v.3.0

Read more about this dataset here:

To keep distribution small, only pickled dataframes compatible with pandas 1.0.5 are included. This will hopefully change once we figure out how to do different versions as extras.

As pickle is inherently unsafe, the SHA-512 checksum for each file is included in hashes.txt. This file is signed with this key.

When downloading from PyPI, specify the environment variable QLACREF_PC_KEY to either be the public key itself, or a path to where it can be loaded from. The checksums are then verified and each file checked before unpickling.

Regular updates

When a new postcode distribution is available, download it and add it to the source folder and at the same time delete the existing file from this location. There can only be one file in the source folder at a time.

After updating the postcode sources, run the script found in bin/generate-output-files.py to regenerate the output files for each letter of the alphabet. These end up in the qlacref_postcodes directory.

To sign the postcodes, you need the distribution private key. Run the script bin/sign-files.py to create the signed checksum file.

Commit everything to GitHub. If ready to make a release, make sure to update the version in pyproject.toml, push to GitHub and then create a GitHub release. The GitHub Action will then create the distribution files and upload to PyPI.

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

quality-lac-data-ref-postcodes-2021.8.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file quality-lac-data-ref-postcodes-2021.8.tar.gz.

File metadata

File hashes

Hashes for quality-lac-data-ref-postcodes-2021.8.tar.gz
Algorithm Hash digest
SHA256 f15710ea6ecbe775d43a09910288d08916ae4a997b01345c8e7ea99caa2472ef
MD5 90f9e36be8970d112b06b0504e91b887
BLAKE2b-256 c2bf0b06df556f55099c8f9a3f54596a64c8b51df288be5ec1eec3b27c6a6b94

See more details on using hashes here.

File details

Details for the file quality_lac_data_ref_postcodes-2021.8-py3-none-any.whl.

File metadata

File hashes

Hashes for quality_lac_data_ref_postcodes-2021.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1da0f3bff46b92d329c6da9718b68b5e25c5da02d5f92b5516ee511d48334f54
MD5 04155c0c6a23093814577b54c6612c16
BLAKE2b-256 824048291b700d35bf926f4b60e6bc83355b19a1be8936f5a463712443a47f00

See more details on using hashes here.

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