Metadata-Version: 2.4
Name: dm-pure
Version: 1.3.3
Summary: 纯 Python 实现的达梦 DM8 数据库驱动（无 native 依赖）
Author-email: zhangtao <zhangtao103239@163.com>
License: MIT
Project-URL: Homepage, https://github.com/zhangtao103239/dm8_python_pure
Project-URL: Repository, https://github.com/zhangtao103239/dm8_python_pure
Project-URL: Documentation, https://github.com/zhangtao103239/dm8_python_pure#readme
Project-URL: Bug Tracker, https://github.com/zhangtao103239/dm8_python_pure/issues
Keywords: dameng,dm8,database,driver,纯Python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Topic :: Database
Classifier: Topic :: Database :: Front-Ends
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# dm-pure：纯 Python 达梦 DM8 数据库驱动

[![PyPI version](https://img.shields.io/pypi/v/dm-pure)](https://pypi.org/project/dm-pure/)
[![PyPI - Python](https://img.shields.io/pypi/pyversions/dm-pure)](https://pypi.org/project/dm-pure/)
[![License](https://img.shields.io/github/license/zhangtao103239/dm8_python_pure)](LICENSE)

零 native 依赖、100% Python 实现的达梦 DM8 数据库驱动，适合无编译环境的机器。
源码版 wheel（`py3-none-any`），任何 Python 3.8+ 通用。

## 功能

参数化查询（含 NULL）/ 中文（自动检测服务器编码）/ 大结果集分批 fetch / CLOB·BLOB / 事务 / 存储过程 /
批量插入 executemany / 连接池 / DB-API 2.0 兼容层。

## 安装

```bash
pip install dm-pure
```

零依赖：加密（DES/AES/RC4）内置纯 Python 实现；若安装 pycryptodome 会自动优先使用（性能更优）。

## 快速上手

```python
from dmpy import DMClient

c = DMClient("127.0.0.1", 5236, "SYSDBA", "password")   # 自动检测服务器字符集
c.connect()
c.execute("SELECT id, name FROM t WHERE id = ?", [1])     # → (cols, rows)
c.execute("INSERT INTO t VALUES (?, ?)", [1, "x"])        # → (None, 影响行数)
c.close()
```

### DB-API 2.0（sqlite3/pymysql 风格）

```python
import dmpy.dbapi as dm

conn = dm.connect(host="127.0.0.1", port=5236, user="SYSDBA", password="...")
cur = conn.cursor()
cur.execute("SELECT id, name FROM t WHERE id >= ?", [1])
print(cur.fetchall())
conn.close()
```

> **SQLAlchemy 集成**：请使用 [dmPython-pure](https://pypi.org/project/dmPython-pure/)（shim 兼容层），
> 它内置 SQLAlchemy 方言 `sqlalchemy.dialects:dm`，可直接 `create_engine("dm://...")`。
> 本包（dm-pure）保持纯核心驱动，不捆绑 API 适配层。

## 环境要求

- Python >= 3.8
- 可达的达梦 DM8 服务器（TCP 5236 端口）

## 开源协议

[MIT](LICENSE)。源码：https://github.com/zhangtao103239/dm8_python_pure
