Name | these-united-states JSON |
Version |
1.1.0.21
JSON |
| download |
home_page | |
Summary | Utility library for performing reverse geocoding of states in the United States of America |
upload_time | 2022-03-10 21:07:34 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | |
keywords |
geocoding
reverse
states
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# these-united-states
A Python library for performing reverse geocoding of the United States of America.
## Overview
These-united-states provides a simple, class-based interface to shapefiles from the United States
Census Bureau defining boundaries of U.S. states and territories. States may be queried via
full state name, abbreviation, or by coordinates (latitude/longitude pairs). State objects contain
some metadata, including the bounding box, area, and polygons defining the state's boundaries.
## Example
```python
>>> import united_states
>>> us = united_states.UnitedStates()
>>> us.from_coords(29.881888, -82.726846)
[State(abbr='FL', name='Florida', bbox=BBox(left=-87.634896, bottom=24.396307999999998, right=-79.974306, top=31.000968))]
>>> us.by_abbr['WA']
State(abbr='WA', name='Washington', bbox=BBox(left=-124.848974, bottom=45.543541, right=-116.916071, top=49.002435999999996))
>>> us.by_name['Alaska']
State(abbr='AK', name='Alaska', bbox=BBox(left=-179.231086, bottom=51.175092, right=179.859681, top=71.439786))
```
## Command-line interface
These-united-states is also usable from the command-line, with the appropriate extras installed.
```
$ pip install "these-united-states[cli,plot]"
$ python -m united_states 29.881888,-82.726846
(29.881888, -82.726846) Florida
$ python -m united_states --help
Usage: united_states [OPTIONS] [POINT]...
Lookup U.S. states by coordinate (reverse geocoding).
Options:
-b, --bbox / --no-bbox Print state bounding boxes in listing
(implies -l/--list).
-d, --dc / --no-dc Include the District of Columbia.
-x, --exclude TEXT Exclude states by abbreviation or name.
-h, --help Show this message and exit.
-i, --include TEXT Include states by abbreviation or name.
-l, --list / --no-list List included states.
-o, --oconus / --no-oconus Include states outside the continental U.S.
-p, --plot / --no-plot Plot the results (requires matplotlib).
-s, --seed FLOAT Seed random number generator for color plot
selection.
-t, --territories / --no-territories
Include U.S. territories.
Options may be given multiple times. Options taking arguments are
additive. Multiple abbreviations or names may be provided in a single
option using a comma-separated list.
```
## License
[BSD 3-Clause license](LICENSE)
Raw data
{
"_id": null,
"home_page": "",
"name": "these-united-states",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "geocoding,reverse,states",
"author": "",
"author_email": "Brandon Carpenter <brandon@8minute.com>",
"download_url": "https://files.pythonhosted.org/packages/ef/c9/1317608006b5d8c8d7f38368ab2c1d8a0096f172233d1e554f6ba1c51ef2/these_united_states-1.1.0.21.tar.gz",
"platform": null,
"description": "# these-united-states\n\nA Python library for performing reverse geocoding of the United States of America.\n\n## Overview\n\nThese-united-states provides a simple, class-based interface to shapefiles from the United States\nCensus Bureau defining boundaries of U.S. states and territories. States may be queried via \nfull state name, abbreviation, or by coordinates (latitude/longitude pairs). State objects contain\nsome metadata, including the bounding box, area, and polygons defining the state's boundaries.\n\n## Example\n\n```python\n>>> import united_states\n\n>>> us = united_states.UnitedStates()\n\n>>> us.from_coords(29.881888, -82.726846)\n[State(abbr='FL', name='Florida', bbox=BBox(left=-87.634896, bottom=24.396307999999998, right=-79.974306, top=31.000968))]\n\n>>> us.by_abbr['WA']\nState(abbr='WA', name='Washington', bbox=BBox(left=-124.848974, bottom=45.543541, right=-116.916071, top=49.002435999999996))\n\n>>> us.by_name['Alaska']\nState(abbr='AK', name='Alaska', bbox=BBox(left=-179.231086, bottom=51.175092, right=179.859681, top=71.439786))\n```\n\n## Command-line interface\n\nThese-united-states is also usable from the command-line, with the appropriate extras installed.\n\n```\n$ pip install \"these-united-states[cli,plot]\"\n\n$ python -m united_states 29.881888,-82.726846\n(29.881888, -82.726846) Florida\n\n$ python -m united_states --help\nUsage: united_states [OPTIONS] [POINT]...\n\n Lookup U.S. states by coordinate (reverse geocoding).\n\nOptions:\n -b, --bbox / --no-bbox Print state bounding boxes in listing\n (implies -l/--list).\n\n -d, --dc / --no-dc Include the District of Columbia.\n -x, --exclude TEXT Exclude states by abbreviation or name.\n -h, --help Show this message and exit.\n -i, --include TEXT Include states by abbreviation or name.\n -l, --list / --no-list List included states.\n -o, --oconus / --no-oconus Include states outside the continental U.S.\n -p, --plot / --no-plot Plot the results (requires matplotlib).\n -s, --seed FLOAT Seed random number generator for color plot\n selection.\n\n -t, --territories / --no-territories\n Include U.S. territories.\n\n Options may be given multiple times. Options taking arguments are\n additive. Multiple abbreviations or names may be provided in a single\n option using a comma-separated list.\n```\n\n## License\n\n[BSD 3-Clause license](LICENSE)\n",
"bugtrack_url": null,
"license": "",
"summary": "Utility library for performing reverse geocoding of states in the United States of America",
"version": "1.1.0.21",
"project_urls": {
"Source Code": "https://bitbucket.org/8minutenergy/these-united-states"
},
"split_keywords": [
"geocoding",
"reverse",
"states"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7a2978c8c98c97063f51594e1b23c7462eef6e04456a856ec6fd8376f4fbce52",
"md5": "7c3f6ecfcbf78dfc02355ca063541f32",
"sha256": "fe170bccafd50f075281fb2ec1f00aa4554daee9219ce3d0067d4de82f4fb1b8"
},
"downloads": -1,
"filename": "these_united_states-1.1.0.21-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7c3f6ecfcbf78dfc02355ca063541f32",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 9940469,
"upload_time": "2022-03-10T21:07:32",
"upload_time_iso_8601": "2022-03-10T21:07:32.464430Z",
"url": "https://files.pythonhosted.org/packages/7a/29/78c8c98c97063f51594e1b23c7462eef6e04456a856ec6fd8376f4fbce52/these_united_states-1.1.0.21-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "efc91317608006b5d8c8d7f38368ab2c1d8a0096f172233d1e554f6ba1c51ef2",
"md5": "d541e47c12301430c617dc947173426d",
"sha256": "5db43c656145efafe59dbf34530ad103982ce8388ba681f0ffc19e5701008091"
},
"downloads": -1,
"filename": "these_united_states-1.1.0.21.tar.gz",
"has_sig": false,
"md5_digest": "d541e47c12301430c617dc947173426d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11162,
"upload_time": "2022-03-10T21:07:34",
"upload_time_iso_8601": "2022-03-10T21:07:34.357413Z",
"url": "https://files.pythonhosted.org/packages/ef/c9/1317608006b5d8c8d7f38368ab2c1d8a0096f172233d1e554f6ba1c51ef2/these_united_states-1.1.0.21.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-03-10 21:07:34",
"github": false,
"gitlab": false,
"bitbucket": true,
"codeberg": false,
"bitbucket_user": "8minutenergy",
"bitbucket_project": "these-united-states",
"lcname": "these-united-states"
}