An interactive command-line tool to perform CRUD operations on PostgreSQL databases and generate Python CRUD scripts automatically.
This tool is useful for developers who want to avoid writing repetitive CRUD operations and manually setting up PostgreSQL in their Python projects.
With this tool:
- The required PostgreSQL library is handled automatically
- A database can be created or selected
- A connection is established
- Tables are created dynamically
- A Python file is generated with basic CRUD operations
This helps developers save time and focus on application logic instead of setup and boilerplate code.
-
Connect to PostgreSQL using username and password
-
Create a new database or use an existing one
-
Create tables dynamically
-
Perform CRUD operations:
- Insert
- Read
- Update
- Delete
-
Generate reusable Python CRUD code for your tables
-
Simple and beginner-friendly command-line interface
https://github.com/jagritiS/crud_postgres
Install from PyPI:
pip install psql-crud-toolRun the CLI tool:
psqlcrud-
Enter PostgreSQL credentials
-
Choose whether to use an existing database or create a new one
-
Enter table name
-
Define table columns
-
Use the menu to:
- Insert data
- Read data
- Update records
- Delete records
-
Generate a reusable CRUD Python file
The tool generates a file named:
crud_generated.py
This file includes basic functions for:
- Insert
- Read
- Update
- Delete
This tool is intended for learning and development purposes. Avoid using raw input directly in production environments due to SQL injection risks.
Jagriti Srivastava
MIT License
Contributions are welcome. Feel free to fork the repository and submit pull requests.