Get info about countries and states
Project description
Geography Module
Description
This Python module, Geography, provides classes that encapsulate information about geographical entities such as countries, states/provinces, continents, and regions. These classes retrieve various geographical and socioeconomic data attributes.
Installation
To use this module, follow these steps:
1. Open a terminal window and type the following command:
2. pip install geography
3. Enjoy!
Usage
Classes:
AustralianState: Represents an Australian state with various attributes such as area, population, GDP, etc.
CanadianProvince: Represents a Canadian province with attributes similar to AustralianState
.
Continent: Represents a continent with attributes like total area, population, GDP, etc.
Country: Represents a country with a wide range of attributes including area, population, GDP, etc.
CountrySimple: A simplified version of Country
class with essential attributes.
USState: Represents a state within the United States with attributes similar to AustralianState
.
USRegion: Represents a region within the United States with attributes similar to Continent
.
How to Use:
1. Import the desired class from Geography
.
import geography
2. Instantiate the class with a specific identifier (alpha code).
country = geography.fetch_country('USA')
3. Access various attributes of the instantiated object.
print(country.name)
Available subdivisions:
Australian States and Territories
Canadian Provinces and Territories
Continents
Countries
USA States and Territories
USA Regions
Planned upcoming subdivisions:
Brazil States
China Provinces
Ethiopia Regions
France Regions
Germany States
India States and Territories
Japan Prefectures
Mexican States
Russia Federal Subjects
Saudi Arabia Provinces
South African Provinces
Spain Regions
United Arab Emirates - Emirates
The information you can get:
Alpha Code For Subdivisions (ISO 3166-2)
Alpha-2 Code (ISO 3166-1 alpha-2)
Alpha-3 Code (ISO 3166-1 alpha-3)
Area in KM
Area in Miles
Area Ranking
Area Ranking Dictionary
Capital
Continent
Countries in Continent
Flag URL
GDP
GDP Ranking
GDP Ranking Dictionary
GDP per Capita
GDP per Capita Ranking
GDP per Capita Ranking Dictionary
Largest City
Name
Region
Population
Population Ranking
Population Ranking Dictionary
Population Density in KM
Population Density in Miles
Population Density Ranking
Population Density Ranking Dictionary
States in Region
Get is State/Province/Territory type. (AST, CPT, SAP, UST)
Note
This module relies on external data sources and APIs for retrieving geographical and socioeconomic information. Ensure a stable internet connection for seamless functionality.
For detailed information on available attributes and methods for each class, refer to the class definitions in the main file.
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
geography-0.0.81.tar.gz
(195.5 kB
view details)
File details
Details for the file geography-0.0.81.tar.gz
.
File metadata
- Download URL: geography-0.0.81.tar.gz
- Upload date:
- Size: 195.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 374528c93e214c5c42f33e77d04337523698e6111b6e7982b56672e110732d0f |
|
MD5 | 56589d05572f8d532746b0c389cc8eb8 |
|
BLAKE2b-256 | 93b98ecaec1f72ee15e1f94ab8e6e1fbe894986f422613ece667c6b0b4f71710 |