Skip to content

API Reference parrot_tools.hooba.toolkit

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.hooba.toolkit

View source

HoobaToolkit — drafts-only Hooba automation for AI-Parrot agents (FEAT-602 M6).

Alias BbvaImporter

Re-exported from parrot_tools.hooba.importer.BbvaImporter.

Alias ContactDraft

Re-exported from parrot_tools.hooba.models.ContactDraft.

Alias ContactMatch

Re-exported from parrot_tools.hooba.models.ContactMatch.

Alias ContactReceipt

Re-exported from parrot_tools.hooba.models.ContactReceipt.

Alias DraftReceipt

Re-exported from parrot_tools.hooba.models.DraftReceipt.

Alias ExpenseDraftBatch

Re-exported from parrot_tools.hooba.models.ExpenseDraftBatch.

Alias HoobaLookupError

Re-exported from parrot_tools.hooba.models.HoobaLookupError.

Alias HoobaOpenAPIToolkit

Re-exported from parrot_tools.hooba.openapi.HoobaOpenAPIToolkit.

Alias HoobaSettings

Re-exported from parrot_tools.hooba.settings.HoobaSettings.

Alias HoobaStateError

Re-exported from parrot_tools.hooba.models.HoobaStateError.

Class HoobaToolkit

Create Hooba invoice and expense DRAFTS, never issue or confirm them.

Parameter Type Default Description
settings Optional[HoobaSettings] None
credential_broker Optional[CredentialBroker] None
api Optional[HoobaOpenAPIToolkit] None
web Optional[HoobaWebAdapter] None
rules_path Optional[str] None
headless bool True
**kwargs Any {}

Method HoobaToolkit.get_tools

Return composite and generated API tools, rejecting duplicate names.

get_tools(permission_context: Any = None, resolver: Any = None) -> list[AbstractTool]

Parameter Type Default Description
permission_context Any None
resolver Any None

Returns: list[AbstractTool]

Method HoobaToolkit.operation_kinds

Map every composite and generated tool name to its operation kind.

