Skip to main content

A lazy MySQL client for Python that simplifies database operations with intuitive methods for CRUD operations, automatic connection management, and result formatting. Features include easy-to-use SELECT, INSERT, UPDATE, DELETE operations with pandas DataFrame support, where clause builders, and table export capabilities.

Project description

lazy_mysql

A lightweight Python library for simplified MySQL database operations.

Features

  • Unified SQL execution interface
  • Export table structure to Markdown format
  • Query result formatting
  • Simplified insert, update, and select operations
  • Transaction support

Install / upgrade

pip install --upgrade lazy-mysql

Quick Start

from lazy_mysql.executor import SQLExecutor

# Initialize connection
config = {
    'host': 'your_mysql_host',
    'user': 'your_username',
    'password': 'your_password',
    'database': 'your_database'
}

executor = SQLExecutor(config)

# Query example
result = executor.select('your_table', ['column1', 'column2'])
print(result)

# Insert example
executor.insert('your_table', {'column1': 'value1', 'column2': 'value2'}, commit=True)

Requirements

  • mysql-connector-python>=9.4.0
  • pandas>=2.3.1

Note: Compatibility with versions below these requirements has not been verified.

PyPI

Project available on PyPI: https://pypi.org/project/lazy-mysql/

License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

lazy_mysql-0.3.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazy_mysql-0.3.0-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file lazy_mysql-0.3.0.tar.gz.

File metadata

  • Download URL: lazy_mysql-0.3.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for lazy_mysql-0.3.0.tar.gz
Algorithm Hash digest
SHA256 77f5bcb45fbb366c604716024248d975a8655825be1c6d05d36e685cbe1b2059
MD5 8acdca03dde0b2294a7c7b4d98cec99f
BLAKE2b-256 56652e7621185da4ddd1288c7fce954aee90f268e0eb19e887e57f61a49442f6

See more details on using hashes here.

File details

Details for the file lazy_mysql-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: lazy_mysql-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for lazy_mysql-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47da914cc170fc6cb6ef3e8155d07a217976cb6af7f65a12f5acffae363995f0
MD5 e77a6ddc7e103c52fc9563f057bd469a
BLAKE2b-256 0517d4da6f9731029601d55496f5305c7b792aeb576242b5810f5bf7701455d8

See more details on using hashes here.

Supported by

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