Post: A Posting Line#
- class means.types.Post.Post(*, acct: Account, amnt: float = 0.0, unit: tuple[str, str] = ('', ''), asrt: str = '')#
A single posting line: an account, a signed amount, a unit, and an optional assertion.
I Construction and Serialization#
- classmethod Post.new(text: str) Self#
Parse a post from one posting line of ledger text.
- Parameters:
text – The raw posting line, e.g.
costs:sh:food $12.34 = $56.78.- Returns:
The parsed post, with the amount’s sign and unit affixes normalized.
- Post.serialize(last: bool = False) str#
Render this post as an aligned ledger posting line.
- Parameters:
last – Whether this is the final post of a transaction, whose amount may be elided.
- Returns:
The formatted posting line.
II Classification#
- Post.type#
The account type of this post’s account.