python-overpy
python-overpy copied to clipboard
Added options to return or include raw data from query
Issue type
- Feature
Summary
Added options to keep the raw XML or JSON response along with the parsed result, and a method to return only the raw response. The latter fixes #79.
Example:
api = overpy.Overpass()
result = api.query("[out:json];node[\"ISO3166-1\"=\"France\"];out;", include_raw=True)
print(result.raw)
api = overpy.Overpass()
data, content_type = api.query_raw("[out:json];node[\"ISO3166-1\"=\"France\"];out;")
print(data)