The Python Book for Accountants

Stop clicking.
Start automating.

A hands-on guide that takes you from zero Python to automating real accounting workflows. Built around eight accounting datasets and the tools professionals actually use.

Python for Accounting front cover.

Trusted by professionals at

PwCDeloitteUniversity of MarylandJ.P. MorganGoldman Sachs

Join 2,000+ accountants already learning Python

Not ready to buy? Read chapter 1 free.

Enter your email and we'll send it instantly.

What you'll build

By the end of the book, you'll be running real accounting work in Python — not toy exercises. Here's a taste.

Clean messy SAP exports in minutes

Drop the point-and-click dance. A few lines of pandas turn a raw export into the shape you actually need.

import pandas as pd

ledger = pd.read_excel("sap_export.xlsx")
ledger = (ledger
    .dropna(subset=["Account"])
    .assign(Amount=lambda df: df["Amount"].abs())
    .query("Status == 'Posted'"))
ledger.to_excel("clean_ledger.xlsx", index=False)

Automate month-end workbook compilation

Stitch dozens of sheets into one reconciled workbook — the same way, every month, without a single copy-paste.

from pathlib import Path
import pandas as pd

files = Path("month_end").glob("*.xlsx")
books = [pd.read_excel(f) for f in files]
combined = pd.concat(books, ignore_index=True)
combined.to_excel("month_end_consolidated.xlsx")

Work with files Excel can't even open

Excel caps out at ~1M rows. Python is limited by your machine, not by a spreadsheet format from 2007.

import pandas as pd

txns = pd.read_csv("transactions_5M_rows.csv")
by_region = (txns
    .groupby("region")["amount"]
    .sum()
    .sort_values(ascending=False))
print(by_region.head())

Build charts that update themselves

Describe the chart you want once in code. Re-run it against new data and get the same perfectly-styled plot.

import pandas as pd
import matplotlib.pyplot as plt

cash_flow = pd.read_excel("cash_flow.xlsx")
cash_flow.plot.bar(x="month", y="net", color="#4F46E5")
plt.title("Monthly net cash flow")
plt.tight_layout()
plt.savefig("cash_flow.png", dpi=200)

What readers are saying

"

I recently landed an awesome role at an accounting consulting firm. A big reason why I landed it was because I knew Python, which I learned from your book! Thanks for creating such a valuable resource, it was tremendously helpful.

"

Gotta hand it to you and your team – you've done an awesome job! I've checked out a couple of Python books for accounting and finance before, and yours stands out for its easy-to-understand explanations.

"

A must read for any accountant looking to keep pace with modern data tools.

What's inside

The 395-page book, 8 real accounting datasets, an interactive notebook for every chapter, a one-click remote workspace, and a private Discord.

395
Pages
8
Real datasets
33
Chapters

The Book

A hands-on guide to Python and its data science tools focused on accounting tasks and data, spread across 300+ pages. The book takes you on a four-part journey:

Image of accounting data you will be using in the book.

The Projects & Data

Most Python tutorials are too vague for accounting. Python for Accounting teaches you how to use Python to work with real-world accounting data. We'll walk you through five hands-on projects:

Filtering and splitting a large Excel file into multiple sheets
Reading and cleaning a QuickBooks general ledger
Mining product reviews to discover what people like and dislike
Filling missing values in a spreadsheet using data from another file
Turning a cash flow statement into a waterfall plot

Get your copy

Choose the package that works for you.

Most popular

The Complete Guide

$199$129USD

  • The 395-page book in PDF format
  • All 8 accounting datasets
  • Interactive coding notebook for each chapter
  • One-click remote workspace access
  • Discord community access
  • All first edition updates
Buy now
30-day money-back guarantee
GumroadPowered by Gumroad

Buying for your team? View team pricing.

The Essential Guide

$79$49USD

 

  • The 395-page book in PDF format
  • All 8 accounting datasets
  • Interactive coding notebook for each chapter
Buy now
30-day money-back guarantee
GumroadPowered by Gumroad

Meet the authors

Photo of Horatio.
Horatio Bota
Data Scientist

Over seven years of experience in data analytics and data science. Previously at Microsoft, J.P. Morgan Chase, and several UK startups.

University of Glasgow · PhDMicrosoftJ.P. Morgan
Photo of Adrian.
Adrian Gosa
Senior Accountant

Over seven years of business and finance experience. M.A. in Business Economics and M.Sc. in Quantitative Finance.

University of GlasgowPwCDeloitteNike

Frequently Asked Questions

$79$49
Get the book