{ "info": { "author": "Andy Driver", "author_email": "andy.driver@digital.justice.gov.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PostcodeInfo Client\n===================\n\n.. image:: https://travis-ci.org/ministryofjustice/postcodeinfo-client-python.svg?branch=master\n :alt: Test result\n :target: http://ci.dsd.io/job/BUILD-postcodeinfo-client-python/lastCompletedBuild/testReport/\n\n.. image:: https://coveralls.io/repos/ministryofjustice/postcodeinfo-client-python/badge.svg?branch=HEAD&service=github\n :target: https://coveralls.io/github/ministryofjustice/postcodeinfo-client-python?branch=HEAD\n :alt: Coverage report\n\n.. image:: https://codeclimate.com/github/ministryofjustice/postcodeinfo-client-python/badges/gpa.svg\n :target: https://codeclimate.com/github/ministryofjustice/postcodeinfo-client-python\n :alt: Code Climate\n\n.. image:: https://requires.io/github/ministryofjustice/postcodeinfo-client-python/requirements.svg?branch=master\n :target: https://requires.io/github/ministryofjustice/postcodeinfo-client-python/requirements/?branch=master\n :alt: Requirements Status\n\nPython package providing an API client for https://github.com/ministryofjustice/postcodeinfo\nwhich contains public sector information licensed under the Open Government License v2.0\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install postcodeinfo\n\n\nUsage\n-----\n\nAuthentication\n~~~~~~~~~~~~~~\n\nYou will need an *authentication token* (auth token). If you're using MOJ DS's\nPostcode Info server, you can get a token by emailing\nplatforms@digital.justice.gov.uk with a brief summary of:\n\n* who you are\n* what project you're going to be using it on\n* roughly how many lookups you expect to do per day\n\nIf you're running your own server, see\nhttps://github.com/ministryofjustice/postcodeinfo#auth_tokens for instructions\non how to create a token.\n\nQuick Start\n~~~~~~~~~~~\n\nIn your code:\n\n.. code-block:: python\n\n >>> import postcodeinfo\n\n >>> # create a client\n >>> client = postcodeinfo.Client(\"YOUR-ACCESS-TOKEN\")\n\n >>> # lookup a postcode\n >>> postcode = client.lookup_postcode(\"SW1A 1AA\")\n\n >>> # postcode details\n >>> postcode.valid\n True\n\n >>> postcode.latitude\n 51.50100893654096\n\n >>> postcode.longitude\n -0.141587558526369\n\n >>> postcode.local_authority\n {\n 'gss_code': 'E09000033',\n 'name': 'Westminster'\n }\n\n >>> postcode.country\n {\n \"name\": \"England\",\n \"gss_code\": \"E92000001\"\n }\n\n >>> postcode.addresses\n [\n {\n \"uprn\": \"10033544614\",\n \"organisation_name\": \"BUCKINGHAM PALACE\",\n \"department_name\": \"\",\n \"po_box_number\": \"\",\n \"building_name\": \"\",\n \"sub_building_name\": \"\",\n \"building_number\": None,\n \"thoroughfare_name\": \"\",\n \"dependent_thoroughfare_name\": \"\",\n \"dependent_locality\": \"\",\n \"double_dependent_locality\": \"\",\n \"post_town\": \"LONDON\",\n \"postcode\": \"SW1A 1AA\",\n \"postcode_type\": \"L\",\n \"formatted_address\": \"Buckingham Palace\\nLondon\\nSW1A 1AA\",\n \"point\": {\n \"type\": \"Point\",\n \"coordinates\": [\n -0.141587558526369,\n 51.50100893654096\n ]\n }\n }\n ]\n\n\nConfiguration\n-------------\n\nApart from the auth token, there is only one other parameter the API client\nneeds - ``api_url``.\n\nExplicit ``api_url``\n~~~~~~~~~~~~~~~~~~~~\n\nYou can set the api_url explicitly by passing it to the ``Client`` constructor\n\n.. code-block:: python\n\n # create a client\n client = postcodeinfo.Client(\"YOUR-API-TOKEN\", api_url=\"https://some.dom.ain\")\n\nor by setting it on an existing client, like this\n\n.. code-block:: python\n\n client = postcodeinfo.Client(\"YOUR-API-TOKEN\")\n client.api_url = \"https://some.dom.ain\"\n\nImplicit ``api_url``\n~~~~~~~~~~~~~~~~~~~~\n\nIf you don't pass an ``api_url`` to the constructor, it will attempt to infer\none from the environment. The client has a built-in mapping of environment names\nto URLs.\n\n.. code-block:: python\n\n >>> postcodeinfo.Client.api_urls\n {\n 'development': 'http://localhost:8000',\n 'test': 'http://localhost:8000',\n 'staging': 'https://postcodeinfo-staging.dsd.io',\n 'production': 'https://postcodeinfo.service.justice.gov.uk'\n }\n\nIt will use the following rules to infer the URL:\n\n1. If you pass an ``env`` parameter to the constructor (eg:\n ``client = postcodeinfo.Client(\"YOUR-API-TOKEN\", env=\"staging\")``), it will\n use that as a reference into the ``api_urls`` mapping.\n2. If you have ``DJANGO_SETTINGS_MODULE`` set in your environment, it will try\n to find the following settings in that module::\n\n POSTCODEINFO_API_URL\n POSTCODEINFO_API_TOKEN\n POSTCODEINFO_API_TIMEOUT\n\n3. Otherwise it will default to ``development``\n\n\nSupport\n-------\n\nThis source code is provided as-is, with no incident response or support levels.\nPlease log all questions, issues, and feature requests in the Github issue\ntracker for this repo, and we'll take a look as soon as we can. If you're\nreporting a bug, then it really helps if you can provide the smallest possible\nbit of code that reproduces the issue. A failing test is even better!\n\n\nContributing\n------------\n\n* Check out the latest master to make sure the feature hasn't been implemented\n or the bug hasn't been fixed\n* Check the issue tracker to make sure someone hasn't already requested\n and/or contributed the feature\n* Fork the project\n* Start a feature/bugfix branch\n* Commit and push until you are happy with your contribution\n* Make sure your changes are covered by unit tests, so that we don't break it\n unintentionally in the future.\n* Please don't mess with setup.py, version or history.\n\n\nCopyright\n---------\n\nCopyright |copy| 2015 HM Government (Ministry of Justice Digital Services). See\nLICENSE for further details.\n\n.. |copy| unicode:: 0xA9 .. copyright symbol\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ministryofjustice/postcodeinfo-client-python", "keywords": "python", "license": "LICENSE", "maintainer": "", "maintainer_email": "", "name": "postcodeinfo", "package_url": "https://pypi.org/project/postcodeinfo/", "platform": "any", "project_url": "https://pypi.org/project/postcodeinfo/", "project_urls": { "Homepage": "https://github.com/ministryofjustice/postcodeinfo-client-python" }, "release_url": "https://pypi.org/project/postcodeinfo/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "API client for https://github.com/ministryofjustice/postcodeinfo", "version": "0.2.2" }, "last_serial": 2633558, "releases": { "0.0.1": [], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3a51c03509b9a259dbc939ffe4f44464", "sha256": "5578cf7e5084158dbcafc763dcf8f5d65c6b04c8a60b49c23bd6161ae26fd596" }, "downloads": -1, "filename": "postcodeinfo-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "3a51c03509b9a259dbc939ffe4f44464", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8785, "upload_time": "2015-05-29T11:11:28", "url": "https://files.pythonhosted.org/packages/8f/c6/3baa322573e8f25be3e32a08d7298a004d5e01c2d85dce674c470803cf66/postcodeinfo-0.0.2-py2-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "b671a8dda03f3db2c06994f34be30acc", "sha256": "54b9e23d3c0e846f326b8c5e3d9f49137e6c599ad1a0f8ea1fe067662780bdd0" }, "downloads": -1, "filename": "postcodeinfo-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b671a8dda03f3db2c06994f34be30acc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6380, "upload_time": "2015-07-21T10:18:13", "url": "https://files.pythonhosted.org/packages/3f/1e/69bb7c56e1a79086a454615d67a552e5704f7190a72aa82b4a5aa07dcd12/postcodeinfo-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "352bf99e5e382ee495c8d187b85049cb", "sha256": "1358dd93f3fafba96970ab95a6446029413d791925c72aa24a070a483af56d3d" }, "downloads": -1, "filename": "postcodeinfo-0.0.4-py2.7.egg", "has_sig": false, "md5_digest": "352bf99e5e382ee495c8d187b85049cb", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 9731, "upload_time": "2015-07-27T16:37:04", "url": "https://files.pythonhosted.org/packages/b9/e7/3c1ed9b4a674b0fd0f47229fb8eee8cf9935198c75ed48296519f2b450c2/postcodeinfo-0.0.4-py2.7.egg" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "71fb6cae675d6e1e0985a777dc238e65", "sha256": "59a524b5d60536ce78b5d1ec20d1ff2d4d5da5a94e1220b9399afba32487ebc5" }, "downloads": -1, "filename": "postcodeinfo-0.0.5-py2.7.egg", "has_sig": false, "md5_digest": "71fb6cae675d6e1e0985a777dc238e65", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 9707, "upload_time": "2015-07-27T16:54:33", "url": "https://files.pythonhosted.org/packages/58/76/60d1feeee69ca170f734cc3fb2911201dea5d011c21613fa3bd9d04388cd/postcodeinfo-0.0.5-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "fbb701515e91929b6d06051acdabc7ea", "sha256": "7b75d6f42833c724c55dee161df52f6f528f5966b3150598ba85acc831a0f28e" }, "downloads": -1, "filename": "postcodeinfo-0.0.5.tar.gz", "has_sig": false, "md5_digest": "fbb701515e91929b6d06051acdabc7ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6474, "upload_time": "2015-07-28T10:29:24", "url": "https://files.pythonhosted.org/packages/4b/2d/1b959834f58df368d492fdc23655baf74b9e9bf4e34b53f22a65ef73937d/postcodeinfo-0.0.5.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "8065193f99a28281b476ca6ecad2cbd1", "sha256": "eaf3d19b903f5c777f638d9d3a0af0ba177266cad5c2daea8bac0ac27d2d966d" }, "downloads": -1, "filename": "postcodeinfo-0.2.1.tar.gz", "has_sig": false, "md5_digest": "8065193f99a28281b476ca6ecad2cbd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6690, "upload_time": "2015-08-06T16:06:50", "url": "https://files.pythonhosted.org/packages/b7/4f/9ec741254703faa9ef79742fcf0a106c4abcb8f586bc8f8f119146b89807/postcodeinfo-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "d9f6fc90a29076c587908cafe505ac1d", "sha256": "c84e735bea0ae7aeecdb0a79843edd56bba2461590f0b2d1e4cb4ec208bd42ca" }, "downloads": -1, "filename": "postcodeinfo-0.2.2.tar.gz", "has_sig": false, "md5_digest": "d9f6fc90a29076c587908cafe505ac1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6721, "upload_time": "2017-02-10T15:00:35", "url": "https://files.pythonhosted.org/packages/b2/d7/9e1007afb838f29ff941c14bd70a2118eabae2c919309eb43f1db09c4fdf/postcodeinfo-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d9f6fc90a29076c587908cafe505ac1d", "sha256": "c84e735bea0ae7aeecdb0a79843edd56bba2461590f0b2d1e4cb4ec208bd42ca" }, "downloads": -1, "filename": "postcodeinfo-0.2.2.tar.gz", "has_sig": false, "md5_digest": "d9f6fc90a29076c587908cafe505ac1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6721, "upload_time": "2017-02-10T15:00:35", "url": "https://files.pythonhosted.org/packages/b2/d7/9e1007afb838f29ff941c14bd70a2118eabae2c919309eb43f1db09c4fdf/postcodeinfo-0.2.2.tar.gz" } ] }