Python MySQL Insertion Script
Budget / SalaryHourly project
TypeFreelance project
LocationRemote
Posted2 hours ago
I need a clean, well-documented Python script that connects to my existing MySQL database and inserts new records reliably. The script should:
• Establish a secure connection to my MySQL instance (local credentials or .env file—your call as long as passwords stay out of the code).
• Accept data passed in as variables, JSON, or a small CSV—whichever is easiest to parameterise—then build the corresponding INSERT statements.
• Handle common edge cases gracefully (duplicate keys, NULL values, connection drops) and log any failed rows for review.
• Be easy for me to run from the command line or drop into a larger workflow later.
Please write with standard libraries plus mysql-connector-python or PyMySQL; SQLAlchemy is fine if you prefer. Include a brief README showing required packages and a sample run so I can verify on my side.
• Establish a secure connection to my MySQL instance (local credentials or .env file—your call as long as passwords stay out of the code).
• Accept data passed in as variables, JSON, or a small CSV—whichever is easiest to parameterise—then build the corresponding INSERT statements.
• Handle common edge cases gracefully (duplicate keys, NULL values, connection drops) and log any failed rows for review.
• Be easy for me to run from the command line or drop into a larger workflow later.
Please write with standard libraries plus mysql-connector-python or PyMySQL; SQLAlchemy is fine if you prefer. Include a brief README showing required packages and a sample run so I can verify on my side.
Apply on Freelancer →
Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.