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
pycountrycountry 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8950040d940ff2226737515db4d2b6b567d3853f35cf358c403f621cfd897e78
|
|
| MD5 |
725d93a88b6e5212ab98b9460a4ba38c
|
|
| BLAKE2b-256 |
adbc9786fbfc1ef134d041f200dc83f6a98870b6b901fe629c1d8d0283fe22cd
|
File details
Details for the file country_capitals-1.0.0-py3-none-any.whl.
File metadata
- Download URL: country_capitals-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cd3217bcff27dd8d96e60a54f161c3da58f027b5dc8b9f83083aca26b956242
|
|
| MD5 |
f6617e3fe1ef4c8e5fa850fe38c7c9cf
|
|
| BLAKE2b-256 |
82b2cd9017dc56bbf347e0b68413e05685c137a5776487551f2379a078413584
|