Mini Project Assignment: E-commerce Order Logger with Logging & SQLite3
Objective:
Develop a real-world mini project that logs order activities (like add, update, cancel)
in an E-commerce system using Python logging and SQLite3.
Files Provided:
- ecommerce_orders.csv (sample order data)
Tasks:
1. Load the CSV data and insert it into an SQLite database.
2. Create two versions of your logger:
a. Without logging config (basic logging with FileHandler & StreamHandler)
b. With logging config (using dictConfig or config file)
3. Implement order actions (e.g., update status, cancel order, add order).
4. Log every operation: user, action, order ID, and timestamp.
5. Create a function to fetch all order logs.
6. Optional: Add rotating file handler or timed file handler.
Logging Tips:
- Use loggers with appropriate names.
- Create a custom formatter to include function name, line number, and time.
- Store logs in `logs/` folder (create programmatically if needed).
Advanced (Optional):
- Use context-based logging.
- Allow SQLite rollback on failure and log the error.
- Create an analytics function to show:
a. Most frequently ordered product
b. Number of pending vs delivered orders
Submission Format:
- Python script or Jupyter Notebook
- `ecommerce_orders.csv`
- `project_logs/` directory with logs
- Readme.md (optional, for documentation)
Evaluation Criteria:
- Code structure and clarity
- Logging usage and completeness
- SQLite usage and data accuracy
- Optional tasks if completed
Good luck!