Easy way to handle database
Project description
简介
light-database 是一个用于简化数据库交互的 Python 包。它支持多种数据库系统,并提供一个易于使用的接口来执行查询和管理数据库。
安装
通过 pip 安装:
pip install light-database
快速开始
- 使用 light-database 包初始化项目环境:
from light_database.config import EnvConfig
EnvConfig.write(section="mysql", host=host, port=port, database=database, user=user, password=password)
# EnvConfig.write(section="hive", host=host, port=port, user=user, password=password, auth_mechanism="PLAIN")
# EnvConfig.write(section="hbase", host=host, port=port)
- 使用 light-database 包执行查询:
from light_database.mysql.db import MysqlDB
df1 = MysqlDB.filter(table) \
.select(column1, column2) \
.where(column3__in=[1, 2], column4=1).df()
df2 = MysqlDB.filter(table) \
.select(column1, column2) \
.where(column3__lt=1, column4__ne=1).df[1:2]
功能
- 支持多种数据库系统(如 MySQL、PostgreSQL、StarRocks、Hive、HBase)
- 简洁的 API
- 连接池管理
- 自动转换查询结果
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file light_database-0.1.8-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0081ad121cea3ac70dbc2601f1f63162d807a46d64ccc6a5b6354e5d0208a6ec |
|
MD5 | ea4addc2a978a5533b2b488af4afa2a2 |
|
BLAKE2b-256 | 957f800de42ec9323bec0a228df47147d770bce0645001d1a31a4b59955e8c5c |
File details
Details for the file light_database-0.1.8-cp311-cp311-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp311-cp311-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b5db4339fb69cd8cf69990956d4640795a79c50a95b4bc18d66fc34932f5e8c |
|
MD5 | c24e722f7e9a5843654e6bd396783a81 |
|
BLAKE2b-256 | a2c212020e935bc6a78140914ef124cb17c403b574fdf71618a133d904e6a946 |
File details
Details for the file light_database-0.1.8-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a2b3a291754bed3a7028cedbb9ea4301f4e6ed59f1a1568d6d5db45dc6db8e3 |
|
MD5 | c592eb7d6b6640480f7e647b7272e838 |
|
BLAKE2b-256 | d208ab4428eb433d4d0798609f6daf0c58078c0ea8be2acf306aac443f8ec800 |
File details
Details for the file light_database-0.1.8-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cba1c5d9ab4c258c52354ec25c5cbe06e55a4af699c015196ad7f78c8a2610b |
|
MD5 | 766cacb6e8dc8ace059aa81543110403 |
|
BLAKE2b-256 | 141f0f7b54053249fe2ca24bc1e5e5bd2ad45b186dc12d9bc357cfac4f362026 |
File details
Details for the file light_database-0.1.8-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d8d7248b9516e09d4f68a97a9609812da7569fcb6f2c1ae1d0860128950c3d6 |
|
MD5 | f83cee3755f7d1ac362932bea8111334 |
|
BLAKE2b-256 | 74ad56f0160f98eddeafe22187346d1fcb9fce2c22f478baa4c472115988814f |
File details
Details for the file light_database-0.1.8-cp310-cp310-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp310-cp310-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48913bb18d5a6b6b5c40216ec07093ffabd0505d197ce7d79786986c6b360606 |
|
MD5 | 8f5b9165950bca2b729c0e3cb9777872 |
|
BLAKE2b-256 | 04c2d175d3bbfd095101bc9ab7dd16b1bf5bf7b6b2a09baf1001faa020f3df85 |
File details
Details for the file light_database-0.1.8-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2474d53940b7213f3717f9a784fc28be4faa13313c55637123c2faf62bf19815 |
|
MD5 | 554e9fce373965c355fb22565f1b7bb2 |
|
BLAKE2b-256 | 9f1cdbeb8e25bb760031f1a2bc110c114904442373133f1833dac1f7579b53b3 |
File details
Details for the file light_database-0.1.8-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: light_database-0.1.8-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e219457095b7d34bbbde18f1c95a63a0ff1bc88babef9e46468cbd0298e007e3 |
|
MD5 | 616fb6f6713446c9ba9b797840603f2d |
|
BLAKE2b-256 | d23671344f72dc56b4d0906db37eaed2fa51a38c61262be65a2aab050e53e952 |