finance-dl is driven entirely by a plain Python configuration module that you write once and reuse across every scrape. This page shows you how to create that config file, add scraper configurations for both an OFX-based source (Vanguard) and a Selenium-based source (Amazon), and invoke the CLI to start downloading data to your local filesystem.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.
finance-dl appends the current working directory to
sys.path at startup, so your config module is found automatically as long as you run the finance-dl command (or python -m finance_dl.cli) from the same directory that contains your config file. No PYTHONPATH changes or package installs are needed for the config module itself.Create your config module
Create a new Python file named Replace
finance_dl_config.py in a directory of your choice. This file will hold all of your scraper configurations.Start with the common boilerplate — a directory for saved browser profiles (avoids re-entering MFA codes) and a root data directory for downloaded files:/path/where/data/will/be/saved with an absolute path on your machine, for example os.path.expanduser('~/finance-data').Add an OFX configuration (Vanguard example)
For institutions that support OFX Direct Connect, define a OFX scrapers connect directly to the institution’s server — no browser or ChromeDriver required. The
CONFIG_<name>() function that returns a dictionary with module='finance_dl.ofx' and an ofx_params block.output_directory will be created automatically on first run, and downloaded OFX files are written there atomically.Add a Selenium configuration (Amazon example)
For institutions without an OFX endpoint, define a Selenium scrapers run headless by default. If the first attempt fails (for example, due to an MFA prompt), finance-dl automatically retries with the browser window visible so you can complete the login manually.
CONFIG_<name>() function that returns a dictionary pointing to the appropriate Selenium scraper module. Include a profile_dir to persist browser session state across runs:Run a scraper from the command line
Open a terminal, navigate to the directory containing Or, if you installed via pip, use the installed entry point:finance-dl will:Downloaded files accumulate in the
finance_dl_config.py, and run:- Import
finance_dl_configand callCONFIG_vanguard() - Load the
finance_dl.ofxmodule - Connect to the Vanguard OFX endpoint and download transactions
- Write output files to the
output_directoryyou configured
output_directory. Existing files are never overwritten — new data is written atomically alongside them.Understand the CLI flags
The full set of CLI flags available via
Using
python -m finance_dl.cli:| Flag | Short | Description |
|---|---|---|
--config-module | Python module name defining CONFIG_<name> functions | |
--config | -c | Name of the configuration to run (calls CONFIG_<name>()) |
--spec | -s | JSON configuration specification as a literal string; mutually exclusive with --config |
--interactive | -i | Launch an IPython shell for manual inspection and debugging |
--visible | Run the browser in a visible window (implied by --interactive) | |
--log | Log level: DEBUG, INFO, WARNING, ERROR (default: INFO) |
--spec instead of --config:If you want to run a one-off scrape without a config file, pass the full configuration as a JSON string:--config and --spec are mutually exclusive — you must use one or the other.Debug with interactive mode
When a scraper fails or you want to explore its internals, add the Interactive mode:
-i flag to drop into an IPython shell after the browser has launched:- Forces the browser to run visibly (not headless), so you can watch and interact with the Chrome window
- Opens an IPython shell with the scraper module’s namespace loaded, giving you direct access to all scraper functions and the live browser session
- Enables
%autoreloadso edits to your scraper code take effect without restarting
Tips for Credentials Management
Hard-coding usernames and passwords in your config file works but is not recommended for sensitive accounts. Instead, prompt at runtime or pull from a password manager:Next Steps
Introduction
Learn about all 18+ supported data sources and how finance-dl’s two scraping mechanisms work.
Installation
Review ChromeDriver setup and version-matching requirements for Selenium scrapers.