Skip to main content

fardb

fardb 是一个轻量的数据库访问工具库,基于 SQLAlchemy 封装了常用的表 CRUD / upsert 操作, 并附带一个 extendsclass.com JSON Storage 的简易客户端。

安装

⚠️ PyPI 上的 fundb 这个名字已被无关第三方项目占用(Madhava-mng/FunDB), 本仓库已更名为 fardb。

pip install fardb

快速上手

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 是一个专注于实用工具库的开源组织, 涵盖云存储、数据处理、AI、多媒体与开发工具链等方向。

本项目基于 MIT 协议开源。

Metadata

Release files for fardb 1.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for fardb 1.4.3
File Interpreter ABI Platform
fardb-1.4.3-py3-none-any.whl Python 3 none any Details

Release files / fardb-1.4.3-py3-none-any.whl

Download URL fardb-1.4.3-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b918604db0c0a069af3f591780392ff5c3ee30d57c782a3c0d97e375eb4c16e
BLAKE2b-256 checksum
How to use checksums
42802fe8791127f9afe14aa8bcc8c0ae25ed38eb7306702115020f8e0ff8e25d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

1.4.4

1 release file

This release

1.4.3 This release

1 release file

1.4.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page