Skip to main content

Simple class to manage multiple Mysql Db with mysql-connector-python

Project description

WoopyMysqlAuth Class

Python GitHub Wppy.net

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 .env file 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:

  1. Using a dictionary containing the authentication credentials.
  2. Loading credentials from a .env file.

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

This version

0.1

Download files

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

Source Distribution

woopymysql-0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

woopyMysql-0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

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

Hashes for woopymysql-0.1.tar.gz
Algorithm Hash digest
SHA256 e023e5b933f95bdac075651dbc1f85609ed7a62fdf797d3709fdeb251cc18eb5
MD5 3452f200457001afdbafdac706129b6f
BLAKE2b-256 7a12938c67ba585553c8e52a3a8e4b9a70e4acc24f0528ec420c65de6af4bb0a

See more details on using hashes here.

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

Hashes for woopyMysql-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71c26a12098f66cbae80ebda49856fc162d254ca307b939f7af96a51c92f97d5
MD5 5ebf5b33f6b0ae5ad9ac395314ef83b0
BLAKE2b-256 1a5965111eebb5a271e4c6ff61ab8043c008f0a620a5cfcb91a90cdb55653383

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