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 contact@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
File details
Details for the file geothai-2.0.0.tar.gz
.
File metadata
- Download URL: geothai-2.0.0.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
42035a2dd5c79964e36501ed1c42a22456f419204882836c62ff4a5b90970331
|
|
MD5 |
e5f65f61be26a8ec92dce2ce86d3a0ee
|
|
BLAKE2b-256 |
0f97e8d7326b53e32d4bf8f84ba0bffea8a3498db33eca9e0bcb7daca7e25330
|
File details
Details for the file geothai-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: geothai-2.0.0-py3-none-any.whl
- Upload date:
- Size: 35.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0572720de21f7fd1c0b9fc3060b97a77e55510138e6d175b0cf285a6174478cd
|
|
MD5 |
1dccec9abaa42dd40b92d36814aac718
|
|
BLAKE2b-256 |
dfeacb8e0070f38327ee3d3535dfbcb6c3de63ba1334ab72695e0387610671f7
|