_READ_TOOLS and _DRAFT_TOOLS (TASK-3743's draft/attach/import composite tools) plus the bound API toolkit's own generated tools.

operation_kinds() -> Dict[str, OperationKind]

Returns: Dict[str, OperationKind]

Method HoobaToolkit.hooba_whoami

Return the authenticated Hooba member summary.

hooba_whoami() -> dict

Returns: dict

Method HoobaToolkit.hooba_create_contact

Create a supplier/customer contact, or reuse the existing one with the same TIN.

hooba_create_contact(contact: ContactDraft) -> dict

Parameter Type Default Description
contact ContactDraft Legal name, TIN (NIF/CIF or VAT number), country and legal type.

Returns: dict — ToolResult dict whose result is a ContactReceipt (reused True when the TIN already existed).

Method HoobaToolkit.hooba_find_contact

Find contacts by fuzzy legal, trade, or personal name similarity.

hooba_find_contact(query: str, limit: int = 5) -> dict

Parameter Type Default Description
query str
limit int 5

Returns: dict

Method HoobaToolkit.hooba_list_drafts

List the newest Hooba invoice or purchase-invoice drafts.

hooba_list_drafts(kind: Literal['invoice', 'purchase_invoice'], limit: int = 50) -> dict

Parameter Type Default Description
kind Literal['invoice', 'purchase_invoice']
limit int 50

Returns: dict

Method HoobaToolkit.hooba_download_invoice_pdf

Download an invoice PDF into the state directory with owner-only permissions.

hooba_download_invoice_pdf(invoice_id: int, dest_dir: Optional[str] = None) -> dict

Parameter Type Default Description
invoice_id int
dest_dir Optional[str] None

Returns: dict

Method HoobaToolkit.hooba_recover_web_session

Recover a browser session and inject its sid cookie into the API jar.

hooba_recover_web_session() -> dict

Returns: dict

Method HoobaToolkit.hooba_run_web_action

Run a private-catalog navigation action without exposing write actions.

hooba_run_web_action(action: str, params: Optional[dict] = None) -> dict

Parameter Type Default Description
action str
params Optional[dict] None

Returns: dict

Method HoobaToolkit.hooba_create_invoice_draft

Create a sales invoice in DRAFT state (never issued).

hooba_create_invoice_draft(draft: InvoiceDraft) -> dict

Parameter Type Default Description
draft InvoiceDraft Contact, serie, lines (name, price, quantity, tax code). Exactly one of contact_id / contact_query.

Returns: dict — ToolResult dict whose result is a DraftReceipt (reused True when a partial draft was completed).

Method HoobaToolkit.hooba_create_purchase_invoice_draft

Declare an expense / purchase as a purchase-invoice DRAFT (never confirmed).

hooba_create_purchase_invoice_draft(draft: PurchaseInvoiceDraft) -> dict

Parameter Type Default Description
draft PurchaseInvoiceDraft

Returns: dict

Method HoobaToolkit.hooba_attach_document

Attach a file (receipt, ticket PDF) to an invoice or purchase invoice.

hooba_attach_document(entity: Literal['invoice', 'purchase_invoice'], entity_id: int, file_path: str) -> dict

Parameter Type Default Description
entity Literal['invoice', 'purchase_invoice'] Which draft kind the file attaches to.
entity_id int The invoice or purchase-invoice id.
file_path str Local path of the file to upload.

Returns: dict — ToolResult dict whose result is the created Hooba document.

Method HoobaToolkit.hooba_reconcile_bank_statement

Pair purchase invoices with the BBVA debits that paid them; optionally confirm and pay them.

Only invoices matched to a debit (same supplier, amount within 1 cent, value date 2 days before to 12 days after the invoice date) are touched: each draft is confirmed and gets one payment for its outstanding amount, dated on the debit, with the payment method implied by the movement (card, direct debit, transfer). Unmatched invoices stay as they are.

hooba_reconcile_bank_statement(path: str, dry_run: bool = True, bank_account_id: Optional[int] = None) -> dict

Parameter Type Default Description
path str Local path of the BBVA .xlsx export.
dry_run bool True When True (default), only report the pairing — nothing is written to Hooba.
bank_account_id Optional[int] None Account bank account the debits came from (default: the account's default one).

Returns: dict — ToolResult dict with matched, unmatched_invoices and, when applied, applied plus per-invoice errors (a failing invoice never stops the others).

Method HoobaToolkit.hooba_import_bbva_statement

Turn a BBVA movements Excel into purchase-invoice drafts (dry run by default).

hooba_import_bbva_statement(path: str, period: str, dry_run: bool = True) -> dict

Parameter Type Default Description
path str Local path of the BBVA .xlsx export.
period str Accounting period label, e.g. "2026-09".
dry_run bool True When True, plan only — nothing is sent to Hooba.

Returns: dict — ToolResult dict whose result is an ExpenseDraftBatch.

Alias HoobaWebAdapter

Re-exported from parrot_tools.hooba.web.HoobaWebAdapter.

Alias InvoiceDraft

Re-exported from parrot_tools.hooba.models.InvoiceDraft.

Alias OperationKind

Re-exported from parrot_tools.business_automation.models.OperationKind.

Alias PurchaseInvoiceDraft

Re-exported from parrot_tools.hooba.models.PurchaseInvoiceDraft.

Alias RuleEngine

Re-exported from parrot_tools.hooba.rules.RuleEngine.

Alias bank_marker

Re-exported from parrot_tools.hooba.reconcile.bank_marker.

Alias make_login_hook

Re-exported from parrot_tools.hooba.credentials.make_login_hook.

Alias manifest_path_for

Re-exported from parrot_tools.hooba.bank.manifest_path_for.

Alias match_charges

Re-exported from parrot_tools.hooba.reconcile.match_charges.

Alias parse_bbva_statement

Re-exported from parrot_tools.hooba.bank.parse_bbva_statement.

Alias payment_method_urn

Re-exported from parrot_tools.hooba.reconcile.payment_method_urn.

Alias reconcile

Re-exported from parrot_tools.hooba.bank.reconcile.

Alias register_hooba_provider

Re-exported from parrot_tools.hooba.credentials.register_hooba_provider.

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