overpassify
===========
A Python to OverpassQL transpiler, now on both `GitHub
<https://github.com/LivInTheLookingGlass/overpassify>`__ and `GitLab
<https://gitlab.com/LivInTheLookingGlass/overpassify>`__
`OverpassQL <http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL>`__
is the language used to query features on OpenStreetMap. Unfortunately,
it's not very readable.
The goal here is to enable people to write in a more developer-friendly
language, and still have it work on the existing infrastructure. As of
now, ``overpassify`` can take a snippet like:
.. code:: python
from overpassify import overpassify
@overpassify
def query():
search = Area(3600134503)
ways = Way(search, highway=...)
odd_keys_demo = Way(search, **{Regex('maxspeed(?::.+)?'): Regex('.+ mph')})
nodes = Node(search)
out(ways, geom=True, count=True)
out(nodes, geom=True, count=True)
noop()
And from that generate:
.. code::
(area(3600134503);) -> .search;
(way["highway"](area.search);) -> .ways;
(way[~"maxspeed(?::.+)?"~".+ mph"](area.search);) -> .odd_keys_demo;
(node(area.search);) -> .nodes;
.ways out count;
.ways out geom;
.nodes out count;
.nodes out geom;
That last ``noop()`` is because of `issue
#2 <https://github.com/LivInTheLookingGlass/overpassify/issues/2>`__. And as a
note, this library assumes you never use a variable name of the form
``tmp*``. That format will probably be changed to something even less
likely in the future, but some translations (for instance, a full
ternary) *require* the use of temporary variables.
Overview
--------
I'll say this from the outset: ``overpassify`` will support a subset of
Python. Some things are just too difficult (and maybe impossible) to
automatically translate. Functions are an example of that.
On the other hand, it will try to support a superset of easily-usable
OverpassQL. Some of those extra features won't be as efficient as their
Python counterparts, but they will be available.
Currently ``overpassify`` supports 41/56 of the features listed in the
OverpassQL guide, and additionally supports ternary statements, ``if`` blocks,
``break``, and ``continue``.
Classes
-------
This library provides wrappers for five types. ``Set()``, ``Node()``,
``Way()``, ``Area()``, and ``Relation()``. Those last four are *all*
considered subclasses of ``Set()``.
This library also provides support for strings and numbers. In the
future it will provide support for regex and other things in specific
places.
(Note: Currently nested constructors have some problems in
implementation)
Assignment
----------
This works about the way you'd expect it to. There are a couple caveats
though.
#. You cannot assign a non-\ ``Set()`` to a variable. This means only
those five classes listed above.
#. You cannot assign multiple variables in one line. No ``a, b = b, a``,
and the like. This could *potentially* be changed later.
Number and Set Arithmetic
-------------------------
Another supported feature is the ability to manipulate these sets and
numbers.
Adding sets will produce the union of those sets. Adding numbers will
produce their sum.
Subtracting **two** sets will produce their difference. Subtracting
numbers will do the same.
Set Filtering
-------------
You are also allowed to filter a ``Set()``'s contents by type. For
instance, ``Way.filter(<some set>)`` would yield all the ways within
``<some set>``.
Set intersections
-----------------
A similar process will allow you to take the intersection of arbitrary
numbers of **named** sets. So ``Set.intersect(a, b)`` will yield all
elements common between ``a`` and ``b``. You cannot, at the moment, use
an expression inside this function. It **must** be predefined.
You can also use this in tandem with Set Filtering. So
``Area.intersect(a, b)`` would yield only the areas common between ``a``
and ``b``.
Searching for Sets
------------------
This library also supports *most* of the ways OverpassQL can search for
information. This currently includes:
#. Checking within an area (or set of areas)
#. Fetching by ID
#. Tag matching
#. Conditional filters (see next section)
The first two are just given as arguments to the constructor. If you put
in ``Way(12345)``, that will find the Way with ID 12345. If you put in
``Way(<some area>)``, it will return all ways within that area.
You can also define areas using the ``Around()`` function. This has two
useful overloads. The first takes the form
``Around(<some set>, <radius in meters>)``. The second takes the form
``Around(<radius in meters>, <latitude>, <longitude>)``.
Tag matching can be done with keyword arguments. So if you look for
``Node(highway="stop")``, that will find you all stop signs. It also
supports existence checking (``Way(highway=...)``), and non-existence
checking (``Area(landuse=None)``), and regex matching
(``Way(highway=Regex("path|cycleway|sidewalk"))``).
For keys which are not usable as a keyword, you can use a "splatted" dictionary.
For instance ``Node(**{'maxspeed:advisory': Regex('.+ mph')})``. The same
follows for regex key matching, though regex key matching *must* be with a
regex value.
You can also search by both an area and a filter. For instance:
``Way(<your hometown>, maxspeed=None)``.
Ternary Expressions and Conditional Filters
-------------------------------------------
You can also filter using the familiar ``a if b else c``. This would
mean that if ``b`` is truthy, ``a`` should become ``b``, and otherwise
become ``c``.
Unfortunately, since this is not a native feature to OverpassQL, it ends
up evaluating both sides of that statement.
If you want ``c`` to be an empty set, however, we can optimize that. So
``foo = a if b else <type>()`` is the syntax to use there.
Additional performance is lost because OverpassQL does not support a
conditional being the *only* filter. This means that we need to provide
some other filter, and one in current use is to divide it by type and
reconstruct. Because of this, filtering down to the appropriate set type yields
significantly batter performance.
Returning Data
--------------
In OverpassQL, data can be returned in pieces throughout the function.
It's more equivalent to Python's ``yield`` than ``return``. The function
we use for that here is ``out()``.
``out()`` takes in one positional argument, and many possible keyword
arguments. It yields data for the positional argument using all the
types defined in the keywords.
For instance ``out(<set of nodes>, geom=True, body=True, qt=True)``
would return all the data that MapRoulette needs to draw those points on
their map.
As a sidenote, the value given for these keywords is never actually
checked. It could as easily be ``geom=False`` as ``geom=True``, and
``overpassify`` will not care.
For-Each Loop
-------------
Here you can use the traditional Python for loop:
.. code:: python
for way in ways:
out(way, geom=True)
It does not yet support the else clause, and though it supports ``break`` and
``continue``, please be aware that this will dramatically slow runtime in that
loop.
If Statements
-------------
This is a feature that OverpassQL cannot do without some emulation. So
what we do here is:
#. Grab an individual item that will probably be stable over long
periods of time; in this case, the ``Relation()`` representing
Antarctica
#. Use a conditional filter on that relation to get a one item or zero
item ``Set()``
#. Iterate over that in a for loop
#. If there is an else clause, use a conditional filter with the
negation of the test given to get a one item or zero item ``Set()``
#. Iterate over the else clause in a for loop
Settings
--------
We also provide a wrapper for the option headers. Note that this will
raise an error if it's not on the first line of your query.
The valid keywords for ``Settings()`` are as follows:
- ``timeout``: The maximum number of seconds you would like your query
to run for
- ``maxsize``: The maximum number of bytes you would like your query to
return
- ``out``: The format to return in. It defaults to XML, but you can set
it to ``"json"`` or a variant on ``"csv"``, as described `in the
OverpassQL
spec <http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Output_Format_.28out.29>`__
- ``bbox``: The string describing a global bounding box. It is used to
limit the area your query can encompass, and should take the form
``"<southern lat>,<western lon>,<northern lat>,<eastern lon>"``
- ``date``: The string describing what date you would like to query
for. This allows you to look at past database states. Note that it
needs an extra set of quotes, so it would look like
``date='"2012-09-12T06:55:00Z"'``
- ``diff``: Similar to the above, except it will return the difference
between that query run at each time. If you give one time, it will
assume you want to compare to now. It would look like
``diff='"2012-09-12T06:55:00Z","2014-12-24T13:33:00Z"'``
- ``adiff``: Similar to the above, except that it tells you what
happened to each absent element
Rough Translation Table
-----------------------
+-----------------------+---------------------------------------+----------------------------------------------------+
| Feature | OverpassQL | Python |
+=======================+=======================================+====================================================+
| Assignment | ``<expr> -> .name`` | ``name = <expr>`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Unions | ``(<set>; ...; <set>)`` | ``<set> + ... + <set>`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Difference | ``(<set> - <set>)`` | ``<set> - <set>`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Intersection | ``.<set>.<set>`` | ``Set.intersect(<set>, <set>)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Type-filtering | ``way.<set>`` | ``Way.filter(<set>)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Searching | | |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..By ID | ``area(1)`` or ``way(7)`` | ``Area(1)`` or ``Way(7)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..In an area | ``way(area.<set>)`` | ``Way(<set>)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..By tags | ``way["tag"="value"]`` | ``Way(tag=value)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..By tag existence | ``way["tag"]`` | ``Way(tag=...)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..By tag nonexistence | ``way[!"tag"]`` | ``Way(tag=None)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..By regex | ``way["highway"~"a|b"](area.<set>)`` | ``Way(<set>, highway=Regex("a|b"))`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..By inverse regex | ``way["highway"!~"a|b"](area.<set>)`` | ``Way(<set>, highway=NotRegex("a|b"))`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..In area + tag | ``way["highway"](area.<set>)`` | ``Way(<set>, highway=...)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Ternary | very long | ``<expr> if <condition> else <expr>`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Conditional Filter | ``<type>.<set>(if: <condition>)`` | ``<expr> if <condition> else <type>()`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| For Loop | ``foreach.<set>->.<each>(<body>)`` | ``for <each> in <set>:\n <body>`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| If Statement | very long | ``if <condition>:\n <body>\nelse:\n <body>`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| Recursing | | |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..Up | ``.a <`` or ``.a < -> .b`` | ``a.recurse_up()`` or ``b = a.recurse_up()`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..Up (w/ relations) | ``.a <<`` or ``.a << -> .b`` | ``a.recurse_up_relations()`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..Down | ``.a >`` or ``.a > -> .b`` | ``a.recurse_down()`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..Down (w/ relations) | ``.a >>`` or ``.a >> -> .b`` | ``a.recurse_down_relations()`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| is_in filers | | |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..On a set | ``.a is_in -> .areas_with_part_of_a`` | ``areas_containing_part_of_a = is_in(a)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
| ..On a lat/lon pair | ``is_in(0, 0) -> .areas_with_0_0`` | ``areas_containing_0_0 = is_in(0, 0)`` |
+-----------------------+---------------------------------------+----------------------------------------------------+
Features Not Yet Implemented
----------------------------
#. Filters
#. Recursion Functions
#. Filter By Bounding Box
#. Filter By Polygon
#. Filter By "newer"
#. Filter By Date Of Change
#. Filter By User
#. Filter By Area Pivot
#. ID Evaluators
#. id() And type()
#. is\_tag() And Tag Fetching
#. Property Count Functions
#. Aggregators
#. Union and Set
#. Min and Max
#. Sum
#. Statistical Counts
#. Number Normalizer
#. Date Normalizer
Raw data
{
"_id": null,
"home_page": "https://github.com/LivInTheLookingGlass/overpassify",
"name": "overpassify",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "OSM OpenStreetMap Overpass OverpassQL Transpiler Transpile Compiler Compile Query",
"author": "Olivia Appleton",
"author_email": "olivia.kay.appleton@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d5/6d/7fe2d1a9cfbe946466faadcf130d5c92ec40af3245478d5a75229bdd7a1f/overpassify-1.2.3.tar.gz",
"platform": null,
"description": "overpassify\n===========\n\nA Python to OverpassQL transpiler, now on both `GitHub\n<https://github.com/LivInTheLookingGlass/overpassify>`__ and `GitLab\n<https://gitlab.com/LivInTheLookingGlass/overpassify>`__\n\n`OverpassQL <http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL>`__\nis the language used to query features on OpenStreetMap. Unfortunately,\nit's not very readable.\n\nThe goal here is to enable people to write in a more developer-friendly\nlanguage, and still have it work on the existing infrastructure. As of\nnow, ``overpassify`` can take a snippet like:\n\n.. code:: python\n\n from overpassify import overpassify\n\n @overpassify\n def query():\n search = Area(3600134503)\n ways = Way(search, highway=...)\n odd_keys_demo = Way(search, **{Regex('maxspeed(?::.+)?'): Regex('.+ mph')})\n nodes = Node(search)\n out(ways, geom=True, count=True)\n out(nodes, geom=True, count=True)\n noop()\n\nAnd from that generate:\n\n.. code::\n\n (area(3600134503);) -> .search;\n (way[\"highway\"](area.search);) -> .ways;\n (way[~\"maxspeed(?::.+)?\"~\".+ mph\"](area.search);) -> .odd_keys_demo;\n (node(area.search);) -> .nodes;\n .ways out count;\n .ways out geom;\n .nodes out count;\n .nodes out geom;\n\nThat last ``noop()`` is because of `issue\n#2 <https://github.com/LivInTheLookingGlass/overpassify/issues/2>`__. And as a\nnote, this library assumes you never use a variable name of the form\n``tmp*``. That format will probably be changed to something even less\nlikely in the future, but some translations (for instance, a full\nternary) *require* the use of temporary variables.\n\nOverview\n--------\n\nI'll say this from the outset: ``overpassify`` will support a subset of\nPython. Some things are just too difficult (and maybe impossible) to\nautomatically translate. Functions are an example of that.\n\nOn the other hand, it will try to support a superset of easily-usable\nOverpassQL. Some of those extra features won't be as efficient as their\nPython counterparts, but they will be available.\n\nCurrently ``overpassify`` supports 41/56 of the features listed in the\nOverpassQL guide, and additionally supports ternary statements, ``if`` blocks,\n``break``, and ``continue``.\n\nClasses\n-------\n\nThis library provides wrappers for five types. ``Set()``, ``Node()``,\n``Way()``, ``Area()``, and ``Relation()``. Those last four are *all*\nconsidered subclasses of ``Set()``.\n\nThis library also provides support for strings and numbers. In the\nfuture it will provide support for regex and other things in specific\nplaces.\n\n(Note: Currently nested constructors have some problems in\nimplementation)\n\nAssignment\n----------\n\nThis works about the way you'd expect it to. There are a couple caveats\nthough.\n\n#. You cannot assign a non-\\ ``Set()`` to a variable. This means only\n those five classes listed above.\n#. You cannot assign multiple variables in one line. No ``a, b = b, a``,\n and the like. This could *potentially* be changed later.\n\nNumber and Set Arithmetic\n-------------------------\n\nAnother supported feature is the ability to manipulate these sets and\nnumbers.\n\nAdding sets will produce the union of those sets. Adding numbers will\nproduce their sum.\n\nSubtracting **two** sets will produce their difference. Subtracting\nnumbers will do the same.\n\nSet Filtering\n-------------\n\nYou are also allowed to filter a ``Set()``'s contents by type. For\ninstance, ``Way.filter(<some set>)`` would yield all the ways within\n``<some set>``.\n\nSet intersections\n-----------------\n\nA similar process will allow you to take the intersection of arbitrary\nnumbers of **named** sets. So ``Set.intersect(a, b)`` will yield all\nelements common between ``a`` and ``b``. You cannot, at the moment, use\nan expression inside this function. It **must** be predefined.\n\nYou can also use this in tandem with Set Filtering. So\n``Area.intersect(a, b)`` would yield only the areas common between ``a``\nand ``b``.\n\nSearching for Sets\n------------------\n\nThis library also supports *most* of the ways OverpassQL can search for\ninformation. This currently includes:\n\n#. Checking within an area (or set of areas)\n#. Fetching by ID\n#. Tag matching\n#. Conditional filters (see next section)\n\nThe first two are just given as arguments to the constructor. If you put\nin ``Way(12345)``, that will find the Way with ID 12345. If you put in\n``Way(<some area>)``, it will return all ways within that area.\n\nYou can also define areas using the ``Around()`` function. This has two\nuseful overloads. The first takes the form\n``Around(<some set>, <radius in meters>)``. The second takes the form\n``Around(<radius in meters>, <latitude>, <longitude>)``.\n\nTag matching can be done with keyword arguments. So if you look for\n``Node(highway=\"stop\")``, that will find you all stop signs. It also\nsupports existence checking (``Way(highway=...)``), and non-existence\nchecking (``Area(landuse=None)``), and regex matching\n(``Way(highway=Regex(\"path|cycleway|sidewalk\"))``).\n\nFor keys which are not usable as a keyword, you can use a \"splatted\" dictionary.\nFor instance ``Node(**{'maxspeed:advisory': Regex('.+ mph')})``. The same\nfollows for regex key matching, though regex key matching *must* be with a\nregex value.\n\nYou can also search by both an area and a filter. For instance:\n``Way(<your hometown>, maxspeed=None)``.\n\nTernary Expressions and Conditional Filters\n-------------------------------------------\n\nYou can also filter using the familiar ``a if b else c``. This would\nmean that if ``b`` is truthy, ``a`` should become ``b``, and otherwise\nbecome ``c``.\n\nUnfortunately, since this is not a native feature to OverpassQL, it ends\nup evaluating both sides of that statement.\n\nIf you want ``c`` to be an empty set, however, we can optimize that. So\n``foo = a if b else <type>()`` is the syntax to use there.\n\nAdditional performance is lost because OverpassQL does not support a\nconditional being the *only* filter. This means that we need to provide\nsome other filter, and one in current use is to divide it by type and\nreconstruct. Because of this, filtering down to the appropriate set type yields\nsignificantly batter performance.\n\nReturning Data\n--------------\n\nIn OverpassQL, data can be returned in pieces throughout the function.\nIt's more equivalent to Python's ``yield`` than ``return``. The function\nwe use for that here is ``out()``.\n\n``out()`` takes in one positional argument, and many possible keyword\narguments. It yields data for the positional argument using all the\ntypes defined in the keywords.\n\nFor instance ``out(<set of nodes>, geom=True, body=True, qt=True)``\nwould return all the data that MapRoulette needs to draw those points on\ntheir map.\n\nAs a sidenote, the value given for these keywords is never actually\nchecked. It could as easily be ``geom=False`` as ``geom=True``, and\n``overpassify`` will not care.\n\nFor-Each Loop\n-------------\n\nHere you can use the traditional Python for loop:\n\n.. code:: python\n\n for way in ways:\n out(way, geom=True)\n\nIt does not yet support the else clause, and though it supports ``break`` and\n``continue``, please be aware that this will dramatically slow runtime in that\nloop.\n\nIf Statements\n-------------\n\nThis is a feature that OverpassQL cannot do without some emulation. So\nwhat we do here is:\n\n#. Grab an individual item that will probably be stable over long\n periods of time; in this case, the ``Relation()`` representing\n Antarctica\n#. Use a conditional filter on that relation to get a one item or zero\n item ``Set()``\n#. Iterate over that in a for loop\n#. If there is an else clause, use a conditional filter with the\n negation of the test given to get a one item or zero item ``Set()``\n#. Iterate over the else clause in a for loop\n\nSettings\n--------\n\nWe also provide a wrapper for the option headers. Note that this will\nraise an error if it's not on the first line of your query.\n\nThe valid keywords for ``Settings()`` are as follows:\n\n- ``timeout``: The maximum number of seconds you would like your query\n to run for\n- ``maxsize``: The maximum number of bytes you would like your query to\n return\n- ``out``: The format to return in. It defaults to XML, but you can set\n it to ``\"json\"`` or a variant on ``\"csv\"``, as described `in the\n OverpassQL\n spec <http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Output_Format_.28out.29>`__\n- ``bbox``: The string describing a global bounding box. It is used to\n limit the area your query can encompass, and should take the form\n ``\"<southern lat>,<western lon>,<northern lat>,<eastern lon>\"``\n- ``date``: The string describing what date you would like to query\n for. This allows you to look at past database states. Note that it\n needs an extra set of quotes, so it would look like\n ``date='\"2012-09-12T06:55:00Z\"'``\n- ``diff``: Similar to the above, except it will return the difference\n between that query run at each time. If you give one time, it will\n assume you want to compare to now. It would look like\n ``diff='\"2012-09-12T06:55:00Z\",\"2014-12-24T13:33:00Z\"'``\n- ``adiff``: Similar to the above, except that it tells you what\n happened to each absent element\n\nRough Translation Table\n-----------------------\n\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Feature | OverpassQL | Python |\n+=======================+=======================================+====================================================+\n| Assignment | ``<expr> -> .name`` | ``name = <expr>`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Unions | ``(<set>; ...; <set>)`` | ``<set> + ... + <set>`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Difference | ``(<set> - <set>)`` | ``<set> - <set>`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Intersection | ``.<set>.<set>`` | ``Set.intersect(<set>, <set>)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Type-filtering | ``way.<set>`` | ``Way.filter(<set>)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Searching | | |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..By ID | ``area(1)`` or ``way(7)`` | ``Area(1)`` or ``Way(7)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..In an area | ``way(area.<set>)`` | ``Way(<set>)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..By tags | ``way[\"tag\"=\"value\"]`` | ``Way(tag=value)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..By tag existence | ``way[\"tag\"]`` | ``Way(tag=...)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..By tag nonexistence | ``way[!\"tag\"]`` | ``Way(tag=None)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..By regex | ``way[\"highway\"~\"a|b\"](area.<set>)`` | ``Way(<set>, highway=Regex(\"a|b\"))`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..By inverse regex | ``way[\"highway\"!~\"a|b\"](area.<set>)`` | ``Way(<set>, highway=NotRegex(\"a|b\"))`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..In area + tag | ``way[\"highway\"](area.<set>)`` | ``Way(<set>, highway=...)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Ternary | very long | ``<expr> if <condition> else <expr>`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Conditional Filter | ``<type>.<set>(if: <condition>)`` | ``<expr> if <condition> else <type>()`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| For Loop | ``foreach.<set>->.<each>(<body>)`` | ``for <each> in <set>:\\n <body>`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| If Statement | very long | ``if <condition>:\\n <body>\\nelse:\\n <body>`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| Recursing | | |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..Up | ``.a <`` or ``.a < -> .b`` | ``a.recurse_up()`` or ``b = a.recurse_up()`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..Up (w/ relations) | ``.a <<`` or ``.a << -> .b`` | ``a.recurse_up_relations()`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..Down | ``.a >`` or ``.a > -> .b`` | ``a.recurse_down()`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..Down (w/ relations) | ``.a >>`` or ``.a >> -> .b`` | ``a.recurse_down_relations()`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| is_in filers | | |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..On a set | ``.a is_in -> .areas_with_part_of_a`` | ``areas_containing_part_of_a = is_in(a)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n| ..On a lat/lon pair | ``is_in(0, 0) -> .areas_with_0_0`` | ``areas_containing_0_0 = is_in(0, 0)`` |\n+-----------------------+---------------------------------------+----------------------------------------------------+\n\nFeatures Not Yet Implemented\n----------------------------\n\n#. Filters\n\n #. Recursion Functions\n #. Filter By Bounding Box\n #. Filter By Polygon\n #. Filter By \"newer\"\n #. Filter By Date Of Change\n #. Filter By User\n #. Filter By Area Pivot\n\n#. ID Evaluators\n\n #. id() And type()\n #. is\\_tag() And Tag Fetching\n #. Property Count Functions\n\n#. Aggregators\n\n #. Union and Set\n #. Min and Max\n #. Sum\n #. Statistical Counts\n\n#. Number Normalizer\n#. Date Normalizer\n\n\n",
"bugtrack_url": null,
"license": "LGPLv3",
"summary": "A tool to more easily develop queries of OpenStreetMap",
"version": "1.2.3",
"project_urls": {
"Homepage": "https://github.com/LivInTheLookingGlass/overpassify"
},
"split_keywords": [
"osm",
"openstreetmap",
"overpass",
"overpassql",
"transpiler",
"transpile",
"compiler",
"compile",
"query"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3e96639385ffaaad893a82077c7ca659fa5b75b2bd04c0464f44a586090d4526",
"md5": "67578b8523101fa11262b625515cd84f",
"sha256": "d3ee2cb5ccf4c5079265e4b9b51455fef30de6ff36d23352b99d5188997c5177"
},
"downloads": -1,
"filename": "overpassify-1.2.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "67578b8523101fa11262b625515cd84f",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 16674,
"upload_time": "2024-07-21T17:45:43",
"upload_time_iso_8601": "2024-07-21T17:45:43.448726Z",
"url": "https://files.pythonhosted.org/packages/3e/96/639385ffaaad893a82077c7ca659fa5b75b2bd04c0464f44a586090d4526/overpassify-1.2.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d56d7fe2d1a9cfbe946466faadcf130d5c92ec40af3245478d5a75229bdd7a1f",
"md5": "1afd9dadd7074dc2bac0568cea2e1548",
"sha256": "66fd9f2d8ba3b44be66264ec5751a087617ba9866b4cb1fb6dba6c5a83caa8bd"
},
"downloads": -1,
"filename": "overpassify-1.2.3.tar.gz",
"has_sig": false,
"md5_digest": "1afd9dadd7074dc2bac0568cea2e1548",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20789,
"upload_time": "2024-07-21T17:45:44",
"upload_time_iso_8601": "2024-07-21T17:45:44.979138Z",
"url": "https://files.pythonhosted.org/packages/d5/6d/7fe2d1a9cfbe946466faadcf130d5c92ec40af3245478d5a75229bdd7a1f/overpassify-1.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-21 17:45:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "LivInTheLookingGlass",
"github_project": "overpassify",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "overpassify"
}