{ "info": { "author": "Sean Pianka", "author_email": "pianka@eml.cc", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "Zipcodes\n========\n\nA lightweight U.S. zip-code validation package for Python (2 and 3).\nThis package was built as\n`zipcode `__ provided too much\nfunctionality and relied on ``sqlite3``, which is not available on\nplatforms such as *AWS Lambda*. While more difficult to add additional\nzip-codes, this package provides the essential functionality of zip-code\nvalidation with fewer dependencies and minimal working logic.\n\n.. image:: https://pepy.tech/badge/zipcodes\n\nContributions are welcome!\n\nInstallation\n============\n\n.. code:: bash\n\n $ pip install zipcodes\n\n\nSynopsis\n========\n\nBelow is the expected usage of this package and a demonstration of\nsupported functionality.\n\n.. code:: python\n\n >>> from pprint import pprint\n >>> import zipcodes\n\n >>> # Simple zip-code matching.\n >>> pprint(zipcodes.matching('77429'))\n [{'zip_code': '77429',\n 'zip_code_type': 'STANDARD',\n 'city': 'CYPRESS',\n 'state': 'TX',\n 'lat': 29.96,\n 'long': -95.69,\n 'world_region': 'NA',\n 'country': 'US',\n 'active': True}]\n\n >>> # Handles of Zip+4 zip-codes nicely. :)\n >>> pprint(zipcodes.matching('77429-1145'))\n [{'zip_code': '77429',\n 'zip_code_type': 'STANDARD',\n 'city': 'CYPRESS',\n 'state': 'TX',\n 'lat': 29.96,\n 'long': -95.69,\n 'world_region': 'NA',\n 'country': 'US',\n 'active': True}]\n\n >>> # Will try to handle invalid zip-codes gracefully...\n >>> print(zipcodes.matching('06463'))\n []\n\n >>> # Until it cannot.\n >>> zipcodes.matching('0646a')\n Traceback (most recent call last):\n ...\n TypeError: Invalid characters, zipcode may only contain digits and \"-\".\n\n >>> zipcodes.matching('064690')\n Traceback (most recent call last):\n ...\n TypeError: Invalid format, zipcode must be of the format: \"#####\" or \"#####-####\"\n\n >>> zipcodes.matching(None)\n Traceback (most recent call last):\n ...\n TypeError: Invalid type, zipcode must be a string.\n\n >>> # Whether the zip-code exists within the database.\n >>> print(zipcodes.is_real('06463'))\n False\n\n >>> # How handy!\n >>> print(zipcodes.is_real('06469'))\n True\n\n >>> # Search for zipcodes that begin with a pattern.\n >>> pprint(zipcodes.similar_to('0643'))\n [{'active': True,\n 'city': 'GUILFORD',\n 'country': 'US',\n 'lat': 41.28,\n 'long': -72.67,\n 'state': 'CT',\n 'world_region': 'NA',\n 'zip_code': '06437',\n 'zip_code_type': 'STANDARD'},\n\n {'active': True,\n 'city': 'HADDAM',\n 'country': 'US',\n 'lat': 41.45,\n 'long': -72.5,\n 'state': 'CT',\n 'world_region': 'NA',\n 'zip_code': '06438',\n 'zip_code_type': 'STANDARD'},\n ... # remaining results truncated for readability...\n ]\n\n >>> # Use filter_by to filter a list of zip-codes by specific attribute->value pairs.\n >>> pprint(zipcodes.filter_by(city=\"WINDSOR\", state=\"CT\"))\n [{\"zip_code\": \"06006\",\n \"zip_code_type\": \"UNIQUE\",\n \"city\": \"WINDSOR\",\n \"state\": \"CT\",\n \"lat\": 41.85,\n \"long\": -72.65,\n \"world_region\": \"NA\",\n \"country\": \"US\",\n \"active\": True },\n\n {\"zip_code\": \"06095\",\n \"zip_code_type\": \"STANDARD\",\n \"city\": \"WINDSOR\",\n \"state\": \"CT\",\n \"lat\": 41.85,\n \"long\": -72.65,\n \"world_region\": \"NA\",\n \"country\": \"US\",\n \"active\": True},\n ],\n\n >>> # Arbitrary nesting of similar_to and filter_by calls, allowing for great precision while filtering.\n >>> pprint(zipcodes.similar_to('2', zips=zipcodes.filter_by(active=True, city='WINDSOR')))\n [{'active': True,\n 'city': 'WINDSOR',\n 'country': 'US',\n 'lat': 33.48,\n 'long': -81.51,\n 'state': 'SC',\n 'world_region': 'NA',\n 'zip_code': '29856',\n 'zip_code_type': 'STANDARD'},\n {'active': True,\n 'city': 'WINDSOR',\n 'country': 'US',\n 'lat': 36.8,\n 'long': -76.73,\n 'state': 'VA',\n 'world_region': 'NA',\n 'zip_code': '23487',\n 'zip_code_type': 'STANDARD'},\n {'active': True,\n 'city': 'WINDSOR',\n 'country': 'US',\n 'lat': 36.0,\n 'long': -76.94,\n 'state': 'NC',\n 'world_region': 'NA',\n 'zip_code': '27983',\n 'zip_code_type': 'STANDARD'}]\n\n >>> # Have any other ideas? Make a pull request and start contributing today!\n >>> # Made with love by Sean Pianka\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/seanpianka/zipcodes", "keywords": "zipcode zip code validation validate codes nosql", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "zipcodes", "package_url": "https://pypi.org/project/zipcodes/", "platform": "", "project_url": "https://pypi.org/project/zipcodes/", "project_urls": { "Homepage": "https://github.com/seanpianka/zipcodes" }, "release_url": "https://pypi.org/project/zipcodes/1.0.5/", "requires_dist": null, "requires_python": "", "summary": "No-SQLite U.S. zipcode validation Python package, ready for use in AWS Lambda", "version": "1.0.5" }, "last_serial": 4634743, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "9a3b62a9023e53f32e4e97c8517cfc33", "sha256": "7385d5ee5b3b05ad15668a467610dd1e2afe79fde579e84eb52a4781221808c3" }, "downloads": -1, "filename": "zipcodes-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9a3b62a9023e53f32e4e97c8517cfc33", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 573009, "upload_time": "2017-09-01T02:06:55", "url": "https://files.pythonhosted.org/packages/01/dc/5cab1ce959cdc86ebb86acddfb6104e1b13772785835db29726c9fdb769a/zipcodes-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed7bd506fe09fcf3d8cf0d7e0c5a83f1", "sha256": "a2a367b1a02f67c3653ed16d99260c5ba0f1d3c396c71764dd4af41a07b4eb74" }, "downloads": -1, "filename": "zipcodes-1.0.3.tar.gz", "has_sig": false, "md5_digest": "ed7bd506fe09fcf3d8cf0d7e0c5a83f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 572516, "upload_time": "2017-09-01T02:06:59", "url": "https://files.pythonhosted.org/packages/5e/6d/f539b7b945c67ff91960a83194751344444765d2a1505112f51bc2b41138/zipcodes-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "42e0bf113af491b597fc9fe5ba99a0bb", "sha256": "1db2fd46f6ed7fed772c05165e49510cd9e7df8f018f326c2c7f1c496d20584c" }, "downloads": -1, "filename": "zipcodes-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "42e0bf113af491b597fc9fe5ba99a0bb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 573120, "upload_time": "2018-03-12T03:01:26", "url": "https://files.pythonhosted.org/packages/5c/69/ab0666e57ed40d5b93182308e23fb3a3417a69ee3ac4869b810c44423a79/zipcodes-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8dc5502bcd1a90cee744a7d22af6b3d8", "sha256": "a4a64c3a8d341441cab4609f73a2b593e7dc41a4d69362d193630c933f3f6635" }, "downloads": -1, "filename": "zipcodes-1.0.4.tar.gz", "has_sig": false, "md5_digest": "8dc5502bcd1a90cee744a7d22af6b3d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 572585, "upload_time": "2018-03-12T03:01:28", "url": "https://files.pythonhosted.org/packages/f9/11/29deb26231ba940247367f58a0a695a40a3a5400834a165193b24a05f566/zipcodes-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "17954374099e140bdda56b3228969d4e", "sha256": "9f5694b50e9484d4f5057bd295715aa23108fc7471b8e330b37d79d8cb2306cf" }, "downloads": -1, "filename": "zipcodes-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "17954374099e140bdda56b3228969d4e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 571731, "upload_time": "2018-12-26T07:52:48", "url": "https://files.pythonhosted.org/packages/81/d1/b52c2d5bd93c8532f78cb2df688baa16cc121351ebd947274eabd944531d/zipcodes-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de0bed7f78df7b0711a08c579096d012", "sha256": "54de2736e41484e2751a36a219979960b02edccc271712424d54098a1c3e253a" }, "downloads": -1, "filename": "zipcodes-1.0.5.tar.gz", "has_sig": false, "md5_digest": "de0bed7f78df7b0711a08c579096d012", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 574075, "upload_time": "2018-12-26T07:52:51", "url": "https://files.pythonhosted.org/packages/94/4e/ec0a47bcd38313694a94fc2154f8e1c7dc12c8f68c2702a79b8855da17d5/zipcodes-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "17954374099e140bdda56b3228969d4e", "sha256": "9f5694b50e9484d4f5057bd295715aa23108fc7471b8e330b37d79d8cb2306cf" }, "downloads": -1, "filename": "zipcodes-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "17954374099e140bdda56b3228969d4e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 571731, "upload_time": "2018-12-26T07:52:48", "url": "https://files.pythonhosted.org/packages/81/d1/b52c2d5bd93c8532f78cb2df688baa16cc121351ebd947274eabd944531d/zipcodes-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de0bed7f78df7b0711a08c579096d012", "sha256": "54de2736e41484e2751a36a219979960b02edccc271712424d54098a1c3e253a" }, "downloads": -1, "filename": "zipcodes-1.0.5.tar.gz", "has_sig": false, "md5_digest": "de0bed7f78df7b0711a08c579096d012", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 574075, "upload_time": "2018-12-26T07:52:51", "url": "https://files.pythonhosted.org/packages/94/4e/ec0a47bcd38313694a94fc2154f8e1c7dc12c8f68c2702a79b8855da17d5/zipcodes-1.0.5.tar.gz" } ] }