Skip to main content

The Python host for florecon: a generic wasmtime embedder that drives self-describing reconciliation plugins. Brings its own plugin wasm; imports as `florecon`. Nothing created, nothing lost.

Project description

florecon (Python host)

A generic wasmtime host that drives self-describing florecon reconciliation plugins. The host knows nothing about any domain: it loads a plugin .wasm, reads its describe(), and ships the raw columns the plugin declares. The same code runs every florecon plugin.

Money is integer minor units; nothing is created or lost.

Authoring a plugin

This package also ships the florecon CLI, so you can build a plugin without cloning the florecon repo:

florecon new my-recon       # scaffold a Rust plugin (needs a Rust toolchain)
cd my-recon
florecon author             # fast native loop on data/sample.csv
florecon ship               # build the production solver.wasm

Then load target/wasm32-unknown-unknown/release/solver.wasm with the host below. See the scaffolded README.md for the full journey.

Running a plugin

from florecon import Workspace

ws = Workspace("interco_plugin.wasm")     # any florecon plugin wasm

ws.upsert(
    {"row_id": 1, "company": "A", "icp": "B", "objsub": "61500",
     "indicative_usd_amt": 100.0, "trx_currency": "USD", "trx_amt": 100.0,
     "gl_date": 0, "reference": "INV0001"},
    {"row_id": 2, "company": "B", "icp": "A", "objsub": "61500",
     "indicative_usd_amt": -100.0, "trx_currency": "USD", "trx_amt": 100.0,
     "gl_date": 1, "reference": "INV0001"},
)
rep = ws.solve()              # the proposal: groups + per-row allocations
ws.pin_clean(tol=0)           # sign off every clean net-zero match
ws.solve()                    # warm re-solve; pinned groups kept verbatim

Surface

A group lives on a lifecycle axis — proposed (the solver's current opinion, recomputed each solve) or pinned (your decision, kept verbatim).

ledger      upsert(*rows) · remove(*ids)
machine     solve()
lifecycle   pin(gid) · pin_clean(tol) · pin_singletons(ids) · unpin(gid)
partition   merge(allocs, label, reason) · detach(gid, ids) · dissolve(gid)
read        report()

Failures raise PluginError carrying a stable code (e.g. "frozen_group", "conservation_violated") plus the id / group_id it concerns. strict_assignments / connected_components project the allocation hypergraph into per-row assignments or settlement clusters.

The plugin/host ABI is versioned: the host refuses a wasm whose abi_version differs from florecon.ABI_VERSION.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

florecon_host-0.2.1.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

florecon_host-0.2.1-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file florecon_host-0.2.1.tar.gz.

File metadata

  • Download URL: florecon_host-0.2.1.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for florecon_host-0.2.1.tar.gz
Algorithm Hash digest
SHA256 86e0f90d3bc1360b8c00fa5c68681c66bfde17ef69c78825c977adfac73fbf6f
MD5 d00e47b4b548a60dcc2b9060c266fcd1
BLAKE2b-256 b456f9dc8d8f210e2f9773f4a7744b2265a3b8be109d58eff4ef0ebd401e7e0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for florecon_host-0.2.1.tar.gz:

Publisher: release.yml on spoj/florecon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file florecon_host-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: florecon_host-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for florecon_host-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 065cd4da9f8c22825f31316ae2e73fda808236a9421a022ce6d63ea5f2b5fc0a
MD5 7c9b65a288c11dcbdef528b11752a3a9
BLAKE2b-256 5a08200eeba58913d09b2c2c1d621bd60e8aec6dcfb3714bd20e01ebbd4560a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for florecon_host-0.2.1-py3-none-any.whl:

Publisher: release.yml on spoj/florecon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page