Skip to content

Instantly share code, notes, and snippets.

@JayantGoel001
Created April 9, 2021 04:30
Show Gist options
  • Save JayantGoel001/cd994cb2288f39a2e6a45d25a56cc09e to your computer and use it in GitHub Desktop.
Save JayantGoel001/cd994cb2288f39a2e6a45d25a56cc09e to your computer and use it in GitHub Desktop.
Get Information of Any Country using countryinfo python package
from countryinfo import CountryInfo
name = "India"
country = CountryInfo(name)
print(country.alt_spellings())
print(country.capital())
print(country.currencies())
print(country.languages())
print(country.timezones())
print(country.area())
print(country.borders())
print(country.calling_codes())
print(country.wiki())
print("=======================================================================")
name = "Taiwan"
country = CountryInfo(name)
for key, values in country.info().items():
if type(values) != dict:
print(key, "--->", values)
else:
for vkey, vvalues in values.items():
print("\t", vkey, "--->", vvalues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment