Skip to content

Commit c28b3c0

Browse files
authored
Merge pull request mvexel#113 from b-jazz/master
Added some docstrings to API and get() method
2 parents fb1e83c + ccb4cb2 commit c28b3c0

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

overpass/api.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@
2020

2121

2222
class API(object):
23-
"""A simple Python wrapper for the OpenStreetMap Overpass API."""
23+
"""A simple Python wrapper for the OpenStreetMap Overpass API.
24+
25+
:param timeout: If a single number, the TCP connection timeout for the request. If a tuple
26+
of two numbers, the connection timeout and the read timeout respectively.
27+
Timeouts can be integers or floats.
28+
:param endpoint: URL of overpass interpreter
29+
:param headers: HTTP headers to include when making requests to the overpass endpoint
30+
:param debug: Boolean to turn on debugging output
31+
:param proxies: Dictionary of proxies to pass to the request library. See
32+
requests documentation for details.
33+
"""
2434

2535
SUPPORTED_FORMATS = ["geojson", "json", "xml", "csv"]
2636

@@ -60,7 +70,17 @@ def __init__(self, *args, **kwargs):
6070
requests_log.propagate = True
6171

6272
def get(self, query, responseformat="geojson", verbosity="body", build=True):
63-
"""Pass in an Overpass query in Overpass QL."""
73+
"""Pass in an Overpass query in Overpass QL.
74+
75+
:param query: the Overpass QL query to send to the endpoint
76+
:param responseformat: one of the supported output formats ["geojson", "json", "xml", "csv"]
77+
:param verbosity: one of the supported levels out data verbosity ["ids",
78+
"skel", "body", "tags", "meta"] and optionally modifiers ["geom", "bb",
79+
"center"] followed by an optional sorting indicator ["asc", "qt"]. Example:
80+
"body geom qt"
81+
:param build: boolean to indicate whether to build the overpass query from a template (True)
82+
or allow the programmer to specify full query manually (False)
83+
"""
6484
# Construct full Overpass query
6585
if build:
6686
full_query = self._construct_ql_query(

0 commit comments

Comments
 (0)