Skip to main content

Easy way to handle database

Project description

简介

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

依赖性

  • thrift
  • rich
  • pandas
  • impyla
  • mysqlclient
  • DBUtils
  • portalocker
  • cryptography

安装

通过 pip 安装:

conda install -c conda-forge mysqlclient
pip install pandas rich portalocker -i https://mirrors.aliyun.com/pypi/simple/
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、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.5-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

light_database-0.1.5-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.5-cp311-cp311-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for light_database-0.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bb4216f67830460d3f99f9f8d12f05980dd029153f7fb70653070e56a4a297df
MD5 f7a7fef30459614992cba42be89a38cd
BLAKE2b-256 174d8030dee7f1ca29656a256e779d375eedb4b2c53ac95a326280219951ac39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.5-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9876e25f81170ee9f285b0e7412f439e44b3c718ccc80de8395248250cbf93b6
MD5 a5b04e43eff9e480306e8859753f7a27
BLAKE2b-256 0608e291f71ee4f52ffd36138eeaeebf7113cf063ed5b6a16e44e2c43c1b0f67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3560e4e0d8c979e61f47638bddea262be273b5881db4ab69dc9c73fff085a4bb
MD5 54a1e7956e0d000d38203754c33f4c09
BLAKE2b-256 0cd3c00411c1e34c2192b0a906f82c238dff6d6b4cf43b0289507a3f886e10ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8f44e80b65ada98c11aab7100c227a81be00d0b7b4f69e55dd094b7714029605
MD5 51bed189de287e25133b19f987122d26
BLAKE2b-256 df51fe6f4044367287a752cdac503d2fe52b57d7acbb4bbfbcf843f4c11712ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.5-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0ea8812e6ca26eccfc0403252975d43ab5eb3e3623a0179fcafec4e462b59365
MD5 aa50f847d85a2f0ffb99a54cc01366b7
BLAKE2b-256 28a9487727db21b60fb64c69ee9d5611f870cbe2fefc67b0f8c2d9da4dca5394

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