Skip to content

A clean and professional Python tool that generates PDF invoices from CSV files. Built with reportlab and designed as a modular portfolio project.

Notifications You must be signed in to change notification settings

nbilabsystems/smartinvoice_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartInvoice Generator 💼

SmartInvoice Generator is a clean, professional Python tool that creates PDF invoices from CSV files.

It is designed as a real-world portfolio project:

  • 🧩 Modular architecture
  • 🧠 Clear separation of CLI, data logic, and PDF generation
  • 🖨️ PDF creation using reportlab
  • 📜 Logging system
  • 🚀 Ready to extend with more metadata later

✨ Features

  • 📥 Read invoice line items from a CSV file
  • 🧮 Compute subtotal, tax, discount, and final total
  • 📄 Generate a clean A4 PDF invoice containing:
    • 🏷️ Header (project title, invoice number, date)
    • 👤 Customer info
    • 📋 Line items table
    • ✅ Totals block
  • 📝 Log each generated invoice to logs/invoices.log
  • 🧰 Two execution modes:
    • python main.py
    • python -m smartinvoice.cli

🗂 Project Structure

smartinvoice_generator/
├── data/
│   └── sample_invoice.csv
├── logs/
│   └── .gitkeep
├── output/
├── smartinvoice/
│   ├── __init__.py
│   ├── invoice_data.py
│   ├── pdf_generator.py
│   ├── invoice_builder.py
│   └── cli.py
├── main.py
├── README.md
└── requirements.txt

🛠 Installation

Make sure you have Python 3.10+ installed.

Clone the repository:

git clone https://github.com/<your-username>/smartinvoice-generator.git
cd smartinvoice-generator

Create and activate a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Install dependencies:

pip install -r requirements.txt

▶️ Usage

1️⃣ Using the main entry point

python main.py data/sample_invoice.csv

2️⃣ Using the CLI module

python -m smartinvoice.cli data/sample_invoice.csv

Both methods generate a PDF invoice in the output/ directory.


📊 CSV Format Example

description,quantity,unit_price
Website design package,1,1500
Monthly hosting (12 months),12,25
Domain registration,1,15

🔭 Future Improvements (Roadmap)

  • 📁 Move invoice metadata (customer info, invoice number, etc.) into a config file
  • 🖼️ Support embedding company logo
  • 🧾 Add multiple invoice templates
  • 💱 Add currency formatting options
  • 📦 Package as a pip installable module
  • 🌐 Add web UI (Flask or FastAPI)

📄 License

MIT License — free to use, modify, and share.

About

A clean and professional Python tool that generates PDF invoices from CSV files. Built with reportlab and designed as a modular portfolio project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages