All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project follows Semantic Versioning.
- Request bodies are now assembled with
xml.etree.ElementTreeinstead of by concatenating strings, so escaping is handled by the standard library (see issue #56). The generated XML is unchanged apart from formatting - Raise the minimum
requestsversion from2.25.0to2.33.0, which fixes GHSA-9hjg-9r4m-mvj7 (a predictable temp file name inrequests.utils.extract_zipped_paths, a function osmapi does not call, but the old floor still let Dependabot flag the declared range)
- Fix tag values and member roles containing a newline, a tab or a carriage return being silently corrupted on write (
node_update,way_create,relation_delete,changeset_create,changeset_upload, …). Those characters were written literally into an XML attribute, where the parser on the other end normalizes them to a space, so{"note": "first\nsecond"}arrived at the API as"first second". They are now written as character references and round-trip unchanged. Membertypewas not escaped at all (see issue #216)
6.0.0 - 2026-07-27
- BC-Break: Remove support for Python 3.9 (EOL since October 2025), new minimum version for osmapi is Python 3.10
- Replace
setup.py/setup.cfgand therequirements.txtfiles with a PEP 621pyproject.toml, dependency groups are now managed with uv - Modernize the type hints:
Optional[X]/Union[X, Y]are now written asX | None/X | Y(PEP 604) changesets_getnow requires either all four or none ofmin_lon,min_lat,max_lonandmax_lat; a partial bounding box raisesValueErrorinstead of sendingNonevalues to the API- osmapi no longer guesses whether a session passed via
session=is authenticated:AuthenticationMissingErroris now only raised when no session was provided at all, i.e. when there is no way for the request to be authenticated. This makes every OAuth 2.0 setup work, including those that osmapi cannot inspect — a bearer token in anAuthorizationheader, a custom transport adapter, or arequests.Sessionsubclass that adds the token per request (e.g.requests_oauthlib.OAuth2Session, which only setssession.authto a no-op lambda). A missing or invalid authorization on such a session is reported by the API asUnauthorizedApiError(HTTP 401) - BC-Break:
UsernamePasswordMissingErrorhas been renamed toAuthenticationMissingError, as there is no username/password anymore (see issue #192). The old name still resolves to the new class (so existingexcept osmapi.UsernamePasswordMissingErrorclauses keep working), but it raises aDeprecationWarningand will be removed in version 7.0 - The
changeset()context manager now closes the changeset withtry/finally, so an exception inside thewithblock no longer leaves the changeset open - The documentation is no longer committed to the repository: the generated
docs/folder has been removed and git-ignored, a newpublish_docs.ymlGitHub Action builds it withpdocand deploys it to GitHub Pages whenever a release is published
- Test against Python 3.13 and 3.14 in CI
- Add a Dependabot config (
.github/dependabot.yml) with weekly updates for theuv,github-actionsandpre-commitecosystems - Declare a minimum version for the
requestsdependency (requests>=2.25.0), no upper bound is set ApiError.payload_str, the response payload decoded as text (the rawpayloadstaysbytes)
- BC-Break: Removed the
username,passwordandpasswordfileparameters ofosmapi.OsmApiand theauthparameter ofosmapi.http.OsmApiSession(see issue #192). Basic authentication was shut down by OpenStreetMap in July 2024, authentication is now provided exclusively by passing an authenticated session (OAuth 2.0) via thesessionparameter:# before api = osmapi.OsmApi(username="user", password="pass") # now api = osmapi.OsmApi(session=oauth_session)
- BC-Break: Removed all deprecated
CamelCasemethods (e.g.NodeGet,ChangesetCreate,NotesGet,Map,Capabilities), they have been deprecated since 5.0. Use thesnake_caseequivalents instead (e.g.node_get,changeset_create,notes_get,map,capabilities).
- Fix release trigger for Upload Python Package workflow by @metaodi in #202
- Fix
TypeErrorwhen an element write (node_create/way_update/relation_delete, …) received an HTTP 409: the payload was matched as text againstbytes, soChangesetClosedApiError/VersionMismatchApiErrorwere never raised. This is the same bug that was fixed forchangeset_uploadin 5.1.0, now fixed for all element writes - Fix
changesets_getsilently dropping a bounding box whose values are all0
5.1.0 - 2026-07-26
- Bump pygments from 2.15.0 to 2.20.0 by @dependabot[bot] in #193
- Add support for PEP 517. by @sebastic in #197
- Fix TypeError in changeset_upload when handling HTTP 409 responses by @hagatopaxi in #196
- fix/update example oauth code in readme by @tyrasd in #195
5.0.0 - 2026-02-18
- BC-Break: Remove support for Python 3.8, new minimum version for osmapi is Python 3.9
- BC-Break: Renamed all methods as
snake_caseinstead ofCamelCase(eg.osmapi.node_getinstead ofosmapi.NodeGet). The previous methods are still there, but all issue aDeprecationWarningwhen called. - While changing the public API of osmapi, the large
OsmApi.pyfile was split into several smaller files.
- Add type hints and mypy checking to osmapi #186
- Remove autochangeset feature in favor of Changeset context manager #187
4.3.0 - 2025-01-21
- New
ConnectionApiErrorwhen a connection or network error occurs (see issue #176, thanks Mateusz Konieczny)
- Use the pattern
raise XYError from eto explicitly add the original exceptions as the cause for a new (wrapped) exception.
- Remove u string prefix (see PR #180, thanks Boris Verkhovskiy)
4.2.0 - 2024-08-08
- Add a new
timeoutparameter toOsmApiwhich allows to set a timeout in seconds (default is 30s) for the API requests (see issue #170, thanks Mateusz Konieczny)
- Only include
discussionkey in result ofChangesetGetifinclude_discussion=True(see issue #163, thanks Mateusz Konieczny) - Update OAuth example in README using cli-oauth2 (see PR #169, thanks Ilya Zverev)
4.1.0 - 2024-03-19
- OAuth 2.0 example in README and in the
examplesdirectory
- Check if a passed
sessionis authenticated and use this instead of Username/Password, this enables OAuth 2.0 authentication
- remove Python2 crumbs (see PR #159, thanks Alexandre Detiste)
4.0.0 - 2023-07-15
- Add Python 3.11 to build
- Add pre-commit configuration for
flake8andblack
- Upgrade the code with
pyupgrade(see PR #146, thanks Miroslav Šedivý) Miroslav Šedivý - Replace format with f-strings to resolve issue (see PR #147, thanks Miroslav Šedivý)
- Use the
blackcode style for this code base
- BC-Break: Remove support for Python 3.7, new minimum version for osmapi is Python 3.8
3.1.0 - 2023-01-18
- New
ElementNotFoundApiErrorwhen a 404 response comes from the API - Raise an exception if a user tries to create a test changeset on the PROD server (see issue #66, thanks SomeoneElseOSM)
- Add new
NoteAlreadyClosedApiErrorexception when you try to close an already closed note (see issue #135, thanks Mateusz Konieczny)
NoteGetsnow allows empty results i.e. it returns an empty list if no notes were found (see issue #137, thanks Mateusz Konieczny)
3.0.0 - 2022-02-12
- Add context manager
Changeset()to open/close changesets - Add
sessionparameter to provide a custom http session object
- Refactor code into several modules/files to improve maintainability
- Use
loggingmodule to log debug information
- BC-Break: Remove
debugparameter of OsmApi, replaced debug messages withloggingmodule
- Added
python_requiresto setup.py to define Python 3.7 as minimum version
2.0.2 - 2021-11-24
- Set
long_descriptionformat to markdown
2.0.1 - 2021-11-24
- Add Makefile for all common tasks
- Long description of osmapi (now using directly the README.md)
- Switch from nose to pytest
- Move docs to its own subdirectory
- Remove tox configuration and dependency
2.0.0 - 2021-11-22
- Move from Travis CI to Github Actions
- Add more API-specific errors to catch specific errors (see issue #115, thanks Mateusz Konieczny):
ChangesetClosedApiErrorNoteClosedApiErrorVersionMismatchApiErrorPreconditionFailedApiError
- BC-Break: osmapi does not support Python 2.7, 3.3, 3.4, 3.5 and 3.6 anymore
- Return an empty list in
NodeRelations,WayRelations,RelationRelationsandNodeWaysif the returned XML is empty (thanks FisherTsai, see issue #117)
1.3.0 - 2020-10-05
- Add close() method to close the underlying http session (see issue #107)
- Add context manager to automatically open and close the http session (see issue #107)
- Correctly parse password file (thanks Julien Palard, see pull request #106)
1.2.2 - 2018-11-05
- Update PyPI password for deployment
1.2.1 - 2018-11-05
- Deployment to PyPI with Travis
1.2.0 - 2018-11-05
- Support Python 3.7 (thanks a lot cclauss)
- Python 3.3 is no longer supported (EOL)
- Updated dependencies for Python 3.7
- Adapt README to use Python 3 syntax (thanks cclauss)
1.1.0 - 2017-10-11
- Raise new
XmlResponseInvalidErrorif XML response from the OpenStreetMap API is invalid
- Improved README (thanks Mateusz Konieczny)
1.0.2 - 2017-09-07
- Rais ResponseEmptyApiError if we expect a response from the OpenStreetMap API, but didn't get one
- Removed httpretty as HTTP mock library
1.0.1 - 2017-09-07
- Make sure tests run offline
1.0.0 - 2017-09-05
- Officially support Python 3.5 and 3.6
- osmapi does not support Python 2.6 anymore (it might work, it might not)
- BC-Break: raise an exception if the requested element is deleted (previoulsy
Nonehas been returned)
0.8.1 - 2016-12-21
- Use setuptools instead of distutils in setup.py
0.8.0 - 2016-12-21
- This release no longer supports Python 3.2, if you need it, go back to release <= 0.6.2
- Read version from init.py instead of importing it in setup.py
0.7.2 - 2016-12-21
- Added 'requests' as a dependency to setup.py to fix installation problems
0.7.1 - 2016-12-12
- Catch OSError in setup.py to avoid installation errors
0.7.0 - 2016-12-07
- Replace the old httplib with requests library (thanks a lot Austin Hartzheim!)
- Use format strings instead of ugly string concatenation
- Fix unicode in changesets (thanks a lot to MichaelVL!)
0.6.2 - 2016-01-04
- Re-arranged README
- Make sure PyPI releases are only created when a release has been tagged on GitHub
0.6.1 - 2016-01-04
- The documentation is now available at a new domain: http://osmapi.metaodi.ch, the previous provider does no longer provide this service
0.6.0 - 2015-05-26
- SSL support for the API calls (thanks Austin Hartzheim!)
- Run tests on Python 3.4 as well
- A bunch of new *Error classes (see below)
- Dependency to 'Pygments' to enable syntax highlighting for online documentation
- Contributing guidelines
- Changed generic
Exceptionwith more specific ones, so a client can catch those and react accordingly (no BC-break!)
0.5.0 - 2015-01-03
- BC-break: all dates are now parsed as datetime objects
- Implementation for changeset discussions (ChangesetComment, ChangesetSubscribe, ChangesetUnsubscribe)
- When (un)subscribing to a changeset, there are two special errors
AlreadySubscribedApiErrorandNotSubscribedApiErrorto check for - The ChangesetGet method got a new parameter
include_discussionto determine wheter or not changeset discussion should be in the response
0.4.2 - 2015-01-01
- Result of
NodeWayis now actually parsed as away
- Lots of method comments for documentation
- Update to pdoc 0.3.1 which changed the appearance of the online docs
0.4.1 - 2014-10-08
- Parse dates in notes as
datetimeobjects
0.4.0 - 2014-10-07
- Release for OSM Notes API
- Generation of online documentation (http://osmapi.divshot.io)
0.3.1 - 2014-06-21
- Hotfix release of Python 3.x (base64)
0.3.0 - 2014-05-20
- Support for Python 3.x
- Use
toxto run tests against multiple versions of Python
0.2.26 - 2014-05-02
- Fixed notes again
0.2.25 - 2014-05-02
- Unit tests for basic functionality
- Fixed based on the unit tests (previously undetected bugs)
0.2.24 - 2014-01-07
- Fixed notes
0.2.23 - 2014-01-03
- Hotfix release
0.2.22 - 2014-01-03
- Fixed README.md not found error during installation
0.2.21 - 2014-01-03
- Updated description
0.2.20 - 2014-01-01
- First release of PyPI package "osmapi"
0.2.19 - 2014-01-01
- Inital version from SVN (http://svn.openstreetmap.org/applications/utils/python_lib/OsmApi/OsmApi.py)
- Move to GitHub
- Add debug message on ApiError
- Fix ChangesetClose and _http_request
- Capabilities implementation
- ChangesetsGet by Alexander Rampp
- xml encoding error for < and >
- changesetautomulti parameter
- modify instead update for osc
- raise ApiError on 4xx errors
- unicode error on ChangesetUpload
- RelationFullRecur definition
- automatic changeset management
- ChangesetUpload implementation
- *(Create|Update|Delete) use not unique _do method
- implement all missing functions except ChangesetsGet and GetCapabilities
- encoding clean-up
- implements NodesGet, WaysGet, RelationsGet, ParseOsm, ParseOsc
- clean-up
- keep http connection alive for multiple request
- (Node|Way|Relation)Get return None when object have been deleted (raising error before)
- can identify applications built on top of the lib
- some changes in constructor
- initial import
Addedfor new features.Changedfor changes in existing functionality.Deprecatedfor once-stable features removed in upcoming releases.Removedfor deprecated features removed in this release.Fixedfor any bug fixes.Securityto invite users to upgrade in case of vulnerabilities.