https://github.com/jplusplus/thenmap-python
Simple Python wrapper around the Thenmap API
https://github.com/jplusplus/thenmap-python
Last synced: 10 months ago
JSON representation
Simple Python wrapper around the Thenmap API
- Host: GitHub
- URL: https://github.com/jplusplus/thenmap-python
- Owner: jplusplus
- License: mit
- Created: 2017-07-14T13:16:04.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T22:30:19.000Z (about 3 years ago)
- Last Synced: 2024-11-07T20:54:47.174Z (over 1 year ago)
- Language: Python
- Homepage: http://api.thenmap.net/
- Size: 17.6 KB
- Stars: 2
- Watchers: 9
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
A simple wrapper for the Thenmap API.
Installing
==========
.. code:: bash
pip install thenmap
Using
=====
.. code:: python
>>> from thenmap import Thenmap
>>> api = Thenmap()
>>> swedish_municipalities = api["se-7"]
>>> swedish_municipalities.geojson # defaults to current local date
{{u'crs': {u'type': u'name', ...}
>>> swedish_municipalities.date = "1975-05-03"
>>> swedish_municipalities.geojson
{{u'crs': {u'type': u'name', ...}
>>> swedish_municipalities.in_which("13.46,59.38")
'1780'
For more fine grained controll over the return geodata use the method get_geodata:
.. code:: python
>>> swedish_municipalities.get_geodata(date="1975-05-03", format="topojson")
{{u'crs': {u'type': u'name', ...}
See http://thenmap.net for more info on the API.
Developing
==========
To run tests:
.. code-block:: python
python2 -m pytest test/*
python3 -m pytest test/*
Changelog
=========
- next
- Improved exception handling
- Added tests
- Specify required Shapely version
- Get rid of collections DeprecationWarning in Python 3.7+
- 1.1.0
- Always get features from only one date. Default to current date
- Add Dataset.info method
- Make Python3.x compatible
- 1.0.1
- Fixed import bug
- 1.0.0
- First working version