Menu

1 / 2

Python for Freelancers: Automate Invoicing, Follow-ups, and Time Tracking

DEV Community·Brad·6 months ago
#opL7ZGrY
Reading 0:00
15s threshold

Running a freelance business means juggling invoices, client emails, and time tracking. Most freelancers waste 5-10 hours per week on admin.

Python automates nearly all of it. Here are 4 scripts I use daily:

1. PDF Invoice Generator

from fpdf import FPDF import datetime

def create_invoice ( client_name , hours , rate , project_desc ): pdf = FPDF () pdf . add_page () pdf . set_font ( " Helvetica " , size = 16 )

total = hours * rate pdf . cell ( 200 , 10 , txt = " INVOICE " , ln = True , align = " C " ) pdf . set_font ( " Helvetica " , size = 12 ) pdf . cell ( 200 , 8 , txt = " Client: " + client_name , ln = True ) pdf . cell ( 200 , 8 , txt = " Project: " + project_desc , ln = True ) pdf . cell ( 200 , 8 , txt = " Hours: " + str ( hours ) + " @ $ " + str ( rate ) + " /hr " , ln = True ) pdf . set_font ( " Helvetica " , " B " , size = 14 ) pdf . cell ( 200 , 10 , txt = " TOTAL: $ " + str ( total ), ln = True )

filename = " invoice_ " + client_name + " .pdf " pdf .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.