A pytho-based tool for processing store DBF data files and generating analytical reports using DuckDB.
- 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
- Python 3.9 or higer
- UV Package manager (
pip install uv
)
- Clone the repository:
git clone https://github.com/kasrsf/storemate_report_generator.git
cd storemate_report_generator
- Set up the development environment
make setup
data/raw
: Place your DBF files heredata/processed/
: Converted CSV files and DuckDB databasedata/reports/
: Generated report filesdata/queries/
: YAML files containing report queries
- Process DBF files to CSV:
make process-data
- Generate reports:
make generate-reports
- Backup data directory:
make backup-data
- Run complete pipeline (process, generate reports, backup):
make run-all
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
make test
make lint
make format
MIT License