A lightweight Python package that helps you connect to a MySQL database with a single line of code
Project description
connnect_mydb 🔌
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-mydb
💻 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file connect_mydb-0.1.1.tar.gz.
File metadata
- Download URL: connect_mydb-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c59903a5641378424eb0d6783463cfe5a6a6012b60c96552a4f688217a50ae
|
|
| MD5 |
6efffda27edcd9e5ab0fb0fb8fa6a734
|
|
| BLAKE2b-256 |
94c4d7fbdb600c2ed7962143ba291e8b643bcca981f21e2a4ed9eb3d89beefc4
|
File details
Details for the file connect_mydb-0.1.1-py3-none-any.whl.
File metadata
- Download URL: connect_mydb-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df5190444e66cc451e601f115ceccda5e7fdac82db11eb7dfb4ffe12901e58a4
|
|
| MD5 |
d8718944405a35f63b0a34767a25b67e
|
|
| BLAKE2b-256 |
98ba7b7ef0ef777023be24818769c50f98f010f1b849aa0d475712b7bd398136
|