skip to navigation
skip to content

Not Logged In

osmapi 0.2.21

Python wrapper for the OSM API

Latest Version: 0.6.0


`|Build Status| <https:"" metaodi="" osmapi="">`_
`|Version| <http:"" py="" osmapi="">`_
`|Downloads| <https:"" pypi="" osmapi=""/>`_
`|License| <https:"" pypi="" osmapi=""/>`_

Python wrapper for the OSM API


Install ``osmapi`` simply by using pip:


pip install osmapi


If you want to help with the development of ``osmapi``, you should clone
this repository and install the requirements:


pip install -r requirements.txt

After that, it is recommended to install the ``flake8`` pre-commit-hook:


flake8 --install-hook


Scripted imports and automated edits should only be carried out by those
with experience and understanding of the way the OpenStreetMap community
creates maps, and only with careful **planning** and **consultation**
with the local community.

See the
`Import/Guidelines <http:"" wiki="" import="" guidelines="">`_
and `Automated Edits/Code of
Conduct <http:"" wiki="" automated_edits="" code_of_conduct="">`_
for more information.


Read from OpenStreetMap


import osmapi
api = osmapi.OsmApi()
print api.NodeGet(123)
# {u'changeset': 532907, u'uid': 14298,
# u'timestamp': u'2007-09-29T09:19:17Z',
# u'lon': 10.790009299999999, u'visible': True,
# u'version': 1, u'user': u'Mede',
# u'lat': 59.9503044, u'tag': {}, u'id': 123}



import osmapi
api = osmapi.OsmApi(api="", username = "you", password = "***")
api = osmapi.OsmApi(username = "you", passwordfile = "/etc/mypasswords")
api = osmapi.OsmApi(passwordfile = "/etc/mypasswords") # username will be first line username

Note: The password file should have the format *user:password*

Write to OpenStreetMap


import osmapi
api = osmapi.OsmApi(username = u"metaodi", password = u"*******")
api.ChangesetCreate({u"comment": u"My first test"})
print api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}})
# {u'changeset': 532907, u'lon': 1, u'version': 1, u'lat': 1, u'tag': {}, u'id': 164684}


This project was orginally developed by Etienne Chove. This repository
is a copy of the original code from SVN
with the goal to enable easy contribution via GitHub and release of this
package via `PyPI <https:"" pypi="" osmapi="">`_.

See also the OSM wiki:

.. |Build
Status| image::
.. |Version| image::
.. |Downloads| image::
.. |License| image::  
File Type Py Version Uploaded on Size
osmapi-0.2.21.tar.gz (md5) Source 2014-01-03 7KB
  • Downloads (All Versions):
  • 53 downloads in the last day
  • 358 downloads in the last week
  • 1433 downloads in the last month