An python package that allows to access detailed geographic data on Thailand, including provinces, districts, subdistricts and postal codes. 🌟
Project description
GeoThai Python Library
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:
- Clone the repository:
git clone https://github.com/GeoThai/python-library.git
- Install the required dependencies:
pip install -r requirements.txt
- 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
346bca83c17be7010f429cb6265d0c1e38a497b314124dde1710d078e4f1cd2e
|
|
| MD5 |
b84e44acf6bfbd5c699e009e7b7c12ec
|
|
| BLAKE2b-256 |
0a69ad7b22689d1258e52ef739e9981e31ffa8cdb7b5487750cd1c9329f42445
|
Provenance
The following attestation bundles were made for geothai-2.0.1.tar.gz:
Publisher:
publish.yml on GeoThai/python-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geothai-2.0.1.tar.gz -
Subject digest:
346bca83c17be7010f429cb6265d0c1e38a497b314124dde1710d078e4f1cd2e - Sigstore transparency entry: 1396376208
- Sigstore integration time:
-
Permalink:
GeoThai/python-library@b065bfc27a2a0c5494381ebd6b0ad7c4028a4160 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GeoThai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b065bfc27a2a0c5494381ebd6b0ad7c4028a4160 -
Trigger Event:
workflow_run
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd35cb513c044121cebfe3e8d67b9782db3624d43ebc3dc5845b25f9714c6bee
|
|
| MD5 |
88840cb43286d4b4f077f2a48949328c
|
|
| BLAKE2b-256 |
1dec5ca63e10c6668149ad212f6fca6ea2628d44aeb934f0cacff9ff2906a9af
|
Provenance
The following attestation bundles were made for geothai-2.0.1-py3-none-any.whl:
Publisher:
publish.yml on GeoThai/python-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geothai-2.0.1-py3-none-any.whl -
Subject digest:
dd35cb513c044121cebfe3e8d67b9782db3624d43ebc3dc5845b25f9714c6bee - Sigstore transparency entry: 1396376225
- Sigstore integration time:
-
Permalink:
GeoThai/python-library@b065bfc27a2a0c5494381ebd6b0ad7c4028a4160 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GeoThai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b065bfc27a2a0c5494381ebd6b0ad7c4028a4160 -
Trigger Event:
workflow_run
-
Statement type: