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、PostgreSQL、StarRocks、Hive、HBase)
  • 简洁的 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.10-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

light_database-0.1.10-cp311-cp311-manylinux_2_17_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

light_database-0.1.10-cp311-cp311-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 Windows x86-64

light_database-0.1.10-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.10-cp310-cp310-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for light_database-0.1.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bfd9e56154ad11ca25bfc65d24149eb7afdfcfe8c92522292ffbced355f573ad
MD5 29f4d4608e0c27cbdc072f6e0c29ee83
BLAKE2b-256 b5925163a81d9231a224645553613f48d76b6416907a9249b38b0e47c4818688

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.10-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5d697b80100e9757fa9275d89245bbccd2916ec0bc397df04845a131b7eab3e1
MD5 faaa6fd8fce2226c479c42df1fa053af
BLAKE2b-256 f778e1ed16260ad0975699bc1bdef4214acb915a91b7bb500aee607c1c70ebc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f713e4bd0ad03e1f7647a0907701114c604ea695f4eed8c89d48beaf02c780fb
MD5 62ed300e1f2968bcb318f330e9963773
BLAKE2b-256 6eed046938c4e028f9e6da1beb2ed9f6b8fea8401ce1b88efbaaca447ec4c7e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 da0ab8c10a9e5f6850833404c5af26ac193649ff4d834cb3c61d090d2d09c5f0
MD5 87d91bbb927d7958fe4c239bc85111a7
BLAKE2b-256 7889e7b4d78cc4d0947d769ce80d0b92df499970caa60cc2ff4eeeb0726389bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.10-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 db3cde725442729220049cc4fc4198a9546a758cf7ccd043936337a87a851d01
MD5 a90d2331af689f17ac634e2c1b62ab19
BLAKE2b-256 cc9d3d0d7d70d14ab131e408699b9279d405da89088ab563522f3ba32d6d537c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.10-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a08a9a58ea4db9e4210d0aefaf62f7cc96c4bee14b55718bb1536a6c0e51681
MD5 87080a2dca99db1ad3cde20aac9757d9
BLAKE2b-256 9c4f7ca49fcd7a40fe2068cfd7d7a2d3791a612bf9641f4374cc1c388d9d7890

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