项目作者: eddmash

项目描述 :
Validates UK post code
高级语言: Python
项目地址: git://github.com/eddmash/ukpostcodevalidator.git
创建时间: 2017-03-24T14:06:19Z
项目社区:https://github.com/eddmash/ukpostcodevalidator

开源协议:MIT License

下载


Documentation Status
Build Status

This library validates the uk postal code based on the formating rules found on this article
https://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Formatting

Documentation can be found here
http://ukpostcodevalidator.readthedocs.io/en/latest

Installation

You can install ukpostcodevalidator using pip:

  1. pip install ukpostcodevalidator

Usage

To validate the postal code for UK just invole the validate method on the Uk class as show below:

  1. >>> from ukpostcodevalidator import validator
  2. >>> validator.Uk.validate("AA9A 9AA")

Running Tests

To run tests for the project run the following command while inside the root directory ukpostcodevalidator

  1. py.test tests.py