Skip to content

API Reference parrot.semantic.accounting.snapshot

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.semantic.accounting.snapshot

View source

Chart-of-accounts snapshot builders (FEAT-713 M4). Never opens a connection.

Alias ChartAccount

Re-exported from parrot.semantic.accounting.models.ChartAccount.

Alias ChartSnapshot

Re-exported from parrot.semantic.accounting.models.ChartSnapshot.

Function snapshot_from_arrow

Same as snapshot_from_rows over table.to_pylist().

snapshot_from_arrow(table: 'pa.Table', *, account_key: str, nature_column: str | None, parent_column: str | None = None, tags_column: str | None = None, source: str, taken_at: date) -> ChartSnapshot

Parameter Type Default Description
table 'pa.Table' Arrow table of account-master rows.
account_key str Column holding the account id.
nature_column str | None Column holding the account nature, or None.
parent_column str | None None Optional column holding the parent account id.
tags_column str | None None Optional column holding tags.
source str Provenance label recorded on the snapshot.
taken_at date Date the account master was read.

Returns: ChartSnapshot — The snapshot, accounts sorted by account id.

Function snapshot_from_manifest

YAML (taken_at + accounts list) or CSV (columns account_id, nature, parent_id, tags) manifest.

snapshot_from_manifest(path: Path) -> ChartSnapshot

Parameter Type Default Description
path Path .yaml/.yml or .csv manifest file.

Returns: ChartSnapshot — The snapshot, with source set to manifest:<path>.

Raises:

  • ValueError — Unsupported suffix or malformed manifest.

Function snapshot_from_rows

Build the sorted, hashed snapshot from account-master rows (dict rows from the executor).

snapshot_from_rows(rows: Sequence[Mapping[str, Any]], *, account_key: str, nature_column: str | None, parent_column: str | None = None, tags_column: str | None = None, source: str, taken_at: date) -> ChartSnapshot

Parameter Type Default Description
rows Sequence[Mapping[str, Any]] Account-master rows, one mapping per account.
account_key str Column holding the account id.
nature_column str | None Column holding the account nature (debit/credit, any case); None when the account master carries no nature.
parent_column str | None None Optional column holding the parent account id.
tags_column str | None None Optional column holding tags (a list or a comma-separated string).
source str Provenance label recorded on the snapshot.
taken_at date Date the account master was read.

Returns: ChartSnapshot — The snapshot, accounts sorted by account id.

Raises:

  • ValueError — A row lacks an account id, carries an invalid nature, or an account id repeats.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally