Skip to main content

An python package that allows to access detailed geographic data on Thailand, including provinces, districts, subdistricts and postal codes. 🌟

Project description

GeoThai Python Library

PyPI - Version PyPI Downloads

Welcome to the GeoThai Python Library! This library provides a simple and efficient way to access detailed geographic data for Thailand, including provinces, districts, and subdistricts.

🌏 Overview

This Python library allows you to:

  • Retrieve information about provinces, districts, and subdistricts in Thailand.
  • Filter geographic data based on specific criteria.
  • Integrate geographic data into your Python applications with ease.

🚀 Installation

You can install the GeoThai Python Library via pip:

pip install geothai

📚 Usage

Importing the Library

from geothai import (
    get_all_provinces,
    get_province_by_code,
    get_provinces_by_criterion,
    Province
)

Retrieving All Provinces

provinces = get_all_provinces()
print(provinces)

Getting a Province by ID

province = get_province_by_code(10)  # Replace 10 with the desired province_id
print(province)

Filtering Provinces by Criteria

criteria: Province = {"name_th": "กรุงเทพมหานคร"}
matching_provinces = get_provinces_by_criterion(criteria)
print(matching_provinces)

Similarly, You Can Access Districts, Subdistricts and Postal Codes

districts = get_all_districts()
subdistricts = get_all_subdistricts()
postal_codes = get_all_postal_codes()

📂 Project Structure

The project is structured as follows:

  • geothai/data/: Contains the data files for provinces, districts, and subdistricts.
  • geothai/services/: Contains the main services for accessing province, district, and subdistrict data.
  • geothai/types/: Includes type definitions for provinces, districts, subdistricts, and postal codes.
  • geothai/utils/: Includes utility functions like criteria matching for filtering data.

🛠 Development

To contribute to the development of this library:

  1. Clone the repository:
git clone https://github.com/GeoThai/python-library.git
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Run the tests:
pytest

🤝 Contributing

We welcome contributions to enhance the functionality of this library. Please check the CONTRIBUTING.md for guidelines on how to contribute.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

🙋‍♂️ Contact

If you have any questions, issues, or suggestions, feel free to reach out at geothai@fasu.dev.

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

geothai-2.0.1.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

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

geothai-2.0.1-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file geothai-2.0.1.tar.gz.

File metadata

  • Download URL: geothai-2.0.1.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for geothai-2.0.1.tar.gz
Algorithm Hash digest
SHA256 346bca83c17be7010f429cb6265d0c1e38a497b314124dde1710d078e4f1cd2e
MD5 b84e44acf6bfbd5c699e009e7b7c12ec
BLAKE2b-256 0a69ad7b22689d1258e52ef739e9981e31ffa8cdb7b5487750cd1c9329f42445

See more details on using hashes here.

Provenance

The following attestation bundles were made for geothai-2.0.1.tar.gz:

Publisher: publish.yml on GeoThai/python-library

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file geothai-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: geothai-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for geothai-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd35cb513c044121cebfe3e8d67b9782db3624d43ebc3dc5845b25f9714c6bee
MD5 88840cb43286d4b4f077f2a48949328c
BLAKE2b-256 1dec5ca63e10c6668149ad212f6fca6ea2628d44aeb934f0cacff9ff2906a9af

See more details on using hashes here.

Provenance

The following attestation bundles were made for geothai-2.0.1-py3-none-any.whl:

Publisher: publish.yml on GeoThai/python-library

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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