Asset Notation

v0.1.17
io.github.assetnotation/asset-notation Checked 21 hours ago Published 17 days ago

Read and maintain an Asset Notation file on disk: net worth, holdings, valuations, CSV import.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

read_document

Read the whole Asset Notation document: every holding (account, property, loan...), institution, valuation and ownership share. Use it when you need a detail list_holdings and net_worth do not give.

net_worth

What the person is worth: assets minus liabilities, per currency, from the latest valuation of each holding, summed exactly. Also tells the date of the oldest valuation used and the holdings that have none. Call it when asked for net worth, total wealth or a summary.

list_holdings

List every holding with its institution name and latest valuation. Call it before updating or valuing a holding, to find its id.

upsert_holding

Create a holding (an account, a property, a loan...) or update the fields given on the one with that id; fields you do not pass are kept. Creates the file when it does not exist. Does not record a value: call add_valuation for that.

ParameterTypeDescription
attributesFree key-values: rate, endDate, payment... Merged key by key: a key set to null is removed, a key left out is kept. null removes them all.
closedAtstring
currencystring
idstringId of the holding to update, or to give the new one. Omit it to mint one.
institutionstring | nullName of the bank, broker or lender. Matched by name, created when new. null removes it.
instrumentIdstring | nullId of the instrument held. null removes it.
kindstringchecking, savings, brokerage, retirement, real_estate, crypto, loan, mortgage, credit_card, other...
labelstringWhat the person calls it: "Current account", "Flat on Main St".
naturestringasset (owned) or liability (owed). New holdings default to asset.
openedAtstring
parentIdstring | nullId of the holding that contains this one, such as the account holding a position. null removes it.
quantitystringUnits held, as a decimal string.

add_valuation

Record what a holding was worth on a date. Adds to the history, never replaces: the latest date wins in net_worth. Amounts are decimal strings, positive for assets and for debts alike.

ParameterTypeDescription
amount *stringThe value as a decimal STRING, positive for both assets and debts.
asOf *stringThe date the value is true for.
currency *string
holdingId *stringThe holding this value belongs to.
confidencenumber
quantitystringUnits held on that date, as a decimal string.
sourcestringWhere the number comes from: statement, market, estimate, user...

validate

Judge the document against its declared schema version and the integrity rules. Returns valid, errors (faults) and notes (true observations that are not faults).

import_csv

Merge a spreadsheet (CSV text, one row per holding with label, amount, asOf...) into the document. Rows match existing holdings by id or label and update them; the rest become new holdings. Each amount becomes a valuation. Comma or semicolon separated, decimals with a point or a comma. Creates the file when it does not exist.

ParameterTypeDescription
csv *stringThe spreadsheet text, with a header row. Columns: label, amount, asOf, currency, kind, nature, institution, source, id.
baseCurrencystringCurrency of rows that name none.