Skip to main content

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

  1. Install dependencies and packages
  2. Run commands
  3. Its a combination of the (virtualenvwrapper and makefile)
  4. 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

  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 containt 3 library pylint pycodestyle mccabe)
  3. 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(
    records= [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

mysql_crud_automation-0.0.10.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

mysql_crud_automation-0.0.10-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file mysql_crud_automation-0.0.10.tar.gz.

File metadata

File hashes

Hashes for mysql_crud_automation-0.0.10.tar.gz
Algorithm Hash digest
SHA256 cabe002ec86090d2d1d8153c846443a9078c5eb84e608477a85febf69f9f2e4d
MD5 d7a7672e68667873af2422fcdd2192b7
BLAKE2b-256 5e0e2fca88c1dc27a1b1f94a0f8760c5d25aeef0013cf1abfa14be0a8b062864

See more details on using hashes here.

File details

Details for the file mysql_crud_automation-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for mysql_crud_automation-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c2be6dacb2b2c07846a578e2647fba55fdb3df1d77a6356fc67c60c91ad3e337
MD5 2ca9cf2a90e072d548439c2a99e7a9cf
BLAKE2b-256 c877aa81d2696a891d170180dcf9ed6a807b9b4245c4b25715ae5a67f70d0e33

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