MyPyCountries : Library to get information about countries need for project Ransomware.live
The Country Library is a Python module that offers easy access to the latitude and longitude of countries and territories around the world, based on their ISO 3166-1 alpha-2 codes. It also allows users to retrieve country codes or names based on the provided input. This module is ideal for developers needing quick geographical data without relying on external APIs.
Coordinates Lookup: Retrieve latitude and longitude by ISO country code. Country Code Lookup: Get the ISO country code by providing a country name. Country Name Lookup: Obtain the full country name using the ISO country code.
To use this library, simply download the mypycountries.py file and include it in your project directory. Make sure Python is installed on your system.
Here's how you can use the functions provided by the Country Coordinates Library:
Retrieve the geographic coordinates (latitude and longitude) for a given country using its ISO country code:
from mypycountries import get_coordinates
coords = get_coordinates('US')
print(f"Coordinates of the United States: {coords}")
Look up the ISO country code for a given country by name:
from mypycountries import get_country_code
country_code = get_country_code("United States of America")
print(f"ISO country code for the United States of America: {country_code}")
Get the official name of a country from its ISO country code:
from mypycountries import get_country_name
country_name = get_country_name('US')
print(f"Country name for 'US': {country_name}")
Get the region name of a country from its ISO country code:
from mypycountries import get_region_name
region_name = get_region_name('FR')
print(f"Country name for 'FR': {region_name}")
Contributions to the Country Coordinates Library are welcome! If you would like to improve the module or add new features, please fork the repository, make your changes, and submit a pull request.
This project is licensed under the GNU License - see the LICENSE file for details.
This data is based on ISO 3166-1 alpha-2 standards. Thanks to all contributors who have helped in maintaining and updating the geographical data.