Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jbms/finance-dl/llms.txt

Use this file to discover all available pages before exploring further.

The finance_dl.pge scraper downloads Pacific Gas and Electric (PG&E) monthly bills as PDF files using selenium and chromedriver. Each bill is saved with a filename derived from its statement date, making it straightforward to sort and archive your utility history. The PDFs are text-based and can be processed with pdftotext to extract line items for use with beancount-import or other accounting tools.

Configuration Parameters

credentials
dict
required
A dictionary containing your PG&E online account login credentials.
output_directory
string
required
Path on the local filesystem where PDF bill files will be saved. The directory is created automatically if it does not already exist.
stop_early
bool
default:"True"
When True, the scraper stops after it encounters the most recent bill that is already present in output_directory. This allows incremental runs to complete quickly without re-downloading the full history.
profile_dir
string
Path to a persistent Chrome browser profile directory used exclusively for this scraper. Do not point this at your regular browser profile. When omitted, a fresh temporary profile is used on every run.

Output Format

Each bill is saved to output_directory as a PDF file named by its statement date:
YYYY-MM-DD.bill.pdf
For example, a bill with a statement date of November 28, 2017 is saved as 2017-11-28.bill.pdf.
PG&E bills are text-based PDFs. Run pdftotext 2017-11-28.bill.pdf to extract the plain-text content for parsing with beancount-import or similar tools.

Config Example

def CONFIG_pge():
    return dict(
        module='finance_dl.pge',
        credentials={
            'username': 'XXXXXX',
            'password': 'XXXXXX',
        },
        output_directory=os.path.join(data_dir, 'pge'),
    )

Interactive Shell

From the finance-dl interactive shell, start the scraper with:
self.run()

Build docs developers (and LLMs) love