{ "info": { "author": "Dominik George, Eike Tim Jesinghaus", "author_email": "osmalchemy@veripeditus.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Plugins", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Topic :: Database", "Topic :: Scientific/Engineering :: GIS", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "OSMAlchemy\n==========\n\nOSMAlchemy is a bridge between SQLAlchemy and the OpenStreetMap API.\n\nGoals\n-----\n\nOSMAlchemy's goal is to provide completely transparent integration of\nthe real-world OpenStreetMap data within projects using SQLAlchemy. It\nprovides two things:\n\n1. Model declaratives resembling the structure of the main OpenStreetMap\n database, with some limitations, usable wherever SQLAlchemy is used,\n and\n2. Transparent proxying and data-fetching from OpenStreetMap data.\n\nThe idea is that the model can be queried using SQLAlchemy, and\nOSMAlchemy will either satisfy the query from the database directly or\nfetch data from OpenStreetMap. That way, projects already using\nSQLAlchemy do not need another database framework to use OpenStreetMap\ndata, and the necessity to keep a local copy of planet.osm is relaxed.\n\nIf, for example, a node with a certain id is queried, OSMAlchemy will\u2026\n\n- \u2026try to get the node from the database/ORM directly, then\u2026\n- \u2026if it is available, check its caching age, and\u2026\n\n - \u2026if it is too old, refresh it from OSM, or\u2026\n - \u2026else, fetch it from OSM, and\u2026\n\n- \u2026finally create a real, ORM-mapped database object.\n\nThat's the rough idea, and it counts for all kinds of OSM elements and\nqueries.\n\nOSMAlchemy uses Overpass to satisfy complex queries.\n\nNon-goals\n~~~~~~~~~\n\nOSMAlchemy does not aim to replace large-scale OSM data frameworks like\nPostGIS, Osmosis or whatever. In fact, in terms of performance and\notherwise, it cannot keep up with them.\n\nIf you are running a huge project that handles massive amounts of map\ndata, has millions of requests or users, then OSMAlchemy is not for you\n(YMMV).\n\nOSMAlchemy fills a niche for projects that have limited resources and\ncannot handle a full copy of planet.osm and an own API backend and\nexpect to handle limited amounts of map data.\n\nIt might, however, be cool to use OSMAlchemy as ORM proxy with an own\nAPI backend. Who knows?\n\nIt might, as well, turn out that OSMAlchemy is an incredibly silly idea\nunder all circumstances.\n\nUsage\n-----\n\nHere are a few tiny examples of how to basically use OSMAlchemy:\n\nInstallation\n~~~~~~~~~~~~\n\nOSMAlchemy can be installed just like any other standard Python package\nby one of\u2026\n\n.. code-block:: console\n\n # pip3 install OSMAlchemy\n # python3 setup.py install\n\n\u2026or what ever kind of distribution and install system you prefer.\n\nUsing plain SQLAlchemy\n~~~~~~~~~~~~~~~~~~~~~~\n\nMake sure to get at least an engine from SQLAlchemy. Even better, get a\ndeclarative base and a scoped session:\n\n.. code-block:: python\n\n from sqlalchemy import create_engine\n from sqlalchemy.ext.declarative import declarative_base\n from sqlalchemy.orm import sessionmaker, scoped_session\n\n engine = create_engine(\"sqlite:////tmp/foo.db\")\n base = declarative_base(bind=engine)\n session = scoped_session(sessionmaker(bind=engine))\n\nYou can then initialise OSMAlchemy like so:\n\n.. code-block:: python\n\n osmalchemy = OSMAlchemy((engine, base, session), overpass=True)\n\nAnd probably install the databases:\n\n.. code-block:: python\n\n base.metadata.create_all()\n\nUsing Flask-SQLAlchemy and Flask-Restless\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nImagine you have an SQLAlchemy object from Flask-SQLAlchemy bound to\nyour Flask application. called db, and a Flask-Restless API manager as\nmanager:\n\n.. code-block:: python\n\n from osmalchemy import OSMAlchemy\n osm = OSMAlchemy(db, overpass=True)\n db.create_all()\n osm.create_api(manager)\n\nYou should now magically be able to query OSM via the REST API. Keep in\nmind that, with no filter provided, OSMAlchemy refuses to do automatic\nupdates from Overpass. However, providing a query in the default JSON\nquery way in Flask-Restless will give you live data and cache it in the\ndatabase.\n\nLimitations\n~~~~~~~~~~~\n\nOnly some basic SQL queries are supported by the online update code.\nThis is because compiling SQLAlchemy's queries to OverpassQL is very\ncomplex. If you are very good at algorithms and building compilers, feel\nfree to help us out!\n\nThe following kinds of queries are fully supported:\n\n.. code-block:: python\n\n # A node with a specific id\n session.query(osmalchemy.node).filter_by(id=12345).one()\n\n # All nodes within a bounding box\n session.query(osmalchemy.node).filter(\n and_(latitude>51.0, latitude<51.1, longitude>7.0, longitude<7.1)\n ).all()\n\n # All nodes having a specific tag\n session.query(osmalchemy.node).filter(\n osmalchemy.node.tags.any(key=\"name\", value=\"Schwarzrheindorf Kirche\")\n ).all()\n\nYou can go mad combining the two with and\\_() and or\\_(). You can also\nquery for tags of ways and relations and for ways and relations by id.\n\nNot supported (yet) are queries for ways or relations by coordinates.\nYou also cannot query for nodes related to a way or anything related to\na relation - having a way or a relation, accessing it will, however,\nmagically pull and update the nodes and members and add them to the\ndatabase:\n\n.. code-block:: python\n\n # Get all nodes that are members of a (unique) named way\n session.query(osmalchemy.way).filter(\n osmalchemy.way.tags.any(key=\"name\", value=\"My Unique Way\")\n ).one().nodes\n\nThis should, in reality, cover most use cases. If you encounter a use\ncase that is not supported, please open an issue asking whether it can\nbe supported (if you have an idea how it can be, please add it or even\nimplement it and open a pull request).\n\nProjects using OSMAlchemy\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nOSMAlchemy was designed for use in the Veripeditus Augmented Reality\nframework.\n\nDevelopment and standards\n-------------------------\n\nAlbeit taking the above into account, OSMAlchemy is developed with\nquality and good support in mind. That means code shall be well-tested\nand well-documented.\n\nOSMAlchemy is tested against the following SQLAlchemy backends:\n\n- SQLite\n- PostgreSQL\n- MySQL\n\nHowever, we recommend PostgreSQL. MySQL acts strangely with some data\nand is incredibly slow, and SQLite just doesn't scale too well (however,\nit is incredibly fast, in comparison).\n\nAuthors and credits\n-------------------\n\n:Authors:\n Dominik George,\n Eike Tim Jesinghaus\n\n:Credits:\n Special thanks to Mike Bayer from SQLAlchemy for his help with\n some SQLAlchemy bugs and pitfalls, and also some heads-up.\n\n:Contact:\n E-mail to osmalchemy@veripeditus.org\n\nLicense\n-------\n\nOSMAlchemy is licensed under the MIT license. Alternatively, you are\nfree to use OSMAlchemy under Simplified BSD, The MirOS Licence, GPL-2+,\nLGPL-2.1+, AGPL-3+ or the same terms as Python itself.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://edugit.org/Veripeditus/OSMAlchemy", "keywords": "osm", "license": "", "maintainer": "", "maintainer_email": "", "name": "OSMAlchemy", "package_url": "https://pypi.org/project/OSMAlchemy/", "platform": "", "project_url": "https://pypi.org/project/OSMAlchemy/", "project_urls": { "Homepage": "https://edugit.org/Veripeditus/OSMAlchemy" }, "release_url": "https://pypi.org/project/OSMAlchemy/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "OpenStreetMap to SQLAlchemy bridge", "version": "0.1.5" }, "last_serial": 3567826, "releases": { "0.1.1.post1": [ { "comment_text": "", "digests": { "md5": "26bff5cad936dc60fca65ff54159ec53", "sha256": "ef5eea1447113605504637079be0f7ff9d6b53b68cb1c11ed643793b6d9e2554" }, "downloads": -1, "filename": "OSMAlchemy-0.1.1.post1-py3.5.egg", "has_sig": true, "md5_digest": "26bff5cad936dc60fca65ff54159ec53", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 39237, "upload_time": "2016-10-13T16:22:15", "url": "https://files.pythonhosted.org/packages/72/cd/eeb5979e234ebe6e8ed08f24ed8090868d4b535112620ef60fd9581d1436/OSMAlchemy-0.1.1.post1-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "b03baf422c3f966dc0b26faa877acae3", "sha256": "fc620a41aec076c3f09737cc7b157f72cf5e1aaf656ab00c9948f1e9e037f813" }, "downloads": -1, "filename": "OSMAlchemy-0.1.1.post1-py3-none-any.whl", "has_sig": true, "md5_digest": "b03baf422c3f966dc0b26faa877acae3", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 26987, "upload_time": "2016-10-13T16:22:18", "url": "https://files.pythonhosted.org/packages/4a/4f/8aa9e7002fcf293b650f1ed303ba358bdf79b1081cb6e9317036b85eb6c4/OSMAlchemy-0.1.1.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1cd1293a559f52325b4ebc638ec892e5", "sha256": "256792e3d26ec59e9a92ac37bbc10e8cebb5c1774a408b0daf76a0c772d87f50" }, "downloads": -1, "filename": "OSMAlchemy-0.1.1.post1.tar.gz", "has_sig": true, "md5_digest": "1cd1293a559f52325b4ebc638ec892e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 224558, "upload_time": "2016-10-13T16:22:12", "url": "https://files.pythonhosted.org/packages/1d/74/870488a126f7c84a8a2bc589d232171103e44550ec1f103ba3a5ab748340/OSMAlchemy-0.1.1.post1.tar.gz" } ], "0.1.1.post2": [ { "comment_text": "", "digests": { "md5": "91802ad07dbcfec6b522f0dec092cce6", "sha256": "598d2ffccac9f584f48278bc98619f0a45699d7a4c947fb4279ea76e1caef563" }, "downloads": -1, "filename": "OSMAlchemy-0.1.1.post2-py3.5.egg", "has_sig": true, "md5_digest": "91802ad07dbcfec6b522f0dec092cce6", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 39242, "upload_time": "2016-10-13T16:57:04", "url": "https://files.pythonhosted.org/packages/62/83/6e85f94d90909abe9aab0e9f45a2941902e77fd0b78efdf143805ce28ba9/OSMAlchemy-0.1.1.post2-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "9865caea6778c4119d706eb4492a3f4d", "sha256": "8a69551449e40ba48c83eaa743448ddb8d044dffe993084dbc39ad04fd7afad6" }, "downloads": -1, "filename": "OSMAlchemy-0.1.1.post2-py3-none-any.whl", "has_sig": true, "md5_digest": "9865caea6778c4119d706eb4492a3f4d", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 26985, "upload_time": "2016-10-13T16:57:07", "url": "https://files.pythonhosted.org/packages/f9/4a/f3f8708c797c3139efb371b4ff84cd3a1709e7da90da756ab5ed7236ef8b/OSMAlchemy-0.1.1.post2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f4d4d264b77561c344f66235be8c895f", "sha256": "fd101bc9b9b525613921890b440c5e87f7235383b5d8d559c496b72ab82810fe" }, "downloads": -1, "filename": "OSMAlchemy-0.1.1.post2.tar.gz", "has_sig": true, "md5_digest": "f4d4d264b77561c344f66235be8c895f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 224680, "upload_time": "2016-10-13T16:57:01", "url": "https://files.pythonhosted.org/packages/02/c6/6cd902e50c939a77c5fb01d0aa09a1fb0bd266510273e8cf8b415a52f7e8/OSMAlchemy-0.1.1.post2.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "36d7586062f9e24d843d9bd0ff87afdd", "sha256": "c9a04cc7e81156dc13e3cbe6d1a686ac892e728e3b6c663809fe56ffcff646f7" }, "downloads": -1, "filename": "OSMAlchemy-0.1.2-py3.5.egg", "has_sig": true, "md5_digest": "36d7586062f9e24d843d9bd0ff87afdd", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 39370, "upload_time": "2016-10-14T14:20:10", "url": "https://files.pythonhosted.org/packages/7e/36/3f0729c32a82505b78cfd4da491fbc3f2bcc22342e5bc6cd25416b92b937/OSMAlchemy-0.1.2-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "a9c7e0745ad86811c7f7736a07d7ee14", "sha256": "d9c54497e89d13525a9bcf5af17388402dc5c89f26798cba579423b283990729" }, "downloads": -1, "filename": "OSMAlchemy-0.1.2-py3-none-any.whl", "has_sig": true, "md5_digest": "a9c7e0745ad86811c7f7736a07d7ee14", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 26929, "upload_time": "2016-10-14T14:20:14", "url": "https://files.pythonhosted.org/packages/98/e0/aa4dfbe8c9ca6f9c19176da5272086a47509bef50e157125e8176068c267/OSMAlchemy-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7129709885a6f742c2852d01f534f814", "sha256": "e2f44dd5557795c850bad5b05fe59eef7d19b3a76c3ca77bfba43432301093d6" }, "downloads": -1, "filename": "OSMAlchemy-0.1.2.tar.gz", "has_sig": true, "md5_digest": "7129709885a6f742c2852d01f534f814", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 224758, "upload_time": "2016-10-14T14:20:07", "url": "https://files.pythonhosted.org/packages/86/5f/85944499f490cd2c48c78463652f360cb6e121e720874fc0624cefd59ed5/OSMAlchemy-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "178403d778bb1eb8d64e2f5c5a67c6f0", "sha256": "8b1f446592499db51252707fa2e749d7573118423692cc6909e1b0f3a4650338" }, "downloads": -1, "filename": "OSMAlchemy-0.1.3-py3-none-any.whl", "has_sig": true, "md5_digest": "178403d778bb1eb8d64e2f5c5a67c6f0", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 27068, "upload_time": "2017-01-25T16:34:50", "url": "https://files.pythonhosted.org/packages/45/6c/bfb9004f9ba8d78fff427bac2f7c30ef892056c7b3e3429cc6a9e788d5b8/OSMAlchemy-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3f2b3984b919d6421d91bd64dcde6655", "sha256": "76d29d8d34c59f93482aab7d586d0e6a6a4d2e02bf629586dc31f4339ace17b9" }, "downloads": -1, "filename": "OSMAlchemy-0.1.3.tar.gz", "has_sig": true, "md5_digest": "3f2b3984b919d6421d91bd64dcde6655", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225233, "upload_time": "2017-01-25T16:34:47", "url": "https://files.pythonhosted.org/packages/9a/d5/ade9388dab05104f8c3096ee5386ed34721523d8534c041919a855176393/OSMAlchemy-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "dc3faf86860be541a3c4b6eee47ed8d3", "sha256": "2716b484897c3945e0e1c4a32e2ae1071f541656dcb7db4279d160d60045bf3d" }, "downloads": -1, "filename": "OSMAlchemy-0.1.4.tar.gz", "has_sig": true, "md5_digest": "dc3faf86860be541a3c4b6eee47ed8d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225318, "upload_time": "2017-05-11T09:22:55", "url": "https://files.pythonhosted.org/packages/97/e7/3a69cc669c91a2e2b33e4a34b5ad8a3e16558acb952788487973bb8128b3/OSMAlchemy-0.1.4.tar.gz" } ], "0.1.4.dev0": [ { "comment_text": "", "digests": { "md5": "fe1d7ca9f30888a19c320b9a0a23ef09", "sha256": "f275407086ffc09c390c04a23eae950b7b8ee1936cc65d710cbf89b71390f9fb" }, "downloads": -1, "filename": "OSMAlchemy-0.1.4.dev0.tar.gz", "has_sig": true, "md5_digest": "fe1d7ca9f30888a19c320b9a0a23ef09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225329, "upload_time": "2017-03-24T16:55:34", "url": "https://files.pythonhosted.org/packages/86/00/0612e1ea50c15d567e0bd49bd864eea0b5b655f30dc96eb5ffd9846996b1/OSMAlchemy-0.1.4.dev0.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "376a24eba0ba77e4ce89042aa48186b8", "sha256": "48e0770042eb64008f7fe71fa8a826504faf77bd0da8706b58f5949bf93aa989" }, "downloads": -1, "filename": "OSMAlchemy-0.1.5.tar.gz", "has_sig": true, "md5_digest": "376a24eba0ba77e4ce89042aa48186b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225363, "upload_time": "2018-02-09T16:00:00", "url": "https://files.pythonhosted.org/packages/78/32/db5ee000d9bc86d8c6f1372a36e0a3e1bc36f7ec84887a33455a1aa85843/OSMAlchemy-0.1.5.tar.gz" } ], "0.1.post1": [ { "comment_text": "", "digests": { "md5": "7868da4c8ea953f9c04caee0661768d0", "sha256": "e780808fb7a9a91ef6850f44a0911dbc6a2dc0e400623fbc8bfe7cc286a262e8" }, "downloads": -1, "filename": "OSMAlchemy-0.1.post1-py3.5.egg", "has_sig": true, "md5_digest": "7868da4c8ea953f9c04caee0661768d0", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 22742, "upload_time": "2016-09-11T13:10:27", "url": "https://files.pythonhosted.org/packages/34/4d/1fd6c61bcbfc49709b49f3e3f28a2edf5cb0ab92302f82946cce20b069d1/OSMAlchemy-0.1.post1-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "bc9115a887b5f3610e8461e417374668", "sha256": "cff1c222304f95e25278b7a1480b79944752c37eca76f86d8d1b5a5f5991b4e4" }, "downloads": -1, "filename": "OSMAlchemy-0.1.post1-py3-none-any.whl", "has_sig": true, "md5_digest": "bc9115a887b5f3610e8461e417374668", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 27241, "upload_time": "2016-09-11T13:10:07", "url": "https://files.pythonhosted.org/packages/34/01/fd119e4d22e1774927ac8af840a438f6c8836a3dbd70a4515d1daeffac67/OSMAlchemy-0.1.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af9a7886bf3e83b874493a4692d68ca1", "sha256": "86e840bcfa8d0258875f86ab3fa5db9c05fc70ff6d6120798309df882c93a29b" }, "downloads": -1, "filename": "OSMAlchemy-0.1.post1.tar.gz", "has_sig": true, "md5_digest": "af9a7886bf3e83b874493a4692d68ca1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24674, "upload_time": "2016-09-11T13:09:49", "url": "https://files.pythonhosted.org/packages/83/93/b80ba6298d30f17c657530560d2b79cb7fa697a403832ebc2041da6f6456/OSMAlchemy-0.1.post1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "376a24eba0ba77e4ce89042aa48186b8", "sha256": "48e0770042eb64008f7fe71fa8a826504faf77bd0da8706b58f5949bf93aa989" }, "downloads": -1, "filename": "OSMAlchemy-0.1.5.tar.gz", "has_sig": true, "md5_digest": "376a24eba0ba77e4ce89042aa48186b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225363, "upload_time": "2018-02-09T16:00:00", "url": "https://files.pythonhosted.org/packages/78/32/db5ee000d9bc86d8c6f1372a36e0a3e1bc36f7ec84887a33455a1aa85843/OSMAlchemy-0.1.5.tar.gz" } ] }