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

Uploaded Python 3

File details

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

File metadata

  • Download URL: omnicart_pipeline-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a319441e2b47316247f50fc15ee860d717801eaa660bc57937454a40ebcd41d9
MD5 da61794d77f6a2b3a7460903f4cf9b8c
BLAKE2b-256 e526f14fda3494b12bb1b56a7c8609b315b4d7400c854709e54388a268d70243

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for omnicart_pipeline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e214d57e960873452a22d21563450dc4feae420453665358e3243dca5edfdeb6
MD5 6de0c035309981b4abdfdf072e3bf27e
BLAKE2b-256 be890d4efada757d5d98f9869837a5917bdfc8fddeb92413c6aae762b73203bf

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