Skip to main content

Get the name of a country's capital city.

Project description

Country-Capitals

Get the name of a country's capital city. That's it.

Installation

pip install country-capitals

Usage

from country_capitals import get_capital

get_capital("Germany")
get_capital("Germ", fuzzy=True)
get_capital("DEU")
get_capital("DE")
get_capital("276")

The following identifiers are supported:

  • Country name (common, official, etc.)
  • ISO 3166-1 numeric-3 codes
  • ISO 3166-1 alpha-2 codes
  • ISO 3166-1 alpha-3 codes
  • pycountry country objects

Including fuzzy=True will try to use use a fuzzy matching algorithm to find the country name.

Development

To run the tests:

python -m unittest

Project details


Download files

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

Source Distribution

country_capitals-1.0.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

country_capitals-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file country_capitals-1.0.0.tar.gz.

File metadata

  • Download URL: country_capitals-1.0.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for country_capitals-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8950040d940ff2226737515db4d2b6b567d3853f35cf358c403f621cfd897e78
MD5 725d93a88b6e5212ab98b9460a4ba38c
BLAKE2b-256 adbc9786fbfc1ef134d041f200dc83f6a98870b6b901fe629c1d8d0283fe22cd

See more details on using hashes here.

File details

Details for the file country_capitals-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for country_capitals-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd3217bcff27dd8d96e60a54f161c3da58f027b5dc8b9f83083aca26b956242
MD5 f6617e3fe1ef4c8e5fa850fe38c7c9cf
BLAKE2b-256 82b2cd9017dc56bbf347e0b68413e05685c137a5776487551f2379a078413584

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page