Skip to content

Commit 72954a7

Browse files
committed
Merge branch 'mvexel/master' into auto-import
Conflicts: Overpass/Overpass.py Overpass/__init__.py Overpass/api.py README.md overpass/Overpass.py
2 parents 78eb74e + 4dc36cb commit 72954a7

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ This is a thin wrapper around the OpenStreetMap [Overpass API](http://wiki.opens
44

55
## Install it
66

7-
```
8-
python setup.py install
7+
```bash
8+
$ python setup.py install
99
```
1010

1111
The module is not on PyPi yet.
1212

1313
## Use it
1414

15-
```
16-
>>> import Overpass
17-
>>> api = Overpass.API()
15+
```python
16+
>>> import overpass
17+
>>> api = overpass.API()
1818
>>> response = api.Get('node["name"="Salt Lake City"]')
1919
```
2020

2121
Note that you don't have to include any of the output meta statements. The wrapper will, well, wrap those.
2222

2323
You will get your result as a dictionary, which (for now) represents the JSON output you would get [from the Overpass API directly](http://overpass-api.de/output_formats.html#json). So you could do this for example:
2424

25-
```
25+
```python
2626
>>> print [(feature['tags']['name'], feature['id']) for feature in response['elements']]
2727
[(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637), (u'Salt Lake City', 1615721573)]
2828
```
@@ -35,13 +35,17 @@ The API takes a few parameters:
3535

3636
The default endpoint is `http://overpass-api.de/api/interpreter` but you can pass in the rambler instance (`http://overpass.osm.rambler.ru/cgi/interpreter`) or your own:
3737

38-
api = Overpass.API(endpoint=http://overpass.myserver/interpreter)
38+
```python
39+
api = overpass.API(endpoint=http://overpass.myserver/interpreter)
40+
```
3941

4042
#### `timeout`
4143

4244
The default timeout is 25 seconds, but you can set it to whatever you want.
4345

44-
api = Overpass.API(timeout=600)
46+
```python
47+
api = overpass.API(timeout=600)
48+
```
4549

4650
#### `debug`
4751

File renamed without changes.
File renamed without changes.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
requests==2.3.0
1+
requests>=2.3.0

test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Overpass
1+
import overpass
22

33

44
class TestAPI:
55

66
def test_initialize_api(self):
7-
api = Overpass.API()
8-
assert isinstance(api, Overpass.API)
7+
api = overpass.API()
8+
assert isinstance(api, overpass.API)
99
assert api.debug == False

0 commit comments

Comments
 (0)