Skip to main content

A python package for connecting with sql database and performing essential operations.

Project description

# Usage Guide

## Installation of Load_MySQL Package You can install the load_MySQL package via pip:

`bash pip install load_MySQL `

## Importing the class MySQLOperation class from sql_connect.MySQL module:

`python from sql_connect.MySQL import MySQLOperation `

## Connecting to Database Create an instance of MySQLOperation class with your database credentials:

`python db = MySQLOperation(host="localhost", user="username", password="password", database="database name") db.connect() `

## SELECT Queries You can execute SQL queries using the execute_query() method of the MySQLOperation instance. Results are stored in a pandas DataFrame

`python query = "SELECT * FROM student" student_records_df = db.execute_query(query) `

### More Examples - Students Records that start with ‘A’ and have marks greater than 50

`python query2 = """ SELECT name, mark FROM student WHERE name LIKE 'A%' AND mark > 50; """ student_records_df = db.execute_query(query2) `

  • Students Highest Mark of only those classes with Highest Marks greater than 80

`python query3 = """ SELECT class, MAX(mark) AS max_mark FROM student GROUP BY class HAVING max_mark > 80; """ student_records_df = db.execute_query(query3) `

## More Information For more detailed examples and coverage of features, refer to the [load_MySQL Tutorial](https://github.com/Meetpanchal58/SQL_Connect/blob/main/experiments/load_MySQL%20Tutorial.ipynb) in the experiments/load_MySQL Tutorial directory

## Usage of All files

### requirements_dev.txt for testing It makes it easier to install and manage dependencies for development and testing, separate from the dependencies required for production.

### Difference between requirements_dev.txt and requirements.txt

requirements.txt is used to specify the dependencies required to run the production code of a Python project, while requirements_dev.txt is used to specify the dependencies required for development and testing purposes.

### tox.ini We use it for testing the Python package against different versions of Python.

### How tox works: tox environment creation 1. Install dependencies and packages 2. Run commands 3. It’s a combination of virtualenvwrapper and makefile 4. It creates a .tox directory

### pyproject.toml It is used for configuring the Python project. It’s an alternative to the setup.cfg file. It contains configuration related to the build system such as the build tool used, package name, version, author, license, and dependencies.

### setup.cfg In summary, setup.cfg is used by setuptools to configure the packaging and installation of a Python project.

### Testing python application Types of testing 1. Automated testing 2. Manual testing

Mode of testing 1. Unit testing 2. Integration tests

Testing frameworks 1. pytest 2. unittest 3. robotframework 4. selenium 5. behave 6. doctest

Check with the code style formatting and syntax (coding standard) 1. pylint 2. flake8 (it is best because it contains 3 libraries: pylint, pycodestyle, mccabe) 3. pycodestyle

Project details


Release history Release notifications | RSS feed

This version

2.0

Download files

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

Source Distribution

load_MySQL-2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

load_MySQL-2.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file load_MySQL-2.0.tar.gz.

File metadata

  • Download URL: load_MySQL-2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for load_MySQL-2.0.tar.gz
Algorithm Hash digest
SHA256 4a3d13ff6940d5b24468633d5a5e2ae5a44c2347258430f21c9b6a5ae212bc03
MD5 92efb006dc7fef99c84e44d3d94e566b
BLAKE2b-256 c573bab5bef626bbf023cc453ca8ba71504fe6160c6181c0c9fa8bdc37980764

See more details on using hashes here.

File details

Details for the file load_MySQL-2.0-py3-none-any.whl.

File metadata

  • Download URL: load_MySQL-2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for load_MySQL-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42f3999219531b51e98111d893398d3b6f9b9d0643a19a6bb5dabfe8c57900c1
MD5 b37af439277701aa7ae59026ebbd91c0
BLAKE2b-256 b5a1b38a1a00f7afab46ed7d4af408f9d3eddcd40c0a7bd74878e7b01e9d3d3b

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