Skip to main content

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

  1. Data Retrieval
    Fetches products and users from APIs using APIClient. The APIClient implements a pagination logic that makes on request to the /products api and stores the data. This data is now used to simulate pagination using slicing vai the limits

  2. 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.

  3. Data Analysis
    Performs key metrics calculations such as total products per seller, total revenue, and average price per seller.

  4. Exporting
    Exports analysis results into JSON files for easy storage and sharing.

  5. Configuration Management
    Centralized configuration file handling using ConfigManager to 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

  1. Create a virtual environment and activate it
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows
  1. Install the dependencies required
pip install pandas requests
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omnicart_pipeline-0.1.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnicart_pipeline-0.1.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file omnicart_pipeline-0.1.2.tar.gz.

File metadata

  • Download URL: omnicart_pipeline-0.1.2.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

Hashes for omnicart_pipeline-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e725bdd4c464db39bf30e1ef1d610963ab21dc2fa6a7ce6cb6c603a675a7433a
MD5 94e2b108e28cd0f64398f766d2227cb0
BLAKE2b-256 9caf1fda5584bfe5ab363e05f095b9e20d57807173affd5ec120f3c9d0806d70

See more details on using hashes here.

File details

Details for the file omnicart_pipeline-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for omnicart_pipeline-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4357c5fad4bf57ec90bc7f9fc6d83778b69d8cc6e342817cbf75697fb80bd604
MD5 f29e259a6a0141e558b5a1f2f2eb4573
BLAKE2b-256 6f06bb575ec1b4dcb89359ac33427cc69e327a4b748b9bedb71662efd97a9e21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page