Simple class to manage multiple Mysql Db with mysql-connector-python
Project description
WoopyMysqlAuth Class
Overview
The WoopyMysqlAuth class is designed to manage and validate the authentication credentials needed to connect to a MySQL database. It supports loading credentials from an environment file or directly from a dictionary. The class ensures that all required credentials are provided and valid before establishing a database connection.
Features
- Load database credentials from a
.envfile or a provided dictionary. - Validate the presence of all necessary credentials.
- Establish a connection to the MySQL database.
Usage
Initialization
The class can be initialized in two ways:
- Using a dictionary containing the authentication credentials.
- Loading credentials from a
.envfile.
Example 1: Initializing with a Dictionary
WoopyAuth = {
"woopy_db_host_ip": "127.0.0.1",
"woopy_db_name": "example_db",
"woopy_db_user_name": "root",
"woopy_db_user_password": "password",
"woopy_db_table_prefix": "wp_"
}
auth = WoopyMysqlAuth(WoopyAuth=WoopyAuth)
Example 2: Initializing with an Environment File
auth = WoopyMysqlAuth(WoopyEnv='.env')
Websites using 'woopy' library:
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 woopymysql-0.1.tar.gz.
File metadata
- Download URL: woopymysql-0.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e023e5b933f95bdac075651dbc1f85609ed7a62fdf797d3709fdeb251cc18eb5
|
|
| MD5 |
3452f200457001afdbafdac706129b6f
|
|
| BLAKE2b-256 |
7a12938c67ba585553c8e52a3a8e4b9a70e4acc24f0528ec420c65de6af4bb0a
|
File details
Details for the file woopyMysql-0.1-py3-none-any.whl.
File metadata
- Download URL: woopyMysql-0.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71c26a12098f66cbae80ebda49856fc162d254ca307b939f7af96a51c92f97d5
|
|
| MD5 |
5ebf5b33f6b0ae5ad9ac395314ef83b0
|
|
| BLAKE2b-256 |
1a5965111eebb5a271e4c6ff61ab8043c008f0a620a5cfcb91a90cdb55653383
|