{ "info": { "author": "Paul Wolf", "author_email": "paul.wolf@yewleaf.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "UKPC\n====\n\n|Build Status|\n\nukpc is a Python module that parses United Kingdom postcode strings into\nconstituent parts:\n\n- area\n- district\n- sector\n- unit\n\nInstall:\n\n::\n\n pip install ukpc\n\nCurrently, only Python 3.x is supported. Let me know if you need 2.7+\nsupport.\n\nUsage:\n\n::\n\n >>> from ukpc import PostCode\n pc = PostCode('NW3 2RR')\n >>> str(pc)\n 'area=NW, district=3, sector=2, unit=RR'\n\nYou can get parts with properties as expected. We also provide\n``PostCode.farea``, ``PostCode.fdistrict``, ``PostCode.fsector``,\n``PostCode.funit`` properties. Some people refer to sector as the\ncumulative postcode up to and including sector rather than just the\nsector number:\n\n::\n\n >>> pc.sector\n '2'\n >>> pc.fsector\n 'NW3 2'\n\n``farea`` and ``area`` are the same. ``funit`` is the input string, the\nfull postcode.\n\nThere is not too much validation and no reformatting of postcodes! An\nexception will be thrown if the parser can't parse the string. The\nparser expects well-formed, upper-case strings as input. If you want to\nvalidate or format postcodes, there are some other projects that appear\nto do this well:\n\nhttps://github.com/andersonbispo/ukpcode\n\nhttps://github.com/hamstah/ukpostcodeparser/blob/master/ukpostcodeparser/parser.py\n\nWe also provide a utility for reading a file of postcodes. The file is\nexpected to be csv and the first column only is read as a well-formed,\nupper-case postcode.\n\n::\n\n from ukpc.utils import iterate_file\n iterate_file(path, callback=store_pc_in_database)\n\n``callback`` is any callable that you must provide. This will cause\n``store_pc_in_database()`` to be called with a ``PostCode`` instance.\n\nThere is also a command line util that calls ``iterate_file()``:\n\n::\n\n (.env)\u279c ukpc python -m ukpc.utils postcodes.csv --stats\n time in secs: 27\n areas: 123\n districts: 3089\n sectors: 12302\n units: 401\n\nGet a list of all postcodes with geo information here:\n\nhttps://www.doogal.co.uk/PostcodeDownloads.php\n\nWe follow this specification:\n\nhttps://www.mrs.org.uk/pdf/postcodeformat.pdf\n\nTesting\n-------\n\n::\n\n pip install pytest\n cd logtrace\n pytest test.py --verbose\n\nor\n\n::\n\n python3 logtrace/test.py\n\nPerformance\n-----------\n\n.. |Build Status| image:: https://travis-ci.org/paul-wolf/ukpc.svg?branch=master\n :target: https://travis-ci.org/paul-wolf/ukpc", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/paul-wolf/ukpc", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "ukpc", "package_url": "https://pypi.org/project/ukpc/", "platform": "", "project_url": "https://pypi.org/project/ukpc/", "project_urls": { "Homepage": "https://github.com/paul-wolf/ukpc" }, "release_url": "https://pypi.org/project/ukpc/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Parse United Kingdom postal codes", "version": "0.1.0" }, "last_serial": 3510303, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b61d9f1bca78adaedda73f6fa7825e9e", "sha256": "72ad8ffb17738d8f66ad045464ddfb6039197cc19aef4e07a886ce6962186377" }, "downloads": -1, "filename": "ukpc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b61d9f1bca78adaedda73f6fa7825e9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5041, "upload_time": "2018-01-22T07:04:58", "url": "https://files.pythonhosted.org/packages/e9/67/dc42bedb9a3f8151265408909166b0742b6303051b37a098be0c2c06d07e/ukpc-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b61d9f1bca78adaedda73f6fa7825e9e", "sha256": "72ad8ffb17738d8f66ad045464ddfb6039197cc19aef4e07a886ce6962186377" }, "downloads": -1, "filename": "ukpc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b61d9f1bca78adaedda73f6fa7825e9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5041, "upload_time": "2018-01-22T07:04:58", "url": "https://files.pythonhosted.org/packages/e9/67/dc42bedb9a3f8151265408909166b0742b6303051b37a098be0c2c06d07e/ukpc-0.1.0.tar.gz" } ] }