Skip to content

Commit

Permalink
add copyright to code, add LICENSE to manifest, fixes mvexel#51
Browse files Browse the repository at this point in the history
  • Loading branch information
mvexel committed Apr 6, 2018
1 parent 330ed80 commit 5edc97f
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 6 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include LICENSE.txt
5 changes: 5 additions & 0 deletions examples/readme_example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env python

# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.

import overpass

api = overpass.API()
Expand Down
5 changes: 5 additions & 0 deletions examples/turn_restriction_relations_as_list.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env python

# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.

# Retrieves a list of turn restriction relations in Toronto.

import overpass
Expand Down
5 changes: 5 additions & 0 deletions examples/unique_users_for_area.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env python

# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.

# Retrieves a list of unique usernames and user IDs for a named area.

import overpass
Expand Down
7 changes: 6 additions & 1 deletion overpass/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-

# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.

"""Thin wrapper around the OpenStreetMap Overpass API."""

__title__ = 'overpass'
__version__ = '0.1.0'
__version__ = '0.6.0'
__license__ = 'Apache 2.0'

from .api import API
Expand Down
5 changes: 5 additions & 0 deletions overpass/api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.

import requests
import json
import csv
Expand Down
6 changes: 6 additions & 0 deletions overpass/errors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.


class OverpassError(Exception):
"""An error during your request occurred.
Super class for all Overpass api errors."""
Expand Down
5 changes: 5 additions & 0 deletions overpass/queries.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# -*- coding: utf-8 -*-

# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.


class MapQuery(object):
"""Query to retrieve complete ways and relations in an area."""
Expand Down
16 changes: 11 additions & 5 deletions overpass/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.


class Utils(object):

@classmethod
def to_overpass_id(self, osmid, area=False):
AREA_BASE = 2400000000
RELATION_BASE = 3600000000
def to_overpass_id(cls, osmid, area=False):
area_base = 2400000000
relation_base = 3600000000
if area:
return int(osmid) + AREA_BASE
return int(osmid) + RELATION_BASE
return int(osmid) + area_base
return int(osmid) + relation_base
5 changes: 5 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright 2015-2018 Martijn van Exel.
# This file is part of the overpass-api-python-wrapper project
# which is licensed under Apache 2.0.
# See LICENSE.txt for the full license text.

import overpass


Expand Down

0 comments on commit 5edc97f

Please sign in to comment.