A simple API wrapper
Project description
Order Pipeline Project
Overview
The Order Pipeline Project is a Python-based data processing and analysis system designed to retrieve, enrich, analyze, and export product and user data. This project leverages API data, Pandas for data manipulation, and JSON for output storage. It is structured to simulate an end-to-end analytics pipeline.
The primary goal of this project is to demonstrate a clean, modular approach to data processing, suitable for testing and extension.
Features
-
Data Retrieval
Fetches products and users from APIs usingAPIClient. The APIClient implements a pagination logic that makes on request to the/productsapi and stores the data. This data is now used to simulate pagination using slicing vai the limits -
Data Enrichment
Converts API responses into Pandas DataFrames and merges them on user IDs to enrich product data with seller information, including username, email, and name. Calculates total revenue for each product. -
Data Analysis
Performs key metrics calculations such as total products per seller, total revenue, and average price per seller. -
Exporting
Exports analysis results into JSON files for easy storage and sharing. -
Configuration Management
Centralized configuration file handling usingConfigManagerto manage project settings.
Pipeline Workflow
The pipeline follows a modular, step-by-step process to fetch, enrich, analyze, and export data.
ConfigManager : Loads the configuration from the `popeline.cfg` file
│
▼
APIClient
│
▼
Fetch Products & Users. Uses the configuration settings loaded in be the configmanager
│
▼
DataEnricher
├─ Convert products to DataFrame
├─ Convert users to DataFrame
├─ Merge products & users on user ID
└─ Calculate revenue per product
│
▼
Analyzer
├─ Total products per seller
├─ Total revenue per seller
├─ Average price per seller
└─ Generate analysis dictionary
│
▼
Exporter
└─ Export analysis results to JSON
Step-by-Step Description:
-
APIClient: Fetches product and user data from the API.
-
DataEnricher: Converts raw JSON to DataFrames, merges datasets on user ID, and calculates revenue for each product.
-
Analyzer: Computes key metrics for reporting.
-
Exporter: Saves the results into a JSON file for further use.
Installation
- Create a virtual environment and activate it
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
- Install the dependencies required
pip install pandas requests
- Install the package
pip install <name of package>
Usage
In the activated environment and at the root folder, type in omnicart-pipeline:
omnicart-pipeline
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omnicart_pipeline-0.1.1.tar.gz.
File metadata
- Download URL: omnicart_pipeline-0.1.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
153a07ee47ce3d3e3b54f547b21ae5b65d2c06f1962bca4aa40fbed9f281dc17
|
|
| MD5 |
1e33db68d12e62102ab274e28e2baeeb
|
|
| BLAKE2b-256 |
3ce921164d42cef2beb0a7df55b37755ec94ad734883a36d803b5d0ddbf1efd2
|
File details
Details for the file omnicart_pipeline-0.1.1-py3-none-any.whl.
File metadata
- Download URL: omnicart_pipeline-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
690daa3a5e5f5f8aec08cd198b02219f3fe3a3966b477e0661a8a090e9086e04
|
|
| MD5 |
40f28d12d944de0960a3d2af12ae2b65
|
|
| BLAKE2b-256 |
d9b064b318cedf8390d186a9991d4fc4af81dabe5d46d6e81f9731d512f59b56
|