Skip to main content

Returns calculations on portfolios in Beancount Resources

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beangrow-1.0.1.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beangrow-1.0.1-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file beangrow-1.0.1.tar.gz.

File metadata

  • Download URL: beangrow-1.0.1.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for beangrow-1.0.1.tar.gz
Algorithm Hash digest
SHA256 22fc0b9771e801cefc20ce1c3e3d856d6d6f0e5e50c91673cec72a6cc4a162b0
MD5 a72bb51af1e5b8f54a1e4d3b6b9b7e86
BLAKE2b-256 5e85a4745287bc09e662cca071404d628eca6b65a4f077df3aff5ddec4af0297

See more details on using hashes here.

File details

Details for the file beangrow-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: beangrow-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for beangrow-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe97967515ce70f9b7d80db8d2cedba2a23d9d50a5ebcf9d12d5e3fe9403a941
MD5 5918857d7f4d21af8bab51d6d8f8a73a
BLAKE2b-256 9f6e0389989b4d10ea993fe6f38e107c0e6e3fcbe4d91510b084a7160af75642

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page