Metadata-Version: 2.1
Name: geothai
Version: 0.1.0
Summary: An python package that allows to access detailed geographic data on Thailand, including provinces, districts, and subdistricts. 🌟
Author-email: GeoThai Team <yyupsk@proton.me>
License: MIT License
Project-URL: Homepage, https://github.com/GeoThai/python-library
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

# 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:

```bash
pip install geothai
```

## 📚 Usage

### Importing the Library

```python
from geothai import (
    get_all_provinces,
    get_province_by_id,
    get_provinces_by_criterion,
    get_all_districts,
    get_district_by_id,
    get_districts_by_criterion,
    get_all_subdistricts,
    get_subdistrict_by_id,
    get_subdistricts_by_criterion
)
```

### Retrieving All Provinces

```python
provinces = get_all_provinces()
print(provinces)
```

### Getting a Province by ID

```python
province = get_province_by_id(10)  # Replace 10 with the desired province_id
print(province)
```

### Filtering Provinces by Criteria

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

### Similarly, You Can Access Districts and Subdistricts

```python
districts = get_all_districts()
subdistricts = get_all_subdistricts()
```

## 📂 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/utils/`**: Includes utility functions like criteria matching for filtering data.

## 🛠 Development

To contribute to the development of this library:

1. Clone the repository:

```bash
git clone https://github.com/GeoThai/python-library.git
```

2. Install the required dependencies:

```bash
pip install -r requirements.txt
```

3. Run the tests:

```bash
pytest
```

## 🤝 Contributing

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

## 📄 License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## 🙋‍♂️ Contact

If you have any questions, issues, or suggestions, feel free to reach out at [pyyupsk@proton.me](mailto:pyyupsk@proton.me).
