A python package for connecting with database.
Project description
requirements_dev.txt for the 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 if for the testing in the python package testing against different version of the python
how tox works tox enviornment creation
- Install dependencies and packages
- Run commands
- Its a combination of the (virtualenvwrapper and makefile)
- It creates a .tox
pyproject.toml
it is being used for configuration the python project it is a alternative of the setup.cfg file. its 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 setup tools to configure the packaging and installation of a Python project
Testing python application
types of testing
- Automated testing
- Manual testing
Mode of testing
- Unit testing
- Integration tests
Testing frameworks
- pytest
- unittest
- robotframework
- selenium
- behave
- doctest
check with the code style formatting and syntax(coding standard)
- pylint
- flake8(it is best because it containt 3 library pylint pycodestyle mccabe)
- pycodestyle
How to use the package :-
Installation :-
pip install mysql-crud-automation
Usage :-
from mysql_connect import mysql_crud
mysql_connector = mysql_crud.mysql_operation(
host="hostname",
user="username",
password="password"
)
CRUD Operation on MySQL :-
1. create connection
mysql_connector.create_connection()
2. create database
mysql_connector.create_database(database_name ="<database_name>")
3. create table
create_table_sql = """
CREATE TABLE <table_name> (
name VARCHAR(100) NOT NULL,
age VARCHAR(100) NOT NULL
);"""
mysql_connector.create_table(create_table_sql,database_name)
4. insert record
mysql_connector.insert_single_record(
record=record:dict,
table_name="<table_name>",
database_name='<database_name>'
)
5. insert multiple record
mysql_connector.insert_multiple_records(
record= [record:dict],
table_name= "<table_name>",
database_name= '<database_name>'
)
6. bulk insert record
- in this datafile is in .csv or .xlsx file
mysql_connector.bulk_insert(
datafile="<file_path>",
table_name="<table_name>",
database_name='<database_name>',
unique_field=<'column_name'>
)
7. find query
mysql_connector.find(
query:dict = {},
table_name="<table_name>",
database_name='<database_name>'
)
8. find all query in the table
mysql_connector.find(
table_name="<table_name>",
database_name='<database_name>'
)
8. update query
mysql_connector.update(
query: dict={},
new_values: dict={},
table_name="<table_name>",
database_name='<database_name>'
)
9. delete query
mysql_connector.delete(
query: dict={},
table_name="<table_name>",
database_name='<database_name>'
)
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
Built Distribution
File details
Details for the file mysql_crud_automation-0.0.9.tar.gz
.
File metadata
- Download URL: mysql_crud_automation-0.0.9.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a04ddb52840d2716ed148d00cd4c82a29218437d91c2e0dc578c563f2bb766f9 |
|
MD5 | 7cc69b47218d639d1aaa3becbd19f565 |
|
BLAKE2b-256 | e30ce30c53b2028ae0a1ff1f2221f845bb2f57ad373bf458b3feb8345759e9e9 |
File details
Details for the file mysql_crud_automation-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: mysql_crud_automation-0.0.9-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71d4ce7cf0df071fed52d545a340df33ff28bc6e12a38479a7281b0885c66c05 |
|
MD5 | 96a2a85c8da547b48b98261f756aed49 |
|
BLAKE2b-256 | ee5ee396e2d8b9c54f1adac6979ceef97358d20dab589934b89b8c0c430cc82f |