A program made in PYTHON🐍 that automatically performs data insertions into a POSTGRES database 🐘 , using as base a .CSV file 📁 , useful in mass data insertions

Overview

Bot de Inserção de Dados 🤖

Um programa feito em linguagem PYTHON 🐍 que realiza automaticamente inserções de dados em um banco POSTGRES 🐘 , usando como base um arquivo .CSV 📁 , útil em inserções de dados em massa.

Na criação do bot foi utilizado 4 arquivos nomeados de:
♦️ BDConnection.py necessário para a conexão com o Banco de Dados.
♦️ insertCSVData.py para a abertura e leitura do arquivo .CSV
♦️ insertQuerys.py para realizar a inserção dos dados em cada tabela.
♦️ main.py para realizar a inserção dos dados em cada tabela.

Como utilizar o bot:

❇️ 1º - Defina a conexão com o banco no arquivo BDConnection.py,inserindo o host,banco,usuário e a senha:

giphy

❇️ 2º - Agora faça métodos semelhantes para cada tabela do seu Banco de Dados no arquivo insertQuerys.py, onde os argumentos deverão ser cada atributo da sua tabela, após isso altere os .format() de acordo com necessário:

giphy

❇️ 3º - No mesmo arquivo insertQuerys.py, faça métodos para as relações entre tabelas. pegando suas ID, definindo-as como FK, lembre-se de sempre que terminar duas tabelas relacionadas, fazer a sua relação:

giphy

❇️ 4º - Por fim, no arquivo insertCSVData.py*, adicione os métodos criados em insertQuerys.py e em seguida adicione os parâmetros de acordo com cada coluna do .CSV:

giphy

Conclusão

Créditos para:
- 💠 Davi Galdino de Oliveira Souza
- 💠 João Vitor Oliveira Correia

Extensão usada:
🔆 Identificador de colunas de arquivos .CSV no VSCode

You might also like...
Birthday program - A program that lookups a birthday txt file and compares to the current date to check for birthdays
Birthday program - A program that lookups a birthday txt file and compares to the current date to check for birthdays

Birthday Program This is a program that lookups a birthday txt file and compares

Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file
Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file

Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file. VISD can also perform vehicle speed detection on a video. All these features of VSID are provided to the user using a Web Application which is created using Flask

Med to csv - A simple way to parse MedAssociate output file in tidy data

MedAssociates to CSV file A simple way to parse MedAssociate output file in tidy

This app converts an pdf file into the audio file.

PDF-to-Audio This app takes an pdf as an input and convert it into audio, and the library text-to-speech starts speaking the preffered page given in t

Inviare messaggi tramite app IO a partire da dati contenuti in file .csv

parlaConIO Inviare messaggi tramite app IO a partire da dati contenuti in file .csv -- Nessun obbligo, ma in caso di clonazione o uso del programma c

Scraping comments from the political section of popular Nigerian blog (Nairaland), and saving in a CSV file.

Scraping_Nairaland This project scraped comments from the political section of popular Nigerian blog www.nairaland.com using the Python BeautifulSoup

Export transactions for an algorand wallet to a CSV file

algorand_txn_csv_exporter - (Algorand transaction CSV exporter) This script will export transactions for an algorand wallet to a CSV file. It is inten

Adansons Base is a data management tool that organizes metadata of unstructured data and creates and organizes datasets.

Adansons Base is a data management tool that organizes metadata of unstructured data and creates and organizes datasets. It makes dataset creation more effective and helps find essential insights from training results and improves AI performance.

A blazing fast mass certificate generator script for the community ⚡
A blazing fast mass certificate generator script for the community ⚡

A simple mass certificate generator script for the community ⚡ Source Code · Docs · Raw Script Docs All you need Certificate Design a simple template

Owner
Davi Galdino
Computer Science Student at IFG
Davi Galdino
Yunqi Chen 7 Oct 30, 2022
A code base for python programs the goal is to integrate all the useful and essential functions

Base Dev EN This GitHub will be available in French and English FR Ce GitHub sera disponible en français et en anglais Author License Screen EN ???? D

Pikatsuto 1 Mar 7, 2022
A simple program which gets a file(CSV/Excel) with tasks and creates different variants

TestMakerProject A simple program which gets a file(CSV/Excel) with tasks and creates different variants The main program is QTengine.py You only have

George 3 Nov 18, 2021
It converts ING BANK account historic into a csv file you can import in HomeBank application.

ing2homebank It converts your ING Bank account historic csv file into another csv file you can import in HomeBank application

null 1 Feb 14, 2022
BMI-Calculator: Program to Calculate Body Mass Index (BMI)

The Body Mass Index (BMI) or Quetelet index is a value derived from the mass (weight) and height of an individual, male or female.

PyLaboratory 0 Feb 7, 2022
This program generates automatically new folders containing old version of program

Automated Folder Versions Generator by Sergiy Grimoldi - V.0.0.2 This program generates automatically new folders containing old version of something

Sergiy Grimoldi 1 Dec 23, 2021
A server shell for you to play with Powered by Django + Nginx + Postgres + Bootstrap + Celery.

A server shell for you to play with Powered by Django + Nginx + Postgres + Bootstrap + Celery.

Mengting Song 1 Jan 10, 2022
Task dispatcher for Postgres

Features a task being ran as an OS process supports task queue with priority and process limit per node fully database driven (a worker and task can b

null 2 Dec 6, 2021
Addon for Blender 2.8+ that automatically creates NLA tracks for all animations. Useful for GLTF export.

PushDownAll An addon for Blender 2.8+ that runs Push Down on all animations, creating NLA tracks for each. This is useful if you have an object with m

Cory Petkovsek 16 Oct 6, 2022
Converts a base copy of Pokemon BDSP's masterdatas into a more readable and editable Pokemon Showdown Format.

Showdown-BDSP-Converter Converts a base copy of Pokemon BDSP's masterdatas into a more readable and editable Pokemon Showdown Format. Download the lat

Alden Mo 2 Jan 2, 2022