Skip to main content

A Python package for accessing country, continent, and language data.

Project description

PyGeoLang: Python Library for Geo-Linguistic Data

PyPI Version Documentation Status License: MIT

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.
  • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygeolang-0.2.9.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygeolang-0.2.9-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file pygeolang-0.2.9.tar.gz.

File metadata

  • Download URL: pygeolang-0.2.9.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pygeolang-0.2.9.tar.gz
Algorithm Hash digest
SHA256 f31b4c2b257c0dbfd63bd0a1ff78bd46768ab8af8b272c46f084fbadb1d47d7b
MD5 efd3d2b04aca8f6eb91e7d5ffe87706e
BLAKE2b-256 88b046d59c6f841e82cb1ab8576e41c21531c11d42bc3fd6aa61e54010429535

See more details on using hashes here.

File details

Details for the file pygeolang-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: pygeolang-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pygeolang-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9dbd2dcbeccb5259006372eac41081c0e22d8d47c35f134bb6b3e275ebf62c97
MD5 e546a2dbc0eaaedf04795093ac8cedbe
BLAKE2b-256 c73314d02b686a2fa039ff332fd19e45a6356254112fe93203fdc242776e1f01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page