Skip to main content

Compute Returns

This directory contains code which computes investment returns on a variety of assets, as recorded by Beancount, fed directly from a Beancount file.

See this document for details: https://docs.google.com/document/d/1nPsMIunLnDvdsg6TSsd0PZb7jngojNpFlqnaX36WRp8/

Scripts

There are three related scripts:

  • configure.py: This attempts to automatically infer and generate configuration to compute returns from an existing Beancount ledger.

  • compute_returns.py: This extracts data for each of the investments defined in the configuration and computes the returns and generates output for each requested returns report.

  • download_prices.py: The compute_returns.py script outputs a list of missing (or inadequately dated) price directives to properly do its job as a side-product. This script can read that file and fetch those missing dates, which you can insert in your ledger and then rerun compute_returns.py for a more precise calculation.

Example

To run the example:

cd example
uv run beangrow-returns ledger.beancount config.pbtxt ./reports

The reports are available at example/reports/groups.

Metadata

Release files for beangrow 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beangrow 1.0.1
File Size Uploaded
beangrow-1.0.1.tar.gz 31.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beangrow 1.0.1
File Interpreter ABI Platform
beangrow-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 59.9 kB

Release files / beangrow-1.0.1.tar.gz

Download URL beangrow-1.0.1.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
22fc0b9771e801cefc20ce1c3e3d856d6d6f0e5e50c91673cec72a6cc4a162b0
BLAKE2b-256 checksum
How to use checksums
5e85a4745287bc09e662cca071404d628eca6b65a4f077df3aff5ddec4af0297
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.24

Release files / beangrow-1.0.1-py3-none-any.whl

Download URL beangrow-1.0.1-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe97967515ce70f9b7d80db8d2cedba2a23d9d50a5ebcf9d12d5e3fe9403a941
BLAKE2b-256 checksum
How to use checksums
9f6e0389989b4d10ea993fe6f38e107c0e6e3fcbe4d91510b084a7160af75642
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.24

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page