Skip to main content

package supports validating and formatting postcodes for the UK

Project description

ideal_ukpostcode

image

package supports validating and formatting postcodes for the UK

Introduction

package supports validating and formatting postcodes for the UK. The details of which postcodes are valid and which are the parts they consist of can be found at wiki

Installation

To install ideal_ukpostcode, run this command in your terminal:

pip install ideal_ukpostcode

This is the preferred method to install ideal_ukpostcode, as it will always install the most recent stable release.

If you don't have pip installed, this Python installation guide can guide you through the process.

From sources

The sources for ideal_ukpostcode can be downloaded from the Github repo.

You can clone the public repository:

git clone git://github.com/myselfdesai/ideal_ukpostcode

Usage

To use ideal_ukpostcode in a project:

validate a postcode

it gives boolean result True or False

import ideal_ukpostcode
ideal_ukpostcode.validate("EC1A 1BB")

format a postcode

format(area, district, sector, unit)

import ideal_ukpostcode
ideal_ukpostcode.format("EC","1A","1","BB")

Test

install dev dependencies

pip install -r requirements_dev.txt

In the root folder, execute :

pytest

Credits

This package was created with Cookiecutter and the giswqs/pypackage project template.

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

ideal_ukpostcode-1.0.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

ideal_ukpostcode-1.0.2-py2.py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 2 Python 3

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