Skip to main content

Easy way to handle database

Project description

简介

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

依赖性

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

安装

通过 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.4-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

light_database-0.1.4-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

light_database-0.1.4-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.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for light_database-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 94e96deee9d607abb1df3ba0ab0977554a48782efb8635c06175f3c6b98e1ab2
MD5 15ec9e95da986b1b8dc181559930b661
BLAKE2b-256 6800a04fe0419b350fb6e24d4c0188566069d8282ab21b4c5275e724420d03a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.4-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9d60f099952aa1bb415ab08d9945b6266f20c4b38476baa6cfac01a09956bf17
MD5 bb5eab6603e5f6d7d0ae8e1630d0fd5c
BLAKE2b-256 fbd49d58e24d76b5812bf4c82dca83258e2645b9088824bad9dfbd4dd9706566

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a0ac48728352764e885ef03b5eda8c9f2d3d2469fe509fa75ade9865d52861b
MD5 33cde1b7730c6945fdc7c8371fee29a4
BLAKE2b-256 1fe72ff75cd9b68ff2b63a14e376643e597916668b91271cd5f0eb7110048a29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 512b2428d565ab8696d7ece75040ca412ac8f3b6dcefd1dc9a1ec01016849763
MD5 393d79c82e4c63de46b298253b431b93
BLAKE2b-256 75aa29f7a2c196a4c97d93e9bddf99b24657ecc235c7c17ac9371abc7bc58745

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for light_database-0.1.4-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3ee5f46e64f5e7b5a5b9cb95646bbd635234ce407582e31d815755aaba6039dc
MD5 ae265dd6e28f12088a1d8a78ed8e692a
BLAKE2b-256 a6de432896814a4305940c7092a3b4d437d0f93f45d4e6fd128f3bfd0d52526b

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