# Reverting Scripts
Here are two Python scripts that:
* Revert simple OpenStreetMap changesets.
Way and relation structural changes cannot be reverted, all other changes can.
For example, if you deleted a lot of objects, or changed many tags at once.
* Restore an old version of given object(s). All of their deleted references
are restored as well.
If there are no errors, scripts would ask you for OSM login and password (which
are immediately forgotten) and upload the changes. Alternatively you can redirect
output to a file and open it in e.g. JOSM for reviewing and uploading.
## Installation
pip install --user simple_revert
## Simple Revert
Specify changeset ids as the `simple-revert` script arguments. E.g.
simple_revert 12345 12346 12348
To list recent changesets by a user (e.g. you), specify their name as
the only argument:
simple_revert Zverik
## Restore Version
To restore an old object version, pass its type, id and version to
`restore_version`. For the first argument you can use following formats:
* `n12345` for a node, `w2342` or `r234234` for ways and relations.
* `node/12345`, `node.12345` or even `"way 2343"` (note the quotes).
* `https://www.openstreetmap.org/node/12345` or any other similar link.
* `https://api.openstreetmap.org/api/0.6/node/12345/6` includes a version to restore.
Version number should be either a positive integer, or a negative, relative
to the last version. E.g. this command will revert the last change to a node:
restore_version n12345 -1
To get a list of recent versions, run the script without a version argument.
You can pass several objects to restore them all in one changeset:
restore_version n12345 -1 w1234 -1 w1235 -1
## Author and License
Written by Ilya Zverev, licensed under ISC license.
Raw data
{
"_id": null,
"home_page": "https://github.com/Zverik/simple-revert",
"name": "simple-revert",
"maintainer": "",
"docs_url": null,
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7",
"maintainer_email": "",
"keywords": "",
"author": "Ilya Zverev",
"author_email": "ilya@zverev.info",
"download_url": "https://files.pythonhosted.org/packages/cd/56/ec482cd7b1f5afa09957436e88d95ffe2d8c0798729de8e922ac0a1ad07a/simple_revert-1.2.0.tar.gz",
"platform": null,
"description": "# Reverting Scripts\n\nHere are two Python scripts that:\n\n* Revert simple OpenStreetMap changesets.\nWay and relation structural changes cannot be reverted, all other changes can.\nFor example, if you deleted a lot of objects, or changed many tags at once.\n* Restore an old version of given object(s). All of their deleted references\nare restored as well.\n\nIf there are no errors, scripts would ask you for OSM login and password (which\nare immediately forgotten) and upload the changes. Alternatively you can redirect\noutput to a file and open it in e.g. JOSM for reviewing and uploading.\n\n## Installation\n\n pip install --user simple_revert\n\n## Simple Revert\n\nSpecify changeset ids as the `simple-revert` script arguments. E.g.\n\n simple_revert 12345 12346 12348\n\nTo list recent changesets by a user (e.g. you), specify their name as\nthe only argument:\n\n simple_revert Zverik\n\n## Restore Version\n\nTo restore an old object version, pass its type, id and version to\n`restore_version`. For the first argument you can use following formats:\n\n* `n12345` for a node, `w2342` or `r234234` for ways and relations.\n* `node/12345`, `node.12345` or even `\"way 2343\"` (note the quotes).\n* `https://www.openstreetmap.org/node/12345` or any other similar link.\n* `https://api.openstreetmap.org/api/0.6/node/12345/6` includes a version to restore.\n\nVersion number should be either a positive integer, or a negative, relative\nto the last version. E.g. this command will revert the last change to a node:\n\n restore_version n12345 -1\n\nTo get a list of recent versions, run the script without a version argument.\n\nYou can pass several objects to restore them all in one changeset:\n\n restore_version n12345 -1 w1234 -1 w1235 -1\n\n\n## Author and License\n\nWritten by Ilya Zverev, licensed under ISC license.\n",
"bugtrack_url": null,
"license": "",
"summary": "CLI tool and library to revert changes in OpenStreetMap",
"version": "1.2.0",
"project_urls": {
"Homepage": "https://github.com/Zverik/simple-revert"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8e8ed26e5cb6f16c20a99f794ca9879880b37446fd554b0bf0f22bba231ae9a2",
"md5": "bb5606423fc5ed3bd6064ed72e484420",
"sha256": "65779e4018655437169c01715e9d2acd691ee09665ccb8dcdcbf87d049e5264d"
},
"downloads": -1,
"filename": "simple_revert-1.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "bb5606423fc5ed3bd6064ed72e484420",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7",
"size": 13058,
"upload_time": "2023-10-14T18:29:02",
"upload_time_iso_8601": "2023-10-14T18:29:02.512989Z",
"url": "https://files.pythonhosted.org/packages/8e/8e/d26e5cb6f16c20a99f794ca9879880b37446fd554b0bf0f22bba231ae9a2/simple_revert-1.2.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cd56ec482cd7b1f5afa09957436e88d95ffe2d8c0798729de8e922ac0a1ad07a",
"md5": "3f5c08e6f5f8b09d67bd9902f9ee4aa7",
"sha256": "6a0ccbce45d91b6af514b18643ff1acb10f5137d890ace602a712c13e53f2747"
},
"downloads": -1,
"filename": "simple_revert-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "3f5c08e6f5f8b09d67bd9902f9ee4aa7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7",
"size": 12539,
"upload_time": "2023-10-14T18:29:04",
"upload_time_iso_8601": "2023-10-14T18:29:04.268438Z",
"url": "https://files.pythonhosted.org/packages/cd/56/ec482cd7b1f5afa09957436e88d95ffe2d8c0798729de8e922ac0a1ad07a/simple_revert-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-14 18:29:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Zverik",
"github_project": "simple-revert",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "simple-revert"
}