Skip to main content

Python API Wrapper for

Project description

This is a simple python wrapper for the API of <>. If there are any issues, please use this repository to contact me about it.


pip install python-restcountries


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]
  • 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-restcountries, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size python-restcountries-0.2.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page