Un package Python pour la géographie
Project description
geography_toolkit
geography_toolkit is a python package that provides comprehensive geographical information about countries and continents. It allows you to obtain details such as the capital, population, area, official languages, currencies, timezones, flag, subregion, and neighboring countries of a given country. All data is stored locally, enabling offline use.
Installation
To install the geography_toolkit package, make sure you have python 3.x installed. You can install the package directly from Pypi
pip install geography_toolkit
Usage
Available Functions
Continent Functions
-
get_continents()Returns the list of available continents.
from geography_toolkit import get_continents
continents = get_continents()
print(continents)
Example Output:
['Africa', 'Europe']
-
get_countries(continent)Returns the list of countries in a given continent.
from geography_toolkit import get_countries
countries = get_countries('Africa')
print(countries)
Example Output:
['Nigeria', 'Egypt']
Country Information Functions
-
get_capital(country_name)Returns the capital of a given country.
from geography_toolkit import get_capital
capital = get_capital('Nigeria')
print(capital)
Example Output:
'Abuja'
-
get_population(country_name)Returns the population of a given country.
from geography_toolkit import get_population
population = get_population('Egypt')
print(population)
Example Output:
102334404
-
get_area(country_name)Returns the area of a given country in km².
from geography_toolkit import get_area
area = get_area('Germany')
print(area)
Example Output:
357114
-
get_languages(country_name)Returns the list of official languages of a given country.
from geography_toolkit import get_languages
languages = get_languages('France')
print(languages)
Example Output:
['French']
-
get_currencies(country_name)Returns the list of currencies of a given country.
from geography_toolkit import get_currencies
currencies = get_currencies('France')
print(currencies)
Example Output:
['EUR']
-
get_timezones(country_name)Returns the list of timezones of a given country.
from geography_toolkit import get_timezones
timezones = get_timezones('Egypt')
print(timezones)
Example Output:
['UTC+02:00']
-
get_flag(country_name)Returns the URL of the flag of a given country.
from geography_toolkit import get_flag
flag_url = get_flag('Germany')
print(flag_url)
Example Output:
-
get_subregion(country_name)Returns the subregion of a given country.
from geography_toolkit import get_subregion
subregion = get_subregion('Nigeria')
print(subregion)
Example Output:
'Western Africa'
-
get_borders(country_name)Returns the list of neighboring countries of a given country.
from geography_toolkit import get_borders
borders = get_borders('Nigeria')
print(borders)
Example Output:
['NER', 'BEN', 'CMR', 'TCD']
-
get_all_info(country_name)Returns all available information about a given country.
from geography_toolkit import get_all_info
all_info = get_all_info('Egypt')
print(all_info)
Example Output:
{ 'country': 'Egypt', 'capital': 'Cairo', 'population': 102334404, 'area_km2': 1002450, 'languages': ['Arabic'], 'currencies': ['EGP'], 'timezones': ['UTC+02:00'], 'flag': 'https://flagcdn.com/w320/eg.png', 'subregion': 'Northern Africa', 'borders': ['ISR', 'PSE', 'LBY', 'SDN'] }
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 geography_toolkit-0.1.0.tar.gz.
File metadata
- Download URL: geography_toolkit-0.1.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aa086423026afa02276aa38b26fb9196a4b5a551ee1e63de14066a906101521
|
|
| MD5 |
1d9c6710c4f5f8471f0aa2213cb5680b
|
|
| BLAKE2b-256 |
b33269f612c88fa3b4076e33de8265e03c0ae003f20e11bb5d1b7e7e1fa41c80
|
File details
Details for the file geography_toolkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: geography_toolkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ac4946f38ccd77cf2619db47c0da1e6823ab2698555a18bb0aef5d1740cee1e
|
|
| MD5 |
28080dadc8f3aece85121e828d603a52
|
|
| BLAKE2b-256 |
1acbc6f31993605771266f6ebb231f827fe5557365f8dd8b73a2772137a8f49e
|