# GeoScraper
[![GitHub version](https://badge.fury.io/gh/PowerBroker2%2FGeoScraper.svg)](https://badge.fury.io/gh/PowerBroker2%2FGeoScraper) [![PyPI version](https://badge.fury.io/py/GeoScraper.svg)](https://badge.fury.io/py/GeoScraper)<br /><br />
Very user friendly library to parse OpenSourceMap data either from an XML file (i.e. *.osm), from an OSM API URL, or from a user specified bounding box.
# To Install
```
pip install GeoScraper
```
# Example Python Script
```python
import os
from pprint import pprint
from GeoScraper import GeoScraper
USE_BBOX = True
USE_FILE = True
USE_URL = True
XML_FNAME = os.path.join(os.path.dirname(__file__), 'map.osm') # YOU MAY NEED TO CHANGE THIS LINE!
BBOX = [-84.0958000, # left
39.7617000, # bottom
-84.0484000, # right
39.7823000] # top
URL = r'https://api.openstreetmap.org/api/0.6/map?bbox=-84.0958000,39.7617000,-84.0484000,39.7823000'
if __name__ == '__main__':
scraper = GeoScraper()
if USE_FILE:
print('=' * 50)
print('Using file:')
print('=' * 50)
scraper.from_file(XML_FNAME)
pprint(scraper.highways()[:3])
print('\n')
if USE_BBOX:
print('=' * 50)
print('Using bbox:')
print('=' * 50)
scraper.from_bbox(left = BBOX[0],
bottom = BBOX[1],
right = BBOX[2],
top = BBOX[3])
pprint(scraper.highways()[:3])
print('\n')
print('=' * 50)
print('Done')
print('=' * 50)
if USE_URL:
print('=' * 50)
print('Using url:')
print('=' * 50)
scraper.from_url(URL)
pprint(scraper.highways()[:3])
print('\n')
print('=' * 50)
print('Done')
print('=' * 50)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/PowerBroker2/GeoScraper",
"name": "GeoScraper",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "geospacial,map,maps,mapping,osm,openstreetmap",
"author": "Power_Broker",
"author_email": "gitstuff2@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/52/6d/dcc96ed1b4bae0c173c033bd40ab3ed487387aaa050b708f9524b6891260/GeoScraper-0.0.1.tar.gz",
"platform": null,
"description": "# GeoScraper\r\n[![GitHub version](https://badge.fury.io/gh/PowerBroker2%2FGeoScraper.svg)](https://badge.fury.io/gh/PowerBroker2%2FGeoScraper) [![PyPI version](https://badge.fury.io/py/GeoScraper.svg)](https://badge.fury.io/py/GeoScraper)<br /><br />\r\n\r\nVery user friendly library to parse OpenSourceMap data either from an XML file (i.e. *.osm), from an OSM API URL, or from a user specified bounding box.\r\n\r\n# To Install\r\n```\r\npip install GeoScraper\r\n```\r\n\r\n# Example Python Script\r\n```python\r\nimport os\r\nfrom pprint import pprint\r\n\r\nfrom GeoScraper import GeoScraper\r\n\r\n\r\nUSE_BBOX = True\r\nUSE_FILE = True\r\nUSE_URL = True\r\n\r\nXML_FNAME = os.path.join(os.path.dirname(__file__), 'map.osm') # YOU MAY NEED TO CHANGE THIS LINE!\r\nBBOX = [-84.0958000, # left\r\n 39.7617000, # bottom\r\n -84.0484000, # right\r\n 39.7823000] # top\r\nURL = r'https://api.openstreetmap.org/api/0.6/map?bbox=-84.0958000,39.7617000,-84.0484000,39.7823000'\r\n\r\n\r\nif __name__ == '__main__':\r\n scraper = GeoScraper()\r\n \r\n if USE_FILE:\r\n print('=' * 50)\r\n print('Using file:')\r\n print('=' * 50)\r\n scraper.from_file(XML_FNAME)\r\n pprint(scraper.highways()[:3])\r\n print('\\n')\r\n \r\n if USE_BBOX:\r\n print('=' * 50)\r\n print('Using bbox:')\r\n print('=' * 50)\r\n scraper.from_bbox(left = BBOX[0],\r\n bottom = BBOX[1],\r\n right = BBOX[2],\r\n top = BBOX[3])\r\n pprint(scraper.highways()[:3])\r\n print('\\n')\r\n print('=' * 50)\r\n print('Done')\r\n print('=' * 50)\r\n \r\n if USE_URL:\r\n print('=' * 50)\r\n print('Using url:')\r\n print('=' * 50)\r\n scraper.from_url(URL)\r\n pprint(scraper.highways()[:3])\r\n print('\\n')\r\n print('=' * 50)\r\n print('Done')\r\n print('=' * 50)\r\n```\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Very user friendly library to parse OpenSourceMap data either from an XML file (i.e. *.osm), from an OSM API URL, or from a user specified bounding box",
"version": "0.0.1",
"project_urls": {
"Download": "https://github.com/PowerBroker2/GeoScraper/archive/0.0.1.tar.gz",
"Homepage": "https://github.com/PowerBroker2/GeoScraper"
},
"split_keywords": [
"geospacial",
"map",
"maps",
"mapping",
"osm",
"openstreetmap"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f1ece30771e292e48d4741fb23a7d3ad267672d52afa134457cffe6e3eabd963",
"md5": "2face531a96e566d1369b11893f39067",
"sha256": "dfd6d2e371f8f17d41d9079080c003c51c63afdc5ca90f04c5c21e1f8e947aab"
},
"downloads": -1,
"filename": "GeoScraper-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2face531a96e566d1369b11893f39067",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6220,
"upload_time": "2024-03-01T20:22:14",
"upload_time_iso_8601": "2024-03-01T20:22:14.725823Z",
"url": "https://files.pythonhosted.org/packages/f1/ec/e30771e292e48d4741fb23a7d3ad267672d52afa134457cffe6e3eabd963/GeoScraper-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "526ddcc96ed1b4bae0c173c033bd40ab3ed487387aaa050b708f9524b6891260",
"md5": "1f113aeaa1735f7eb0dc634490f04a0a",
"sha256": "f23587a280a9d43154960f2b2a5e721e41d76e631422fcb7eee65823fae7c2fa"
},
"downloads": -1,
"filename": "GeoScraper-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "1f113aeaa1735f7eb0dc634490f04a0a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6044,
"upload_time": "2024-03-01T20:22:16",
"upload_time_iso_8601": "2024-03-01T20:22:16.478532Z",
"url": "https://files.pythonhosted.org/packages/52/6d/dcc96ed1b4bae0c173c033bd40ab3ed487387aaa050b708f9524b6891260/GeoScraper-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-01 20:22:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PowerBroker2",
"github_project": "GeoScraper",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "geoscraper"
}