Metadata-Version: 2.5
Name: fardb
Version: 1.4.3
Summary: fardb
Project-URL: Organization, https://github.com/farfarfun
Project-URL: Repository, https://github.com/farfarfun/fardb
Project-URL: Releases, https://github.com/farfarfun/fardb/releases
Author-email: 牛哥 <niuliangtao@qq.com>, farfarfun <farfarfun@qq.com>
Maintainer-email: 牛哥 <niuliangtao@qq.com>, farfarfun <farfarfun@qq.com>
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: farcache>=2.0.3
Requires-Dist: farlog>=1.1.7
Requires-Dist: funutil>=1.0.19
Requires-Dist: pandas>=2.0.0
Requires-Dist: requests>=2.28.0
Requires-Dist: sqlalchemy>=2.0.36
Description-Content-Type: text/markdown

# fardb

`fardb` 是一个轻量的数据库访问工具库，基于 SQLAlchemy 封装了常用的表 CRUD / upsert 操作，
并附带一个 [extendsclass.com JSON Storage](https://extendsclass.com/json-storage.html) 的简易客户端。

## 安装

> ⚠️ PyPI 上的 `fundb` 这个名字已被无关第三方项目占用（[Madhava-mng/FunDB](https://github.com/Madhava-mng/FunDB)），
> 本仓库已更名为 `fardb`。

```bash
pip install fardb
```

## 快速上手

```python
from sqlalchemy import BIGINT, String
from sqlalchemy.orm import mapped_column

from fardb.sqlalchemy import Base, BaseTable, create_engine_sqlite


class UserTable(Base):
    __tablename__ = "user"
    id = mapped_column(BIGINT, primary_key=True)
    name = mapped_column(String(64))


engine = create_engine_sqlite(":memory:")
table = BaseTable(engine, table=UserTable)

table.insert({"id": 1, "name": "alice"})
df = table.select_all()
print(df)
```

## 关于 farfarfun

[farfarfun](https://github.com/farfarfun) 是一个专注于实用工具库的开源组织，
涵盖云存储、数据处理、AI、多媒体与开发工具链等方向。

- 🏠 组织主页：<https://github.com/farfarfun>
- 📦 PyPI：<https://pypi.org/user/niuliangtao/>
- 📧 联系：farfarfun@qq.com

本项目基于 [MIT](LICENSE) 协议开源。
