Skip to content

Latest commit

 

History

History
91 lines (72 loc) · 1.74 KB

README.md

File metadata and controls

91 lines (72 loc) · 1.74 KB

Storemate Report Generator

A pytho-based tool for processing store DBF data files and generating analytical reports using DuckDB.

Features

  • Automatic processing of DBF files to CSV format
  • Report generation using configurable SQL queries
  • Automatic backup of data directory
  • Command-line interface for easy operation

Prerequisites

  • Python 3.9 or higer
  • UV Package manager (pip install uv)

Installation

  1. Clone the repository:
git clone https://github.com/kasrsf/storemate_report_generator.git
cd storemate_report_generator 
  1. Set up the development environment
make setup 

Usage

Directory Structure

  • data/raw: Place your DBF files here
  • data/processed/: Converted CSV files and DuckDB database
  • data/reports/: Generated report files
  • data/queries/: YAML files containing report queries

Commands

  1. Process DBF files to CSV:
make process-data 
  1. Generate reports:
make generate-reports 
  1. Backup data directory:
make backup-data
  1. Run complete pipeline (process, generate reports, backup):
make run-all 

Adding New Reports

Create a new YAML file in reports/queries/ directory with the following structure:

name: weekly_customer_sales
description: "Breakdown of sales by customers and items in the past week"
query: |
  SELECT
    customer_name,
    item_name,
    SUM(quantity) AS total_quantity,
    SUM(amount) AS total_amount
  FROM sales
  WHERE data >= DATEADD('week', -1, CURRENT_DATE)
  GROUP BY customer_name, item_name
  ORDER BY total_amount DESC
output_file: weekly_customer_sales.csv

Development

Running Tests

make test

Code Quality

make lint
make format

License

MIT License