This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

An interface to Ordnance Survey’s CodePoint-Open. CodePoint-Open is a free dataset that maps UK postcodes to coordinates.

\(oscodepoint\) reads in this data, whether in the original zip or decompressed, parses the data, and converts grid references to latitude and longitude.

The dataset can be downloaded from http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/

Example:

>>> from oscodepoint import open_codepoint
>>> codepoint = open_codepoint('codepo_gb.zip')
>>> for entry in codepoint.entries():
...    print entry['Postcode'], entry['Latitude'], entry['Longitude']
...    break  # Over 1.6 million rows
AB101AA 57.1482995075 -2.09663094048

Too much data? Try limiting the postcode areas:

>>> from oscodepoint import open_codepoint
>>> codepoint = open_codepoint('codepo_gb.zip')
>>> for entry in codepoint.entries(areas=['NR', 'IP']):
...    print entry['Postcode'], entry['Eastings'], entry['Northings']
...    break
NR1 1AA 624068 308352

Want the postcode’s county?

Postcode entries have a \(Admin_country_code\) field. \(Doc/Codelist.xls\) maps these codes to county names, and \(codepoint.codelist\) can be used to access this file. For example:

>>> from oscodepoint import open_codepoint
>>> codepoint = open_codepoint('codepo_gb.zip')
>>> county_list = codepoint.codelist['County']
>>> for entry in codepoint.entries(areas=['NR']):
...    print entry['Postcode'], entry['Latitude'], entry['Longitude'], county_list.get(entry['Admin_county_code'])
...    break
NR1 1AA 52.6266175146 1.30932087485 Norfolk County

Get the total number of postcodes for your progress bar:

>>> from oscodepoint import open_codepoint
>>> codepoint = open_codepoint('codepo_gb.zip')
>>> print codepoint.metadata['area_counts']['NR']
22730
>>> print codepoint.metadata['total_count']
1692241
Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
oscodepoint-0.2.1.tar.gz (4.3 kB) Copy SHA256 Checksum SHA256 Source Mar 27, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting