Skip to content

Releases: robert-malai/anafpy

anafpy 0.3.1 — Romanian setup guide

Choose a tag to compare

@robert-malai robert-malai released this 13 Jul 15:07

Patch release: documentation catch-up, no library API changes.

Docs

  • Romanian translation of the MCP setup walkthrough (docs/mcp/setup.ro.md), cross-linked with the English page and added to the site nav; the README links both.
  • Documented the personal-income-summary workflow skill (shipped in the code as of the previous commit) in docs/mcp/skills.md and the README.

Included since 0.3.0

  • personal-income-summary SPV workflow skill (income certificates + D212 → per-year summary, optional Excel).
  • Windows-on-ARM SPV bootstrap: ANAFPY_SPV_CURL override + Schannel pin.

Install: pip install 'anafpy[mcp]'

anafpy 0.3.0 — SPV read-only mailbox

Choose a tag to compare

@robert-malai robert-malai released this 13 Jul 01:29

Highlights

SPV (Spațiul Privat Virtual) read-only mailbox — a new certificate-authenticated layer (anafpy.spv):

  • SpvClient (async): list_messages (paged, with the certificate's authorization inventory), download_document (PDF), request_report — the full cerere nomenclature, 35 report types with per-type parameter validation (fiscal vector, outstanding obligations, filing history, declaration/receipt duplicates, income certificates, …) — and wait_for_report.
  • The qualified certificate (USB token / cloud HSM, non-exportable keys) is touched only by the interactive login bootstrap, which drives the OS-shipped curl against the platform key store: macOS Keychain/SecureTransport, Windows CertStore/Schannel. Everything after rides a persisted APM cookie session, prompt-free.
  • New CLI: anafpy spv certs | select | login | status | logout.

MCP server additions — SPV as read-only tools: spv_status, spv_lista_mesaje, spv_descarca / spv_asteapta_raport (PDFs to disk with collision guards), spv_cerere (same-day request dedupe guards agent loops), spv_nomenclature (report types with English descriptions), certificate selection, and a confirm-gated spv_login. A message's document is also served as the spvmsg://{mesaj_id}/pdf resource.

Internals & infrastructure

  • The MCP module was restructured by service (efactura/, etransport/, public/, spv/ over a shared two-step filing gate).
  • CI now runs the test suite on ubuntu, macOS, and Windows (the SPV layer has platform seams), on Python 3.12 and 3.13.
  • README badge row and Codecov coverage reporting (generated model packages excluded from measurement).

Full changelog: v0.2.1...v0.3.0

🤖 Generated with Claude Code

v0.2.1 — brand assets

Choose a tag to compare

@robert-malai robert-malai released this 12 Jul 12:22

A cosmetic release: anafpy gets a face.

  • New brand assets under imgs/ — icon (SVG + PNGs), wordmark, and a social-preview card. The README now opens with the banner (rendered on GitHub and PyPI).
  • Docs site branding — the icon is the Material theme logo and favicon; the landing page opens with a theme-aware wordmark hero (an SVG pair switched by Material's #only-light/#only-dark, so it follows the site's light/dark toggle).

No code changes — the clients, authoring models, and MCP server are untouched from v0.2.0.

v0.2.0 — structured e-Factura authoring

Choose a tag to compare

@robert-malai robert-malai released this 08 Jul 15:48

✍️ anafpy can now author CIUS-RO invoices from scratch — no upstream invoicing system required.

Until now, e-Factura outbound was XML pass-through only: bring the complete
UBL XML your invoicing software exported. This release adds a second,
first-class path for callers with no upstream system of their own —
structured authoring (anafpy.efactura.authoring):

  • One bidirectional flat model, InvoiceDocument, covers both invoices and
    credit notes (kind picks the render target), with computed totals and
    VAT breakdown (explicit overrides preserved).
  • A hand-translated EN 16931 + CIUS-RO rule set (validate()) returns
    findings tagged with official BR-* rule ids — ANAF's own validare
    endpoint stays authoritative; this is a local, informational pre-check.
  • Byte-stable round-trips: render_invoice / read_invoice / parse_invoice.
  • Wired into EFacturaClient.upload_invoice (flat model → XML → upload) and
    the MCP server's two-step gated filing tools (efactura_prepare_invoice
    efactura_submit), alongside the existing XML pass-through tools.
  • The e-Factura inbox now reads downloads through the same strict
    read_invoice: DownloadedMessage.view never raises — None when the
    content isn't representable, with raw bytes and the full UBL model as the
    fallback tiers.
  • A live-suite CIUS-RO drift tripwire files a minimal invoice via the
    authoring path and cross-checks local validate() verdicts against ANAF's
    own validare, so a future CIUS-RO revision announces itself.

As with everything in anafpy, the durable record of a filed invoice is the
caller's responsibility — ANAF's SPV purges filed messages after ~60 days;
it is not invoice storage. XML pass-through remains the strongly recommended
path whenever an upstream invoicing system already produces the document.

Install: pip install anafpy · pip install 'anafpy[mcp]'
Docs: https://anafpy.readthedocs.io/en/latest/library/authoring/

v0.1.2 — the documentation site

Choose a tag to compare

@robert-malai robert-malai released this 07 Jul 09:42

📚 anafpy now has proper documentation: https://anafpy.readthedocs.io

This release (together with v0.1.1, which this supersedes as the docs-site
release) contains no library changes — the Python API is identical to
0.1.0. It exists so the documentation site has a buildable, taggable home:

  • Documentation site on Read the Docs, organized by audience:
    • Using with Claude (MCP) — the end-user setup walkthrough (ANAF app
      registration, the one-time certificate login, Claude Desktop/Cowork
      configuration), the full tool reference, and the workflow skills.
      This replaces the old repo-root INSTALL.md.
    • Python library — quickstart, authentication, e-Factura, e-Transport,
      public services, and the error model, plus an API reference generated
      from the docstrings.
    • The compiled ANAF API reference (OAuth, e-Factura, e-Transport,
      public services — English, with provenance back to ANAF's originals)
      is now published as part of the site.
  • README slimmed to a landing page that links into the site.
  • CI now builds the docs strictly (broken internal links fail the build),
    on every push/PR and on release tags.
  • DESIGN.md stays in the repository root as developer/contributor
    reference — it is deliberately not part of the site.

Install: pip install anafpy · pip install 'anafpy[mcp]'
Full walkthrough for accountants: https://anafpy.readthedocs.io/en/latest/mcp/setup/

anafpy 0.1.0

Choose a tag to compare

@robert-malai robert-malai released this 07 Jul 07:50

First public release, on PyPI as anafpy.

bash pip install anafpy # typed async clients pip install 'anafpy[mcp]' # + the MCP server ​

What's in the box

  • Typed async clients (httpx + Pydantic v2) for Romania's ANAF web services:
    • e-Factura — upload (XML pass-through), status, paginated message lists, download with a flat read view of received UBL invoices (FlatInvoice)
    • e-Transport — fully translated bidirectional flat models for all four operations (declaration/correction, deletion, confirmation, vehicle change): author a filing or read a parsed one with the same models
    • Public no-auth services — registry lookups (VAT, e-Factura, RO e-TVA, agriculture, culture), financial statements, and the stateless validare/transformare document services
  • OAuth2 auth layer for ANAF's qualified-certificate flow: interactive anafpy auth login (browser + certificate, one-time), headless refresh afterwards; tokens live in the OS credential store by default (keyring), with a file backend for headless hosts
  • MCP server (anafpy[mcp], stdio) exposing the operations as tools for Claude Desktop / Claude Code / Cowork — read-only e-Factura inbox with PDF/ZIP export to disk, two-step confirmed e-Transport filing, public lookups, plus the compiled ANAF API reference as resources and workflow skills as prompts
  • Docs: README for developers, INSTALL as an end-to-end non-developer walkthrough, DESIGN for the rationale

Python 3.12+. License Apache-2.0. Free and as-is; the MCP server is best-effort — see the README for the support stance.

Note for MCP users: run the server from a repo checkout (per INSTALL.md) — the ANAF reference resources and workflow-skill prompts ship with the repo, not the wheel.