Test version - Dataframe to Script SQLSERVER, MYSQL, Postgresql, oracle e sqlite. This project created to Francisco Fabio de A. Ferreira, Systems Analyst, Data Scientist. This package. E-mail:franciscofabio18@hotmail.com.
Project description
Project: Package to Convert Dataframes to SQL Server, MYSQL, PostgreSQL, Oracle e SQLite Script
Project Author: Francisco Fadio
(click here to see my profile on the platform)
Technology: Python | SQL
Date: 22/01/2023
Description
The "df_to_sqlserver" package is used for:
- "Convert" module:
- has the function converter_df_in_sql that with os.mkdir('SCRIPTS')
- the function receives 3 variables as a parameter:
- df -> dataframe name.
- tb_name -> name of the sql database table.
- name_script -> file name
- creates the output folder for sql scripts
- Through for adds '' in columns of type object 'categories'
The "df_to_mysql" package is used for:
- "Convert" module:
- has the function converter_df_in_mysql that with os.mkdir('SCRIPTS')
- the function receives 4 variables as a parameter:
- df -> dataframe name.
- db_name -> mysql database name.
- tb_name -> name of the sql database table.
- name_script -> file name
- creates the output folder for mysqlsql scripts
- Through for adds '' in columns of type object 'categories
The "df_to_postgresql" package is used for:
- "Convert" module:
- has the function converter_df_in_postgresql that with os.mkdir('SCRIPTS')
- the function receives 4 variables as a parameter:
- df -> dataframe name.
- tb_name -> name of the postgresql database table.
- name_script -> file name.
- schema_name -> postgresql schema name which by default receives the value as 'public'.
- creates the output folder for postgresqlsql scripts
- Through for adds '' in columns of type object 'categories
The "df_to_oracle" package is used for:
- "Convert" module:
- has the function converter_df_in_oracle that with os.mkdir('SCRIPTS')
- the function receives 4 variables as a parameter:
- df -> dataframe name.
- tb_name -> name of the oracle database table.
- name_script -> file name.
- creates the output folder for oracle scripts
- Through for adds '' in columns of type object 'categories
The "df_to_sqlite" package is used for:
- "Convert" module:
- has the function converter_df_in_sqlite that with os.mkdir('SCRIPTS')
- the function receives 4 variables as a parameter:
- df -> dataframe name.
- tb_name -> name of the sqlite database table.
- name_script -> file name.
- creates the output folder for sqlite scripts
- Through for adds '' in columns of type object 'categories
Here the goal is to provide a simple code package but it solved a real problem for me and I believe it can solve problems with other dataframes. If you need, you can collect the data in csv, treat them and after that, to insert the records in a sql server database, just use the df_to_sqlserver package to generate the scripts and then run these scripts in your DBMS or batch.
How to install the package
pip install df_to_sqlserver --upgrade
check package version
pip show df_to_sqlserver
How to use in any project
from df_to_sqlserver.df_to_sqlserver import converter_df_in_sql
from df_to_sqlserver.df_to_mysql import converter_df_in_mysql
from df_to_sqlserver.df_to_postgresql import converter_df_in_postgresql
from df_to_sqlserver.df_to_oracle import converter_df_in_oracle
from df_to_sqlserver.df_to_sqlite import converter_df_in_sqlite
converter_df_in_sql(df="",tb_name="",name_script="")
converter_df_in_mysql(df="",db_name="",tb_name="",name_script="")
converter_df_in_postgresql(df="",tb_name="",name_script="",schema_name="public")
converter_df_in_oracle(df="",tb_name="",name_script="")
converter_df_in_sqlite(df="",tb_name="",name_script="")
Author:
Francisco Fabio de Almeida Ferreira
Systems Analyst and Data Science Specialist
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
File details
Details for the file df_to_sqlserver-1.0.15.tar.gz.
File metadata
- Download URL: df_to_sqlserver-1.0.15.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8646ed6c051b9f7ce52820d61d2d7d9bfc80514392f9c0b6536d05f72ccfe989
|
|
| MD5 |
54eb331d3a2f3f29b1ddf65493d158a2
|
|
| BLAKE2b-256 |
8e1be81ea22fa4da0100e4603413038f1d2a9f81a819f1a7ea7cfccb0a2ecc28
|