# Automated Revenue Analytics Pipeline

> Automate retail data cleaning, SQL warehousing, and interactive HTML dashboard generation from messy CSV/Excel files.

Automated Revenue Analytics Pipeline is a free AI agent skill on Agensi by nwafor lawrence, in Business & Operations. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [nwafor lawrence](https://www.agensi.io/creators/nwafor-lawrence)
- Category: [Business & Operations](https://www.agensi.io/skills/business-operations)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/automated-revenue-analytics-pipeline
- Tags: project-management, finance, database, python, sqlalchemy, pandas, data-visualization

## About this skill

Cleaning retail data manually is a recipe for broken reports and stale dashboards. This skill automates the entire ingestion path from messy spreadsheets to a production-ready SQL warehouse and interactive HTML visualization.

### What it does
- **Messy Data Cleaning** handles fuzzy product typo repair, mixed date format normalization, and currency string stripping.
- **SQL Data Warehousing** upserts cleaned records into SQLite or PostgreSQL using SQLAlchemy to ensure no duplicate orders.
- **Automated Recalculation** fixes corrupt revenue totals by deterministically computing `Quantity * Price`.
- **Interactive Dashboards** generates a standalone Plotly HTML file containing KPI cards, trend lines, and regional performance charts.
- **Schema Mapping** translates varied header aliases like `Qty` or `Transaction Date` into a standardized internal schema.

### How it works
1. **Pre-flight Validation** verifies input CSV or Excel headers against the required schema without writing data.
2. **Execution** runs the Python pipeline to clean data and upsert records into the target database.
3. **Analytics Generation** computes SQL aggregations for top products, peak months, and regional performance.
4. **Output Verification** saves the cleaned CSV, the summary analysis, and the interactive dashboard to the specified directory.

### Frameworks & tools
Built with Python 3, Pandas for data manipulation, and SQLAlchemy 2.0 for database abstraction. Visualizations are rendered via Plotly. Supports SQLite (default) and PostgreSQL backends.

### Why this beats prompting it yourself
Prompting an LLM to clean data often leads to hallucinated rows or truncated outputs for large files. This skill provides a deterministic Python engine that handles thousands of rows reliably while ensuring SQL integrity via upserts.

### Use cases
- Automating weekly retail sales ingestion from fragmented CSV exports.
- Syncing Excel-based order history into a centralized PostgreSQL database.
- Generating executive-ready interactive dashboards for regional sales reviews.
- Repairing historical sales records with inconsistent date formats and currency symbols.

### Known limitations
Requires specific columns like Order_ID and Date to function. Input files must be in .csv, .xls, or .xlsx format. Standard Python environment with pip installed is required.

## Requires

- Python 3.9+
- pip
- Optional: PostgreSQL or SQLite
- Optional: psycopg2-binary (only needed for PostgreSQL)

Runs locally with zero API keys required. Uses local SQLite by default and writes cleaned_sales.csv, analysis_results.csv, sales_warehouse.db, and sales_analytics_dashboard.html to your working folder.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Automated Revenue Analytics Pipeline skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What is the primary benefit of using this skill over manually prompting an AI to clean my data?

This skill automates the end-to-end process of transforming fragmented CSV/Excel exports into a structured SQL database and professional Plotly dashboards, eliminating the manual errors and hallucinations common with manual LLM prompting.

### Which database systems are compatible with this analytics pipeline?

The pipeline supports both SQLite (ideal for local use) and PostgreSQL (for production environments), using SQLAlchemy to handle upserts that prevent duplicate order entries.

### How does the skill handle spreadsheets with inconsistent column names or messy formatting?

The skill includes a robust schema mapping feature that recognizes common header aliases (like 'Qty' vs 'Quantity') and normalizes mixed date formats and currency strings automatically.

### What is included in the purchase of the Automated Revenue Analytics Pipeline?

You will receive the complete Python-based skill package, including the data cleaning engine, the SQL integration layer, and the dashboard generation templates, ready for deployment in your AI agent environment.

### Are there any specific file format or data requirements I should be aware of?

While the skill is highly flexible, input files must be in .csv, .xls, or .xlsx format and contain core fields like Order_ID and Date to ensure accurate tracking and visualization.

### Can the interactive dashboards be shared with stakeholders who don't have access to the underlying SQL database?

Yes, the generated Plotly dashboard is a standalone HTML file, making it easy to share via email, host on a web server, or view offline without needing a live database connection.

### Does this only work with the sample products (Rice, Beans, Garri), or can I use my own products and regions?

It works with any products and regions in your spreadsheet. By default, the pipeline keeps all non-empty product and region names while cleaning typos, dates, prices, and duplicates. Only pass --strict-catalog if you intentionally want to restrict records to the 5-product sample catalog.

### Does my sales data leave my computer or require any paid API keys?

No. All data cleaning, deduplication, SQLite storage, and dashboard generation run 100% locally on your machine with zero API keys or external uploads required.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
