#ledger #ledger-cli #finance #cli

bin+lib pricedb

Commodity price retrieval, storage, and export in format compatible with Plain-Text Accounting applications

29 releases (stable)

new 1.5.5 Jan 28, 2023
1.5.4 Jan 24, 2023
1.3.5 Dec 29, 2022
0.9.9 Dec 9, 2022

#5 in Finance

Download history 342/week @ 2022-12-07 40/week @ 2022-12-14 64/week @ 2022-12-21 80/week @ 2022-12-28 95/week @ 2023-01-04 110/week @ 2023-01-11 110/week @ 2023-01-18 66/week @ 2023-01-25

394 downloads per month




Retrieving, storing, and exporting commodity prices in Ledger format


This utility downloads and stores commodity prices used by Ledger-cli.

It stores the prices in an Sqlite database.

This is a continuation of the Price Database project. The previous version was implemented in Python. It has been migrated to Rust.



Before usage, you need to add the paths to the configuration file. Run pricedb config show to see the location of the file.

It is located in the user's config directory, i.e. ~/.config/pricedb/pricedb.toml or C:\Users\<user>\AppData\Roaming\pricedb\config\pricedb.toml.

Populate the price_database_path with the full path to the db file, i.e. /my_files/prices.db. export_destination is the path to the file into which the prices will be exported.

Data Store

A template database file is available at the data directory in the Python repository. This can be used temporarily, until the database initialization scripts are consolidated.

This manual method currently used to bootstrap the database file. The functionality to automatically generate the database file will be implemented as a command. It is currently only used in tests.


The application is a Command-Line Interface (CLI) and displays the available options when run. The most-common commands:

pricedb dl
pricedb prune
pricedb export

Change Log

See here.



When not using "bundled" option for libsqlite-sys, on Debian:

export SQLITE3_LIB_DIR=/usr/lib/x86_64-linux-gnu/
export SQLITE3_INCLUDE_DIR=/usr/include/


~794K SLoC