Skip to main content

A lightweight Python package that helps you connect to a MySQL database with a single line of code

Project description

connnect_db 🔌

A lightweight Python package that helps you connect to a MySQL database with a single line of code.

No more boilerplate code — just call connect() and you're good to go!


🚀 Features

  • 🔄 One-line MySQL connection
  • 🔐 Supports host, user, password, database inputs
  • ⚠️ Basic error handling
  • 📦 Simple to use and integrate into any project

📦 Installation

You’ll need mysql-connector-python. Install it first:

pip install mysql-connector-python

Then install this package:

pip install connect-db

💻 Usage

from connect-mydb import connect

try:
    db = connect('localhost', 'root', 'password', 'database_name')
    
    if db:
        cursor = db.cursor()
        cursor.execute("SHOW TABLES")
        for row in cursor.fetchall():
            print(row)

        cursor.close()
        db.close()

except Exception as e:
    print(f"❌ Error: {e}")

🙌 Author

Developed by Mohamed Khasim

Made with ❤️ for developers who hate repeating themselves.

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

connect_mydb-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

connect_mydb-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file connect_mydb-0.1.0.tar.gz.

File metadata

  • Download URL: connect_mydb-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for connect_mydb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d1cc162cfc95bf6addf03d922b911f473b2b7cacafde3b299c5e9ca997d8b92b
MD5 b833812707e20e0e5262e12f60188531
BLAKE2b-256 6084e5ac268645d8ffdc212c44f69fa79d79f8a2df0ffece75719f5bf7087a66

See more details on using hashes here.

File details

Details for the file connect_mydb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: connect_mydb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for connect_mydb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b3ca5f1dd5358cd1286d41cbe8587134b7341425ed398e203da6e060cad4de3
MD5 a2b9753c985fb73a95b4211235edae91
BLAKE2b-256 577a3da207caff5f5dce035ed303a582cccef8c1a48e2aac854ce4632ca904b1

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