Skip to main content

Provides data about shops in a given location, based on OpenStreetMap data.

Project description

Shops Package

Provides data about shoplike objecs in a given location, based on OpenStreetMap data.

Remember about license, see https://www.openstreetmap.org/copyright

See actual use in say https://codeberg.org/matkoniecz/list_how_openstreetmap_can_be_improved_with_alltheplaces_data/src/branch/master/4_process_planet_file.py

If you are interested in more clear example without cruft specific to that other project: please create an issue.

It will provide filtered OSM data, in a form of yielded dicts, each with tags, center and osm_link fields, center being a dict with lat and lon fields:

...
{'tags': {'amenity': 'restaurant', 'building': 'yes', 'name': "Vermutería Arrosseria del Poble D'Auvinya"}, 'center': {'lat': 42.45450165, 'lon': 1.4926907}, 'osm_link': 'https://www.openstreetmap.org/way/1236442460'}
{'tags': {'access': 'yes', 'amenity': 'charging_station', 'capacity': '8', 'fee': 'yes', 'name': '313 Aparcament telecabina del Tarter', 'operator': "Forces Elèctriques d'Andorra", 'payment:app': 'yes', 'payment:electromaps': 'yes'}, 'center': {'lat': 42.57838705, 'lon': 1.6470569}, 'osm_link': 'https://www.openstreetmap.org/way/1270600406'}
{'tags': {'building': 'commercial', 'shop': 'car_repair'}, 'center': {'lat': 42.5531873, 'lon': 1.50726665}, 'osm_link': 'https://www.openstreetmap.org/way/1276422261'}
{'tags': {'addr:city': 'Incles', 'addr:postcode': 'AD100', 'addr:street': "Camí Pont D'Incles", 'amenity': 'restaurant', 'building': 'yes', 'name': 'Lamont'}, 'center': {'lat': 42.5831009, 'lon': 1.6640846}, 'osm_link': 'https://www.openstreetmap.org/way/1286995487'}
{'tags': {'addr:city': 'El Tarter', 'addr:postcode': 'AD100', 'addr:street': 'CG-2', 'amenity': 'restaurant', 'building': 'yes', 'cuisine': 'bar&grill', 'name': 'The Boss', 'name:ca': 'The Boss'}, 'center': {'lat': 42.57929245, 'lon': 1.64093665}, 'osm_link': 'https://www.openstreetmap.org/way/1288987664'}
{'tags': {'building': 'yes', 'office': 'government', 'type': 'multipolygon'}, 'center': {'lat': 42.50669325, 'lon': 1.5222641000000001}, 'osm_link': 'https://www.openstreetmap.org/relation/14084224'}
{'tags': {'amenity': 'bank', 'building': 'yes', 'name': 'Andbank', 'name:ca': 'Andbank', 'type': 'multipolygon'}, 'center': {'lat': 42.51118895, 'lon': 1.5346714750000001}, 'osm_link': 'https://www.openstreetmap.org/relation/14119424'}

Installation

pip install shops

It is uploaded to pypi.org

Behind scenes

Data is downloaded, preprocessed and output cached within specified folder.

First run will take long time especially for longer datasets.

Run tests

python3 -m unittest

Contributions

Bug reports, benchmarks, ideas, pull requests, suggestions and maybe thanks are welcome on the issue tracker!

I am especially looking for ways to make this code faster.

Note that for larger code changes opening issue first, before sending patch, may be a good idea.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shops-0.0.4.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shops-0.0.4-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file shops-0.0.4.tar.gz.

File metadata

  • Download URL: shops-0.0.4.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for shops-0.0.4.tar.gz
Algorithm Hash digest
SHA256 17227e00e3a137b4d1f31e285afce113f5b6990c9e23349491911660eaf0a796
MD5 c3cff42f05fc848ac37b1337cd1a7f85
BLAKE2b-256 116c4f9e12cb1dcc075c68b44db08b2956e9e0c33cc5b01820f45e43988118af

See more details on using hashes here.

File details

Details for the file shops-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: shops-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for shops-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 562141f304d27ab8f8fb31c418f3b12b0b2e3952217a4e9ad80e2988a83bc003
MD5 05a6d981ff9f995de117c84ae33c2cab
BLAKE2b-256 f64ebe87d182543eaf627c858e6c19438e52c55ea787cf9a6d84f1ff351f230c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page