python-overpy icon indicating copy to clipboard operation
python-overpy copied to clipboard

Added options to return or include raw data from query

Open Krafpy opened this issue 2 years ago • 0 comments

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)

Krafpy avatar Sep 02 '23 21:09 Krafpy