← Back to all products

Pricing Engine Toolkit

$49

Dynamic pricing rules, competitor price monitoring, margin calculator, discount scheduling, and A/B price testing framework.

📁 23 files
JSONMarkdownYAMLPython

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 23 files

pricing-engine-toolkit/ ├── LICENSE ├── README.md ├── configs/ │ └── pricing_config.yaml ├── data/ │ ├── sample_competitor_prices.csv │ ├── sample_products.csv │ └── sample_rules.json ├── free-sample.zip ├── guide/ │ ├── 01-pricing-strategy-foundations.md │ ├── 02-dynamic-pricing-models.md │ ├── 03-discount-optimization.md │ ├── 04-margin-analysis.md │ └── 05-competitor-monitoring.md ├── guides/ │ └── pricing_guide.md ├── index.html ├── scripts/ │ └── run_pricing.py ├── src/ │ ├── __init__.py │ ├── ab_testing.py │ ├── competitor.py │ ├── engine.py │ ├── margin.py │ ├── models.py │ └── scheduler.py └── tests/ └── test_pricing.py

📖 Documentation Preview README excerpt

Pricing Engine Toolkit

A rules-based pricing engine with competitor monitoring, margin analysis, discount scheduling, and A/B price testing — all in pure Python with zero external dependencies.

What's Inside

ModuleFileDescription
Pricing Enginesrc/engine.pyPriority-ordered rule evaluation: fixed price, markup, discount, competitor match, margin floor
Data Modelssrc/models.pyDataclasses for products, rules, competitor prices, discounts, A/B tests
Competitor Monitorsrc/competitor.pyTrack competitor prices, detect undercuts, identify pricing opportunities
Margin Calculatorsrc/margin.pyMargin/markup analysis, break-even, what-if scenarios, discount impact
Discount Schedulersrc/scheduler.pyTime-based discounts, stacking rules, usage tracking, promo calendar
A/B Testingsrc/ab_testing.pyStatistical price experiments with z-test and t-test analysis

Features

  • Priority-based rule engine — rules evaluated in order, first match wins, with price floor/ceiling enforcement
  • 7 rule types — fixed price, percentage markup, percentage discount, competitor match, volume tier, time-based, margin floor
  • Competitor intelligence — pluggable feed adapters (CSV, JSON, or your own API), undercut alerts with severity levels, pricing opportunity reports
  • Margin analysis — margin vs markup calculations, break-even with target profit, what-if price scenarios, discount impact showing the volume increase needed to compensate
  • Discount management — percentage/fixed/fixed-price discounts, category/SKU/tag targeting, stackable vs non-stackable, usage limits, scheduled activation
  • Statistical A/B testing — deterministic visitor assignment, two-proportion z-test, Welch's t-test for revenue, sample size calculator, confidence-level-aware recommendations
  • Pure Python — zero pip dependencies, Python 3.10+ stdlib only

Quick Start


# Run the complete demo (all 5 modules)
cd pricing-engine-toolkit/
python scripts/run_pricing.py

# Run the test suite
python -m pytest tests/test_pricing.py -v

Project Structure


pricing-engine-toolkit/
├── src/
│   ├── __init__.py        # Package exports
│   ├── models.py          # PricedProduct, PricingRule, CompetitorPrice, Discount, ABTestConfig
│   ├── engine.py          # PricingEngine with rule evaluation and match/case dispatch
│   ├── competitor.py      # CompetitorMonitor, CsvCompetitorFeed, undercut detection
│   ├── margin.py          # MarginCalculator, break-even, scenarios, discount impact
│   ├── scheduler.py       # DiscountScheduler, stacking, calendar view
│   └── ab_testing.py      # ABTestRunner, statistical tests, sample size calculator
├── configs/
│   └── pricing_config.yaml  # All configuration options with comments
├── data/
│   ├── sample_products.csv         # 15 sample products across 3 categories
│   ├── sample_rules.json           # 7 sample pricing rules
│   └── sample_competitor_prices.csv # Competitor price observations
├── scripts/
│   └── run_pricing.py     # Full demo script showing all modules
├── tests/
│   └── test_pricing.py    # 25+ unit tests covering all modules
├── guides/
│   └── pricing_guide.md   # Detailed setup and usage guide

*... continues with setup instructions, usage examples, and more.*

📄 Code Sample .py preview

src/ab_testing.py """ A/B Price Testing Framework — Pricing Engine Toolkit ====================================================== Statistical framework for running price experiments. Test whether a different price point generates more revenue, better conversion rates, or higher units sold — with confidence. Why A/B test prices? Gut-feel pricing leaves money on the table. A 5% price increase with no conversion impact goes straight to profit. But you need data to know if it impacts conversion. This module gives you the tools to test price changes rigorously and read the results correctly. Statistical approach: Uses a two-proportion z-test for conversion rate comparisons and a Welch's t-test approximation for revenue comparisons. Both implemented with stdlib math only (no numpy/scipy needed). """ from __future__ import annotations import hashlib import logging import math import random from dataclasses import dataclass, field from datetime import datetime, timezone from typing import Any, Dict, List, Optional, Tuple from src.models import ABTestConfig logger = logging.getLogger(__name__) # --------------------------------------------------------------------------- # Result types # --------------------------------------------------------------------------- @dataclass class TestObservation: """A single transaction in an A/B test.""" group: str # "control" or "variant" price_shown: float purchased: bool quantity: int = 1 revenue: float = 0.0 visitor_id: str = "" timestamp: str = field( default_factory=lambda: datetime.now(timezone.utc).isoformat() ) # ... 501 more lines ...
Buy Now — $49 Back to Products