{ "info": { "author": "Jeremy Carbaugh", "author_email": "jeremy@isl.co", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": ".. image:: https://circleci.com/gh/unitedstates/python-us/tree/master.svg?style=shield\n :target: https://circleci.com/gh/unitedstates/python-us/tree/master\n\nUS: The Greatest Package in the World\n=====================================\n\nA package for easily working with US and state metadata.\n\n* all US states and territories\n* postal abbreviations\n* Associated Press style abbreviations\n* FIPS codes\n* capitals\n* years of statehood\n* time zones\n* phonetic state name lookup\n* is contiguous or continental\n* URLs to shapefiles for state, census, congressional districts,\n counties, and census tracts\n\nCongratulations, DC. As far as this package is concerned, you've got statehood.\n\n\nInstallation\n------------\n\nAs per usual: ::\n\n pip install us\n\n\nFeatures\n--------\n\nEasy access to state information: ::\n\n >>> import us\n >>> us.states.MD\n \n >>> us.states.MD.fips\n u'24'\n >>> us.states.MD.name\n u'Maryland'\n >>> us.states.MD.is_contiguous\n True\n\nIncludes territories too: ::\n\n >>> us.states.VI.name\n u'Virgin Islands'\n >>> us.states.VI.is_territory\n True\n >>> us.states.MD.is_territory\n False\n\nList of all (actual) states: ::\n\n >>> us.states.STATES\n [, , , ,...\n >>> us.states.TERRITORIES\n [, , ,...\n\nAnd the whole shebang, if you want it: ::\n\n >>> us.states.STATES_AND_TERRITORIES\n [, , ,...\n\nFor convenience, `STATES`, `TERRITORIES`, and `STATES_AND_TERRITORIES` can be\naccessed directly from the `us` module: ::\n\n >>> us.states.STATES\n [, , , ,...\n >>> us.STATES\n [, , , ,...\n\nThere's also a list of obsolete territories: ::\n\n >>> us.states.OBSOLETE\n [, , ]\n\nThe state lookup method allows matching by FIPS code, abbreviation, and name: ::\n\n >>> us.states.lookup('24')\n \n >>> us.states.lookup('MD')\n \n >>> us.states.lookup('md')\n \n >>> us.states.lookup('maryland')\n \n\nAnd for those days that you just can't remember how to spell Mississippi,\nwe've got phonetic name matching too: ::\n\n >>> us.states.lookup('misisipi')\n \n\n\nShapefiles\n----------\n\nYou want shapefiles too? Gotcha covered.\n\n::\n\n >>> shpurls = us.states.MD.shapefile_urls()\n >>> for region, url in shpurls.items():\n ... print \"%s: %s\" % (region, url)\n ...\n county: http://www2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/tl_2010_24_county10.zip\n state: http://www2.census.gov/geo/tiger/TIGER2010/STATE/2010/tl_2010_24_state10.zip\n cd: http://www2.census.gov/geo/tiger/TIGER2010/CD/111/tl_2010_24_cd111.zip\n zcta: http://www2.census.gov/geo/tiger/TIGER2010/ZCTA5/2010/tl_2010_24_zcta510.zip\n tract: http://www2.census.gov/geo/tiger/TIGER2010/TRACT/2010/tl_2010_24_tract10.zip\n\nThe `shapefile_urls()` method on the State object generates shapefile URLs for\nthe following regions:\n\n* state\n* county\n* congressional district\n* zcta\n* census tract\n\nIf you know what region you want, you can explicitly request it: ::\n\n >>> us.states.MD.shapefile_urls('county')\n u'http://www2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/tl_2010_24_county10.zip'\n\n\nMappings\n--------\n\nMappings between various state attributes are a common need. The `mapping()`\nmethod will generate a lookup between two specified fields.\n\n::\n\n >>> us.states.mapping('fips', 'abbr')\n {u'30': u'MT', u'54': u'WV', u'42': u'PA', u'48': u'TX', u'45': u'SC',...\n >>> us.states.mapping('abbr', 'name')\n {u'WA': u'Washington', u'VA': u'Virginia', u'DE': u'Delaware',...\n\n\nCLI\n----\n\nWhen you need to know state information RIGHT AWAY, there's the *states* script.\n\n::\n\n $ states md\n\n *** The great state of Maryland (MD) ***\n\n FIPS code: 24\n\n other attributes:\n ap_abbr: Md.\n capital: Annapolis\n capital_tz: America/New_York\n is_obsolete: False\n name_metaphone: MRLNT\n statehood_year: 1788\n time_zones: America/New_York\n\n shapefiles:\n blockgroup: http://www2.census.gov/geo/tiger/TIGER2010/BG/2010/tl_2010_24_bg10.zip\n cd: http://www2.census.gov/geo/tiger/TIGER2010/CD/111/tl_2010_24_cd111.zip\n county: http://www2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/tl_2010_24_county10.zip\n state: http://www2.census.gov/geo/tiger/TIGER2010/STATE/2010/tl_2010_24_state10.zip\n tract: http://www2.census.gov/geo/tiger/TIGER2010/TRACT/2010/tl_2010_24_tract10.zip\n zcta: http://www2.census.gov/geo/tiger/TIGER2010/ZCTA5/2010/tl_2010_24_zcta510.zip\n block: http://www2.census.gov/geo/tiger/TIGER2010/TABBLOCK/2010/tl_2010_24_tabblock10.zip\n\n\nContributing\n------------\n\nYour contributions are welcomed!\n\nState data is stored in an SQLite database, *data.db*, and pickled using the\n*build.py* script. If you modify *data.db*, please be sure to run the build\nscript before submitting a pull request.\n\nAny changes other than additions to *data.db* should come with appropriate\ntests in *test.py*. Also check to see if the *states* CLI script should be\nmodified to accommodate your change.\n\nChangelog\n---------\n\n1.0.0\n~~~~~\n\n* full Python 3.6 support\n* use pytest\n\n\n0.10.0\n~~~~~~\n\n* upgrade jellyfish to 0.5.3 to fix metaphone bug\n\n0.9.0\n~~~~~\n\n* add information on whether a state is contiguous and/or continental,\n thanks to `chebee7i `_\n\n0.8.0\n~~~~~\n\n* add obsolete territories, thanks to `Ben Chartoff `_\n* fix packaging error, thanks to `Alexander Kulakov `_\n\n\n0.7.1\n~~~~~\n\n* upgrade to jellyfish 0.5.1 to fix metaphone case bug\n\n0.7\n~~~\n\n* add time zones, thanks to `Paul Tagliamonte `_\n* Python 2.6 and 3.2 compatibility\n\n0.6\n~~~\n\n* add AP-style state abbreviations\n* use jellyfish instead of Metaphone package\n* update to requests v1.0.4 for tests\n* Python 3.3 compatibility\n\n0.5\n~~~\n\n* fix state abbreviation for Nebraska\n\n0.4\n~~~\n\n* add state capitals\n* add years of statehood\n\n0.3\n~~~\n\n* add mapping method to generate dicts of arbitrary fields\n\n0.2\n~~~\n\n* add command line script for quick access to state data\n\n0.1\n~~~\n\n* initial release\n* state names and abbreviations\n* FIPS codes\n* lookup() method\n* shapefile URLs for various regions\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/unitedstates/python-us", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "us", "package_url": "https://pypi.org/project/us/", "platform": "any", "project_url": "https://pypi.org/project/us/", "project_urls": { "Homepage": "https://github.com/unitedstates/python-us" }, "release_url": "https://pypi.org/project/us/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "US state meta information and other fun stuff", "version": "1.0.0" }, "last_serial": 3112945, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "6d7db4a109adf5ab447ce5564bc4fc9e", "sha256": "90992b04eaab13799b47b821f21937783ba7036ec82f916266dce3843dffe606" }, "downloads": -1, "filename": "us-0.1.tar.gz", "has_sig": false, "md5_digest": "6d7db4a109adf5ab447ce5564bc4fc9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6278, "upload_time": "2012-08-15T16:06:38", "url": "https://files.pythonhosted.org/packages/61/0f/a66254e74297b6f6ac855955864e2b774c6dcbfbe349c986c13b91da85fd/us-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "d6c8bae67953387468f00fb21eb1e25c", "sha256": "e6e6f55f28840fcf5c6e2b7f3854b5e09e9c07c226b66235348710a0ebad176a" }, "downloads": -1, "filename": "us-0.2.tar.gz", "has_sig": false, "md5_digest": "d6c8bae67953387468f00fb21eb1e25c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6875, "upload_time": "2012-08-15T16:36:47", "url": "https://files.pythonhosted.org/packages/e7/7d/c8ed4a3ac78cf7fa147e2fdc13ff742f2088e5768f65e72c662862de80cf/us-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a3506b90a10abf826742b473e0245330", "sha256": "db500388e66f4716e782f42e70648406420e33a01505e4807e699497135e6afe" }, "downloads": -1, "filename": "us-0.3.tar.gz", "has_sig": false, "md5_digest": "a3506b90a10abf826742b473e0245330", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7539, "upload_time": "2012-08-15T18:07:24", "url": "https://files.pythonhosted.org/packages/c6/50/20c55adf41221763cbdb56f8335b5045e997a2a753f556d263399f255c6e/us-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "8b76a13dffab647c7a7775e2cc51a2d9", "sha256": "8a297bccd9e2ab11769de1d9c6b54506436a80b0530b19249330f11468e113b1" }, "downloads": -1, "filename": "us-0.4.tar.gz", "has_sig": false, "md5_digest": "8b76a13dffab647c7a7775e2cc51a2d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9254, "upload_time": "2012-08-28T15:34:24", "url": "https://files.pythonhosted.org/packages/12/f8/d5b862db02ac1b08f87f34786688cd61c59b1a6f65669329a53ff8e436de/us-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "cbcbe2046bdcf0ffca8f7d04782da6fa", "sha256": "c2730cb5161e165a569dfed89f199276a551329b86445812065d58575be263e5" }, "downloads": -1, "filename": "us-0.5.tar.gz", "has_sig": false, "md5_digest": "cbcbe2046bdcf0ffca8f7d04782da6fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9288, "upload_time": "2012-08-30T19:27:01", "url": "https://files.pythonhosted.org/packages/f0/4d/babf1bdbad78a198d7ce5f648966d14572621f7aa7793544c5f6a21d4991/us-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "f77423c77b4348cc017c5dec1fc6b548", "sha256": "91734da5f2f377bcceeb32c403f20ee3e778d074a0f918a0533d0f65821a7603" }, "downloads": -1, "filename": "us-0.6.tar.gz", "has_sig": false, "md5_digest": "f77423c77b4348cc017c5dec1fc6b548", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9882, "upload_time": "2013-01-10T06:13:47", "url": "https://files.pythonhosted.org/packages/1f/e1/f07f3a17c680f4ffe67e582aab8421178cac94b2999397fbb57c8034e0e6/us-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "a2ae2b09a5beb1a5f279e544ba1c4a76", "sha256": "64e2b347ca8f0a69e66fe9315666dc21ac007ba9f522d3b51c881fb8777f5a0d" }, "downloads": -1, "filename": "us-0.7.tar.gz", "has_sig": false, "md5_digest": "a2ae2b09a5beb1a5f279e544ba1c4a76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11939, "upload_time": "2013-01-10T20:46:46", "url": "https://files.pythonhosted.org/packages/79/d0/dad68e12075d4b8b7ae7d2d61f212713761d8bf522141284d32117133dfe/us-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "3262c03ebe3d4a2d247109f54746a169", "sha256": "31352e73bf6d1fad92eed335424b55cd903a79b264f3fe5cc0e956369b169b1d" }, "downloads": -1, "filename": "us-0.7.1.tar.gz", "has_sig": false, "md5_digest": "3262c03ebe3d4a2d247109f54746a169", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12030, "upload_time": "2014-02-03T17:07:14", "url": "https://files.pythonhosted.org/packages/c2/83/d2dad95991f9966a51a1ba1a41b9ef72105867845f8a22965c77df9a04fb/us-0.7.1.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "da5dcc3085105a4346b12bee192cef4d", "sha256": "f19674a949bc84075342925ee85f2cd8e47b55c670cd5a2fb21443d4a48be84c" }, "downloads": -1, "filename": "us-0.8.0.tar.gz", "has_sig": false, "md5_digest": "da5dcc3085105a4346b12bee192cef4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12580, "upload_time": "2014-05-20T15:09:04", "url": "https://files.pythonhosted.org/packages/54/96/9b832bdb011f1ef80e7f9c72f8e5e27ef78af875ef7148225ba1233b63c7/us-0.8.0.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "649e9f778e86502aa834bdd953993cf7", "sha256": "6b1d99132b361c1e42ecd199fdd698de3ceb808fa1b6aed8a117d3d9ef96552e" }, "downloads": -1, "filename": "us-0.9.0.tar.gz", "has_sig": false, "md5_digest": "649e9f778e86502aa834bdd953993cf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13057, "upload_time": "2014-09-22T18:53:05", "url": "https://files.pythonhosted.org/packages/bc/82/81cbd221bdbacee7ab2647c922893acb4551a4595c817b58eef0226806ee/us-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "5e5afe83b3288e9b7b790f03e0c92f15", "sha256": "ed374a332f6e1d9cec87a44ebd2404f3a4383c6a77297adb259344a353af3c92" }, "downloads": -1, "filename": "us-0.9.1.tar.gz", "has_sig": false, "md5_digest": "5e5afe83b3288e9b7b790f03e0c92f15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13210, "upload_time": "2015-08-20T14:18:26", "url": "https://files.pythonhosted.org/packages/92/d4/6c8e09f51ca3b3c7245b524ec84c3e9410e74ab90615e08a2c03ba53dfe6/us-0.9.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "ce13f8d9c4202402acc1eb451e7bf22f", "sha256": "09dc9ba763e2e4399e6a042104f3e415a7de6bfa4df6f557b4f19e3ba9a22fda" }, "downloads": -1, "filename": "us-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ce13f8d9c4202402acc1eb451e7bf22f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13443, "upload_time": "2017-08-21T20:27:28", "url": "https://files.pythonhosted.org/packages/72/83/8731cbf5afcf3434c0b24cfc520c11fd27bfc8a6878114662f4e3dbdab71/us-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce13f8d9c4202402acc1eb451e7bf22f", "sha256": "09dc9ba763e2e4399e6a042104f3e415a7de6bfa4df6f557b4f19e3ba9a22fda" }, "downloads": -1, "filename": "us-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ce13f8d9c4202402acc1eb451e7bf22f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13443, "upload_time": "2017-08-21T20:27:28", "url": "https://files.pythonhosted.org/packages/72/83/8731cbf5afcf3434c0b24cfc520c11fd27bfc8a6878114662f4e3dbdab71/us-1.0.0.tar.gz" } ] }