Skip to main content

Easy way to handle database

Project description

简介

light-database 是一个用于简化数据库交互的 Python 包。它支持多种数据库系统,并提供一个易于使用的接口来执行查询和管理数据库。

安装

通过 pip 安装:

pip install light-database

快速开始

  1. 使用 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)
  1. 使用 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、StarRocks、Hive、HBase),PostgreSQL(未来计划中)
  • 简洁的 API
  • 连接池管理
  • 自动转换查询结果

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

light_database-0.1.6-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

light_database-0.1.6-cp311-cp311-manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

light_database-0.1.6-cp311-cp311-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

light_database-0.1.6-cp311-cp311-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

light_database-0.1.6-cp310-cp310-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.10 Windows x86-64

light_database-0.1.6-cp310-cp310-manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

light_database-0.1.6-cp310-cp310-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

light_database-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

Details for the file light_database-0.1.6-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5ba1b9cd8faf065aa4f7982bc8d40d2de725400c1003f188086390c4395dfc10
MD5 c32562976ffde6b8f6ab01a791d8621d
BLAKE2b-256 6041bb58b08c9609e85e314b63d799eb1e2186d3507f1689ed8d75ba08ce9d69

See more details on using hashes here.

File details

Details for the file light_database-0.1.6-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b1bb695595eaaf6c6bc1765f566fb9765526deb716802751ccb7905f154c9d2c
MD5 61cac7c31a76d27157de924597b5cb55
BLAKE2b-256 17f1e2c158e0890e03f6ea4619e35d1942a72af1b698352d022628eed85097ac

See more details on using hashes here.

File details

Details for the file light_database-0.1.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf53d313aaba50cdf39d0213616bf8ba07da553015f8330bf6a9d0707ed450f0
MD5 3ed6563944bc0e4a6e1230fa92e8fa8c
BLAKE2b-256 fc6ee6ad673fe8ed140f653408d8fa70289c292920d46ba66c52827e66408d00

See more details on using hashes here.

File details

Details for the file light_database-0.1.6-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 33386258e6c16a3713a7762560e845124fa565c3b98ae52163b2a813f336506b
MD5 d158f018eef1b19bf64a193fdada8044
BLAKE2b-256 b956c198450448d9f149cee8c71f6ff22e8f20ea929a830c9f8586695e0a3530

See more details on using hashes here.

File details

Details for the file light_database-0.1.6-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dffd8b99376ea709f333b7e2ff28e6b06b5cd73047209b488a528a459740719c
MD5 ce3dc86e9ed07782592f2815d4ba6159
BLAKE2b-256 5156a253a73b42f9067fd30630597b3902dc83046ed613d632674a0360f7b5ce

See more details on using hashes here.

File details

Details for the file light_database-0.1.6-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bf5abc29ae70aae82811fec846c58a6ec61268e0e7f48a0b672a81ceccb691fc
MD5 9af5f49257786ad237aa879839a150a5
BLAKE2b-256 fb1850d8090787e38dc6879a2ef1d6c9dff215a7bbae5f378547d6d0a487a07d

See more details on using hashes here.

File details

Details for the file light_database-0.1.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7724311d34fbb4d1ae007390ffb8b1936068312ca26778439c7109a8dab519e6
MD5 72ba14670b7c283c971a8ce066d73c10
BLAKE2b-256 5ac7af9e9f502d3925b0d5bb3e94cc0fbe897e7a3629d992d4da2a795e902bc1

See more details on using hashes here.

File details

Details for the file light_database-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for light_database-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9fd44a22fd3ac379283bcd804c8c10e61a75aed8043a39c1ea432735acb0118e
MD5 552c589a1ecbe438e715af9495180a02
BLAKE2b-256 cc5a928ff92088277fc62ba851efb77ecc495222dc9810040565b6505dac0d0e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page