Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Jinja2 filter to look up country codes using the GOV.UK country and territory registers

Project description


Jijna2 filter that uses GOV.UK Registers to look up country codes.

The register data is included in the package so no external requests are required. This package will be updated when new register data is released.


import jinja2

from govuk_country_register import to_country

to_country("UK")  # "United Kingdom"

jinja_env = jinja2.Environment()
jinja_env.filters["to_country"] = to_country

Version History

2019-08-16 version 0.5.0

  • Update country data

2019-06-06 version 0.4.0

  • Refactor code to load CSVs from a Python package

2019-06-06 version 0.3.1

  • Fix bug where unicode characters would cause issues on systems with the default locale

2019-03-14 version 0.3.0

  • Update country data

2019-02-12 version 0.2.2

  • Fix PyPI readme

2019-02-12 version 0.2.1

  • Initial release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for govuk-country-register, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size govuk_country_register-0.5.0-py3-none-any.whl (9.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size govuk-country-register-0.5.0.tar.gz (7.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page