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.1.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.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

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

Hashes for omnicart_pipeline-0.1.1.tar.gz
Algorithm Hash digest
SHA256 153a07ee47ce3d3e3b54f547b21ae5b65d2c06f1962bca4aa40fbed9f281dc17
MD5 1e33db68d12e62102ab274e28e2baeeb
BLAKE2b-256 3ce921164d42cef2beb0a7df55b37755ec94ad734883a36d803b5d0ddbf1efd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for omnicart_pipeline-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 690daa3a5e5f5f8aec08cd198b02219f3fe3a3966b477e0661a8a090e9086e04
MD5 40f28d12d944de0960a3d2af12ae2b65
BLAKE2b-256 d9b064b318cedf8390d186a9991d4fc4af81dabe5d46d6e81f9731d512f59b56

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