Natwar's picture
Update README.md
2a2ef8c verified
metadata
title: Biweekly Invoice Generator
emoji: πŸ“Š
colorFrom: red
colorTo: gray
sdk: gradio
sdk_version: 5.44.1
app_file: app.py
pinned: false
license: mit
short_description: A Gradio web application that processes employee CSV

🧾 Invoice Generator for Launch27 Data

A Gradio web application that processes employee CSV files and booking data to generate invoices with automatic tip calculations.

πŸš€ Quick Start

For Hugging Face Spaces Deployment:

  1. Upload app.py and requirements.txt to your Space
  2. Set SDK to "Gradio"
  3. The app will automatically launch

Local Installation:

pip install -r requirements.txt
python app.py

Requirements File (requirements.txt):

gradio
pandas

πŸ“‹ Features

  • βœ… Flexible CSV Upload: Works with 1-3 employee data files
  • βœ… Automatic Tip Processing: Extracts and includes tips from booking data
  • βœ… Date Range Filtering: Filter records by bi-weekly periods
  • βœ… Smart Date Parsing: Handles DD/MM/YY and DD/MM/YYYY formats
  • βœ… Pivot Table Generation: Creates summary report by employee
  • βœ… CSV Export: Download processed invoice as CSV file

πŸ“ File Requirements

Required Files:

  • Bookings CSV: Must contain booking data with tips
  • At least 1 Employee CSV: Employee work data (1.csv, 2.csv, or 3.csv)

CSV Format Expected:

  • Employee Files: Date, Team, Name, Hourly Rate, Hours Worked, Total
  • Bookings File: Date, Teams Assigned (without IDs), Tip

🎯 Usage

  1. Upload Files: Add your employee CSV files and bookings CSV
  2. Set Date Range: Enter start and end dates (YYYY-MM-DD format)
  3. Generate: Click "Generate Invoice" button
  4. Download: Get your processed invoice CSV

πŸ“Š Output Format

The generated invoice includes:

  • Employee summary with total hours and earnings
  • Tips automatically added to respective employees
  • Grand total calculations
  • Matches Launch27 invoice format requirements

🌐 Deployment

Local Development:

python app.py

Access at: http://localhost:7860

Cloud Deployment:

  • Hugging Face Spaces: Upload app.py and requirements.txt
  • Railway/Render: Deploy with Python runtime
  • Docker: Works with standard Python containers

πŸ“ Notes

  • Default date range: August 9-22, 2025
  • Supports flexible employee file combinations
  • Automatically handles name standardization
  • Tips are processed from "Teams Assigned" field in bookings
  • Output format matches expected Final-Invoice.csv structure

πŸ”§ Technical Details

  • Framework: Gradio for web interface
  • Data Processing: Pandas for CSV manipulation
  • Date Handling: Flexible parsing with dayfirst=True
  • File Management: Temporary files for secure downloads

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference