Skip to content

Commit

Permalink
Merge pull request #309 from 3add3287/osm_country_code
Browse files Browse the repository at this point in the history
add country_code as obtained from OSM
  • Loading branch information
DenisCarriere committed Nov 5, 2017
2 parents 082d69f + 9166447 commit 59cb6e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Table of releases
## [Unreleased]

* added opencage rate to show how many API queries remain for the day (issue #295)
* added `country_code` result when geocoding with osm

## [1.32.1] - 2017-09-16

Expand Down
2 changes: 1 addition & 1 deletion geocoder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
__title__ = 'geocoder'
__author__ = 'Denis Carriere'
__author_email__ = 'carriere.denis@gmail.com'
__version__ = '1.32.1'
__version__ = '1.32.2'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2013-2016 Denis Carriere'

Expand Down
5 changes: 5 additions & 0 deletions geocoder/osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ def country(self):
"""admin_level=2"""
return self._address.get('country')

@property
def country_code(self):
"""admin_level=2"""
return self._address.get('country_code')

# ======================== #
# Quality Control & Others #
# ======================== #
Expand Down

0 comments on commit 59cb6e4

Please sign in to comment.