MySQLPandas: simple connector between MySQL(MariaDB) and Pandas
Project description
MySQLPandas
Overview
Simple connector between MySQL(MariaDB) and Pandas
Description
This tool is primarily intended to help Python users easily handle databases. It uses Pandas as its base, so it should be easy to use even for those who are not familiar with databases. The tool supports MySQL or MariaDB as the database engine.
Demo
- Make new table and install dataframe or csv
from MySQLPandas.core import MySQLPandas
with MySQLPandas("hoge","hoge_db",initfile_path="hoge.ini") as obj:
obj.makeTable("sample_table",df_path="sample.csv")
obj.showTableinfo("sample_table")
obj.insertRecord("sample_table",df_path="sample.csv")
Regarding other functions, see here.
Note
In MySQLPandas function of insertRecord, it doesn't allow any difference on table denfinition.(If it has slightly differcence, MySQLPandas raise error.)
raise PandasMySQLError("Not match Table frame")
MySQLPandas.lib.ErrorClass.PandasMySQLError: Not match Table frame
If you want to change table definition, please see below.
- Change string type column
You can change table denfiniton automatically. Please rewrite "Strict_Mode = False" in "insertRecord" method. - Change int or float type column
Sorry, you can't change it in MySQLPandas. Please rewrite it by using "executeSQLcommand" method.
0.0.19 ~
- Columns are no longer automatically assigned an underscore instead of a space when the database is created. However, it is recommended to replace them with underbars as much as possible, since spaces may cause unintended behavior.
Setup password.ini
In default, you need to input DB password in your console every time.
If you felt bothered, you avoid this by creating "password.ini" file.
In GitHub page, it's put sample file.
Requirement
- MySQL(MariaDB)
The version of Auther's MariaDB is 5.5.68-MariaDB MariaDB Server.
Don't try the newest version so please check your MariaDB version. - Pandas <= 1.5.3
- Python 3.*
- mysql-connector-python <= 8.0.29
- tqdm <= 4.65.0
Developer Guide
See here.
Install
Install through pip.
pip install MySQLPandas
Licence
Author
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
File details
Details for the file MySQLPandas-0.0.19.tar.gz
.
File metadata
- Download URL: MySQLPandas-0.0.19.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21a47369228aa33f7c424bde8137a9f9c6fcd26a1dba95e498814813579d6f16 |
|
MD5 | a4ddb40210b35413f5b132bb3b1985d7 |
|
BLAKE2b-256 | 2a6fca3e11623c0f63337892acb901b2d1a9a6b63a632486f1348da4af1cef00 |
File details
Details for the file MySQLPandas-0.0.19-py3-none-any.whl
.
File metadata
- Download URL: MySQLPandas-0.0.19-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6ce22f813e12ccc343397b0a18313b5ff1d657879a92653f5f2a912e7c34208 |
|
MD5 | abe1c8f5f489094f958f7ad8a2d2d495 |
|
BLAKE2b-256 | ee641c4889fe1d3b5dfc927e9007cf3e811edd491f0bce616dec3b0d90b1a3b4 |