PyGeoLang: Python Library for Geo-Linguistic Data
PyGeoLang is a Python library that provides easy access to comprehensive geographic and linguistic data about countries and continents. It builds upon and extends the functionality of popular libraries like pycountry and langcodes to offer a unified interface for various geo-linguistic queries.
Features
- Country Data:
- Get country codes (alpha-2, alpha-3, numeric) by name.
- Get country names by code.
- Get official country names.
- Get the continent a country belongs to.
- Get languages spoken in a country.
- Continent Data:
- Get a list of countries in a continent.
- Language Data:
- Get countries where a specific language is spoken.
- Data Source:
- Data is sourced from reliable sources (
pycountry, custom dataset) and efficiently stored in a binary format for fast loading.
- Data is sourced from reliable sources (
- Simple API:
- Easy-to-use functions for common geo-linguistic queries.
- Extensible:
- Designed to be easily extended with additional data sources or custom functions.
Installation
pip install pygeolang
Usage
import pygeolang
# Get country code
code = pygeolang.get_country_code("Germany", "alpha_3")
print(code) # Output: DEU
# Get country by code
country = pygeolang.get_country_by_code("276")
print(country.name) # Output: Germany
print(country.official_name) # Output: Federal Republic of Germany
print(country.languages) # Output: ['German']
print(country.continent) # Output: Europe
# Get countries by continent
countries = pygeolang.get_countries_by_continent("Asia")
print(countries) # ['Afghanistan', 'Armenia', ... ]
# Get languages by country
languages = pygeolang.get_languages_by_country("India")
print(languages) # ['Hindi', 'English', ...]
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for pygeolang 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygeolang-0.3.1.tar.gz | 12.0 kB | Without provenance | Details for pygeolang-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygeolang-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for pygeolang-0.3.1-py3-none-any.whl |
Total release size: 23.2 kB
Release files / pygeolang-0.3.1.tar.gz
| Download URL | pygeolang-0.3.1.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74fbed1af9d1750436c741859cd7962b8f052151478643e21c139b94ae8b6c9a
|
|
BLAKE2b-256 checksum How to use checksums |
4e2de7422789d4db9c23797e8d9c0442668208413de8b0c02e86d7667c039fa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Release files / pygeolang-0.3.1-py3-none-any.whl
| Download URL | pygeolang-0.3.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54b085c9da04848c0c6aadc762cd21e921d852788d55e973336fb9368fb2e983
|
|
BLAKE2b-256 checksum How to use checksums |
03793eab1038233301f47d3e1287d6e5148cf5e5ada53210ad6a3212264a3101
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Security for pygeolang 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.