0% found this document useful (0 votes)
4 views2 pages

Task_1_Report

Uploaded by

dhruvchavda447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Task_1_Report

Uploaded by

dhruvchavda447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

README for Technology Task 1

Overview

This project, Technology Task 1, demonstrates the use of multiple database systems
(MySQL, PostgreSQL, MongoDB) to perform basic operations such as product addition.
It provides a modular code structure for seamless database interaction and
showcases the flexibility of working with different database technologies in
Python.

Project Structure

Folder Hierarchy:

Code/

database/

mysql_connection.py : Handles connection to MySQL.

postgresql_connection.py : Handles connection to PostgreSQL.

mongodb_connection.py : Handles connection to MongoDB.

services/

product_service.py : Contains logic for adding products to the selected database.

main.py : The entry point of the project that integrates all services.

Report/

Placeholder for additional documentation or reports.

Features

Database Connectivity: Supports MySQL, PostgreSQL, and MongoDB.

Product Management: Add product details (name, price, quantity) to the selected
database.

Interactive CLI: User-friendly command-line interface to select databases and


perform operations.

Error Handling: Ensures smooth execution and handles connection issues.

Modular Code: Easy to extend and maintain due to logical separation of concerns.

How to Run

Ensure Python is installed on your system.

Install required packages for database connectivity using:

pip install mysql-connector-python psycopg2 pymongo

Configure your database credentials in the respective files under Code/database/.

Run the main program:


python Code/main.py

Follow the interactive prompts to select a database and add products.

Working of Files

main.py: Provides the interface for selecting databases and performing operations.

Database Connection Files:

mysql_connection.py: Establishes and returns a MySQL connection.

postgresql_connection.py: Establishes and returns a PostgreSQL connection.

mongodb_connection.py: Establishes and returns a MongoDB database instance.

product_service.py: Handles product addition logic for all supported databases.

Key Highlights

Cross-Database Compatibility: Easy to switch between MySQL, PostgreSQL, and


MongoDB.

Scalable Design: Modular structure allows adding more database operations or new
database support.

Simple Configuration: Database credentials can be quickly updated.

Ease of Use: Clear prompts and error messages for better user experience.

Future Enhancements

Add support for more database systems (e.g., SQLite, Oracle).

Implement additional operations such as updating, deleting, and viewing products.

Integrate with a web frontend for enhanced interactivity.

Conclusion

This project serves as a foundational implementation for understanding and working


with multiple databases in Python. The structured approach and interactive CLI make
it highly usable and adaptable for real-world scenarios.

You might also like