Skip to main content

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

This version
History Node

0.2

History Node

0.1b2

History Node

0.1b1

History Node

0.1a3

History Node

0.1a2

History Node

0.1a1

History Node

0.1a0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
python-restcountries-0.2.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None Nov 26, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page