From 758d02db8e83ac416a0b6e5dc39b45e7e37c68e2 Mon Sep 17 00:00:00 2001 From: Chris Berkhout Date: Sun, 30 May 2021 14:36:08 +0200 Subject: [PATCH] Tidy comment. --- src/pricehist/outputs/ledger.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/pricehist/outputs/ledger.py b/src/pricehist/outputs/ledger.py index c030f9a..474d2ee 100644 --- a/src/pricehist/outputs/ledger.py +++ b/src/pricehist/outputs/ledger.py @@ -14,6 +14,23 @@ class Ledger(BaseOutput): lines.append(f"P {date} {fmt.time} {base} {quote_amount}") return "\n".join(lines) + "\n" - # TODO support additional details of the format: # https://www.ledger-cli.org/3.0/doc/ledger3.html#Commodities-and-Currencies + # > The commodity may be any non-numeric string that does not contain a + # > period, comma, forward slash or at-sign. It may appear before or after + # > the amount, although it is assumed that symbols appearing before the + # > amount refer to currencies, while non-joined symbols appearing after the + # > amount refer to commodities. + # https://www.ledger-cli.org/3.0/doc/ledger3.html#Commoditized-Amounts + # > A commoditized amount is an integer amount which has an associated + # > commodity. This commodity can appear before or after the amount, and may + # > or may not be separated from it by a space. Most characters are allowed + # > in a commodity name, except for the following: + # > - Any kind of white-space + # > - Numerical digits + # > - Punctuation: .,;:?! + # > - Mathematical and logical operators: -+*/^&|= + # > - Bracketing characters: <>[](){} + # > - The at symbol: @ + # > And yet, any of these may appear in a commodity name if it is + # > surrounded by double quotes