Python API Wrapper for restcountries.eu
Project description
This is a simple python wrapper for the API of http://restcountries.eu <http://restcountries.eu>. If there are any issues, please use this repository to contact me about it.
Installation
pip install python-restcountries
Usage
Just import the API Wrapper and start using it!:
# v1 from restcountries import RestCountryApi as rapi
from restcountries import RestCountryApiV2 as rapi
def foo(name):
country_list = rapi.get_countries_by_name('France')
The Country object
The API returns Country objects or a list of Country objects. Through the country objects one is able to access following attributes.:
country = country_list[0] print(country.name) France
top_level_domain
alpha2_code
alpha3_code
currencies
capital
calling_codes
alt_spellings
relevance
region
subregion
translations
population
latlng
demonym
area
gini
timezones
borders
native_name
name
numeric_code
languages
flag
regional_blocs
cioc
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file python-restcountries-0.2.tar.gz.
File metadata
- Download URL: python-restcountries-0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3e7b896409aff59cdd58a5a846058e4c744639cb9c13f887463cb4f64b8ba10
|
|
| MD5 |
1872e06805fe4c5457ed8abfdc71c34f
|
|
| BLAKE2b-256 |
7fbe507a7ef436ce2f630a772d2873a70e218edf84926b2dce5d4992bb33dce2
|