Metadata-Version: 2.4
Name: pymysql-dist
Version: 0.1.1
Summary: Unofficial helper utilities for PyMySQL-based applications.
Author: Levandr
License-Expression: MIT
Project-URL: Homepage, https://github.com/Leevandr/pymysql-dist
Project-URL: Repository, https://github.com/Leevandr/pymysql-dist
Project-URL: Issues, https://github.com/Leevandr/pymysql-dist/issues
Keywords: pymysql,mysql,sql,database,helpers
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyMySQL>=1.1.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# pymysql-dist

`pymysql-dist` is an unofficial support library for applications that use
[PyMySQL](https://pypi.org/project/PyMySQL/).

It provides small, readable helpers for connection settings, safe SQL snippets,
basic CRUD operations, pagination, row normalization, and SQL script loading.
The package is intentionally simple, so it can be used as a reference while
building desktop or educational database applications.

This project is not affiliated with the PyMySQL project.

## Installation

```bash
pip install pymysql-dist
```

## Quick Example

```python
from pymysql_dist import DatabaseConfig, connection, TableGateway

config = DatabaseConfig(
    host="localhost",
    user="root",
    password="",
    database="shop",
)

with connection(config) as conn:
    products = TableGateway(conn, "products")
    rows = products.all(order_by="id")
```

## Environment Configuration

```python
from pymysql_dist import DatabaseConfig

config = DatabaseConfig.from_env()
```

Default environment variables:

- `MYSQL_HOST`
- `MYSQL_PORT`
- `MYSQL_USER`
- `MYSQL_PASSWORD`
- `MYSQL_DATABASE`
- `MYSQL_CHARSET`

## Modules

- `pymysql_dist.config` - database configuration.
- `pymysql_dist.connection` - connection helpers.
- `pymysql_dist.crud` - small table gateway.
- `pymysql_dist.sql` - SQL builders, filters, and sorting helpers.
- `pymysql_dist.schema` - SQL file loading and script execution.
- `pymysql_dist.rows` - row conversion helpers.
- `pymysql_dist.pagination` - pagination data structures.
- `pymysql_dist.qt` - lightweight table data adapters.

