Asset Notation
v0.1.17Read 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.
| Parameter | Type | Description |
|---|---|---|
attributes | Free 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. | |
closedAt | string | |
currency | string | |
id | string | Id of the holding to update, or to give the new one. Omit it to mint one. |
institution | string | null | Name of the bank, broker or lender. Matched by name, created when new. null removes it. |
instrumentId | string | null | Id of the instrument held. null removes it. |
kind | string | checking, savings, brokerage, retirement, real_estate, crypto, loan, mortgage, credit_card, other... |
label | string | What the person calls it: "Current account", "Flat on Main St". |
nature | string | asset (owned) or liability (owed). New holdings default to asset. |
openedAt | string | |
parentId | string | null | Id of the holding that contains this one, such as the account holding a position. null removes it. |
quantity | string | Units 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.
| Parameter | Type | Description |
|---|---|---|
amount * | string | The value as a decimal STRING, positive for both assets and debts. |
asOf * | string | The date the value is true for. |
currency * | string | |
holdingId * | string | The holding this value belongs to. |
confidence | number | |
quantity | string | Units held on that date, as a decimal string. |
source | string | Where 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.
| Parameter | Type | Description |
|---|---|---|
csv * | string | The spreadsheet text, with a header row. Columns: label, amount, asOf, currency, kind, nature, institution, source, id. |
baseCurrency | string | Currency of rows that name none. |