diff --git a/README.md b/README.md index 506ad9d..6d869ad 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ A python module for returning data about countries, ISO info and states/province * [.borders()](#borders) * [.calling_codes()](#calling_codes) * [.capital()](#capital) +* [.capital_latlng()](#capital_latlng) * [.currencies()](#currencies) * [.demonym()](#demonym) * [.geojson()`](#geo_json) @@ -83,6 +84,10 @@ country.info() 'borders': [], 'callingCodes': ['65'], 'capital': 'Singapore', + 'capital_latlng': [ + 1.357107, + 103.819499 + ], 'currencies': ['SGD'], 'demonym': 'Singaporean', 'flag': '', @@ -210,6 +215,21 @@ country.capital() 'Singapore' ``` +### .capital_latlng() + +Returns capital city latitude and longitude for a specified country + +```python +# coding=utf-8 +from countryinfo import CountryInfo + + +country = CountryInfo('Singapore') +country.capital_latlng() +# returns array, approx latitude and longitude for country capital +[1.357107, 103.819499] +``` + ### .currencies() Returns official currencies for a specified country @@ -502,6 +522,7 @@ country.all() 'borders': ['BWA', 'MOZ', 'ZAF', 'ZMB'], 'callingCodes': ['263'], 'capital': 'Harare', + 'capital_latlng': [-17.831773, 31.045686], 'currencies': ['USD'], 'demonym': 'Zimbabwean', 'flag': '', @@ -647,7 +668,7 @@ If like to contribute in a good way, then follow the following guidelines. ## Disclaimer This is being maintained in the contributor's free time, and as such, may contain minor errors in regards to some countries. -Most of the information included in this library is what is listed on Wikipedia. If there is an error, +Most of the information included in this library is what is listed on Wikipedia. If there is an error, please let me know and I will do my best to correct it. ## License diff --git a/README.rst b/README.rst index c60ae97..3d26956 100644 --- a/README.rst +++ b/README.rst @@ -20,6 +20,7 @@ APIs - `.borders() <#borders>`__ - `.calling\_codes() <#calling_codes>`__ - `.capital() <#capital>`__ +- `.capital_latlng() <#capital_latlng>`__ - `.currencies() <#currencies>`__ - `.demonym() <#demonym>`__ - `.geojson()\` <#geo_json>`__ @@ -224,6 +225,22 @@ Returns capital city for a specified country # returns string 'Singapore' +.capital_latlng() +~~~~~~~~~~~~~~~~~ + +Returns capital city latitude and longitude for a specified country + +.. code:: python + + # coding=utf-8 + from countryinfo import CountryInfo + + + country = CountryInfo('Singapore') + country.capital_latlng() + # returns array, approx latitude and longitude for country capital + [1.357107, 103.819499] + .currencies() ~~~~~~~~~~~~~ @@ -536,6 +553,7 @@ countries. This will be super big. Not recommended. 'borders': ['BWA', 'MOZ', 'ZAF', 'ZMB'], 'callingCodes': ['263'], 'capital': 'Harare', + 'capital_latlng': [-17.831773, 31.045686], 'currencies': ['USD'], 'demonym': 'Zimbabwean', 'flag': '',