Skip to content

feat: add bean-price command for fetching commodity prices - #25

Merged
robcohen merged 3 commits into
mainfrom
feat/price-fetching
Jan 11, 2026
Merged

robcohen merged 3 commits into
mainfrom
feat/price-fetching

Conversation

@robcohen

Copy link
Copy Markdown
Member

Summary

  • Add bean-price/rledger-price command for fetching commodity prices
  • Uses Yahoo Finance API for stock/crypto prices
  • Supports custom symbol mappings (e.g., -m BTC:BTC-USD)
  • Outputs beancount price directives

Test plan

  • cargo test passes
  • Test with stock symbols (AAPL, MSFT)
  • Test with crypto (BTC, ETH via mapping)

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jan 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.47368% with 130 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/rustledger/src/cmd/price_cmd.rs 15.06% 124 Missing ⚠️
crates/rustledger/src/bin/bean_price.rs 0.00% 3 Missing ⚠️
crates/rustledger/src/bin/rledger_price.rs 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@robcohen
robcohen added this pull request to the merge queue Jan 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jan 11, 2026
robcohen and others added 3 commits January 10, 2026 21:32
Implement rledger-price/bean-price CLI tool to fetch current prices
from Yahoo Finance API for commodities defined in beancount files.

Features:
- Fetch prices for stock symbols (AAPL, MSFT, VTI, etc.)
- Support for cryptocurrency via symbol mapping (-m BTC:BTC-USD)
- Output as beancount price directives (-b flag)
- Read commodities from beancount files (-f flag)
- Configurable base currency (-c flag)
- Custom date support (-d flag)

Example usage:
  rledger-price AAPL MSFT -b
  rledger-price -f ledger.beancount -b
  rledger-price -m BTC:BTC-USD,ETH:ETH-USD BTC ETH -b

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace `.and_then(|p| p.as_f64())` with `.and_then(serde_json::Value::as_f64)`
to satisfy clippy::redundant_closure_for_method_calls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@robcohen
robcohen force-pushed the feat/price-fetching branch from 3451185 to 030081a Compare January 11, 2026 03:34
@robcohen
robcohen enabled auto-merge January 11, 2026 03:34
@robcohen
robcohen added this pull request to the merge queue Jan 11, 2026
Merged via the queue into main with commit e62da09 Jan 11, 2026
@robcohen
robcohen deleted the feat/price-fetching branch January 11, 2026 03:45
robcohen added a commit that referenced this pull request Jan 14, 2026
feat: add bean-price command for fetching commodity prices
robcohen added a commit that referenced this pull request Jan 14, 2026
feat: add bean-price command for fetching commodity prices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant