This utility is designed to process CSV files containing tax data, translate the column names based on a provided dictionary, and then load the processed data into a PostgreSQL database. If errors occur during processing, the problematic files are recorded in an error-log.csv for subsequent review.
- Python 3.11.5
- Libraries:
pandas,sqlalchemy,csv,os,shutil,tqdm
-
Database credentials should be set up in the
config_db.pyfile:db_username = 'your_username' db_password = 'your_password' db_host = 'db_host' db_port = 'db_port' db_name = 'db_name' db_schema = 'test'
-
Ensure that the PostgreSQL database is running and that the credentials provided in the
config_db.pyfile are correct.Remember to create the schema in the PostgreSQL database if it does not exist.
-
After configuring the above parameters, run the script to start processing the CSV files. In case of errors, problematic files will be moved to the
temp/processedfolder and errors logged in theerror-log.csvfile.
To use the Text To DB Converter, follow these steps:
-
Open your command line interface (CLI).
-
Navigate to the directory where the
main.pyfile is located. -
Run the following command:
python main.py
This project is licensed under the MIT License - see the LICENSE for details.
