A Python command-line application that collects product data from an API, validates and cleans the records, removes duplicates, applies user-defined filters and sorting options, and exports structured JSON and CSV reports.
Project Purpose
The purpose of this project is to automate the process of collecting and organizing product data. It transforms raw API records into clean, structured, and reusable reports based on the user’s search and filtering criteria.
The current version uses DummyJSON as a demonstration API, but the application can be adapted to other public APIs or permitted data sources.
Key Features
Search products by keyword.
Fetch all matching products from an API.
Validate and clean product records.
Remove duplicate products using product IDs.
Filter results by minimum price, maximum price, and rating.
Sort products by price, rating, or stock.
Export timestamped JSON and CSV reports.
Display a clear processing summary.
How It Works
The user enters a product keyword and filtering criteria.
The application sends a request to the DummyJSON API.
The returned product records are validated and cleaned.
Duplicate and invalid records are removed.
The remaining products are filtered and sorted according to the user’s preferences.
The final results are exported as timestamped JSON and CSV reports.
Technologies Used
Python
Requests
DummyJSON API
JSON
CSV
Git and GitHub
Visual Studio Code
Data Validation and Processing
The application checks each product record before processing it. Records with missing or invalid values are excluded, duplicate products are removed using their IDs, and the remaining data is converted into a consistent structure for filtering, sorting, and export.
The program also tracks how many products were fetched, cleaned, removed as invalid or duplicate, excluded by filters, and included in the final reports.
Output and Results
The application creates timestamped JSON and CSV files inside an output folder. Each report contains clean, filtered, and sorted product records that can be reused for analysis, reporting, or further processing.
The terminal summary clearly shows the API connection status, the number of records fetched and cleaned, the records removed during validation and filtering, and the number of products included in the final output.
Project Status
Version 1.0 is complete and functional.
The current version supports API data collection, record validation and cleaning, duplicate removal, user-defined filtering and sorting, timestamped JSON and CSV exports, and a clear processing summary.
Future Improvements
Add automated tests.
Add type hints and stronger input validation.
Support Excel report generation.
Improve logging and error reporting.
Add more configurable filters and reporting options.
Adapt the application to additional public APIs.
GitHub Repository
View the complete source code, documentation, installation instructions, and project files on GitHub.