Python API reference#
This is the reference for supported FraudTwin Python APIs. The task-oriented pages below group the most common workflows, while the exhaustive inventory lists every supported public export. Signatures and member lists are generated from the installed source; implementation helpers and private names are intentionally omitted.
API status at a glance#
Area |
Status |
Use it for |
|---|---|---|
Generation and configuration |
Stable |
Deterministic runs, YAML loading, validation, and run identity. |
Data, ML, and graph |
Stable |
Point-in-time datasets, replay, evaluation, graph export, and PyG conversion. |
Calibration and benchmarks |
Experimental |
Reference-data fitting and stress suites whose interfaces may evolve between releases. |
PostgreSQL, Kafka, and Iceberg |
Optional |
Install the matching extra before importing an integration adapter. |
Every detailed page starts with a symbol summary and then expands the public objects with signatures, typed parameters, return values, exceptions, and source links. A symbol marked experimental or optional is still supported, but should be pinned to a documentation version in production integrations.
Module index#
The workflow pages below are the module-level entry points. The complete alphabetized class, exception, function, and constant indexes follow them.
Module area |
Documentation page |
|---|---|
|
|
|
|
|
|
|
|
Calibration, difficulty, camouflage, and campaigns |
|
PostgreSQL, Kafka, lakehouse, replay, and storage |
|
Benchmarks, quality, and observability |
|
All importable public modules |
Import the stable high-level API from fraudtwin whenever possible. The
module pages identify optional dependencies and the output objects returned by
each operation.
Complete supported public API#
The following indexes are generated from the package’s supported public API. Every listed symbol has a detail page with its signature, docstring, members, and source link.
Classes#
Port for a deterministic customer-behavior model. |
|
Canonical raw-record envelope used by both ingestion paths. |
|
Deterministic plug-in that scores generated aggregate summaries. |
|
Deterministic plug-in that fits summaries from a reference dataset. |
|
Immutable collection of summaries, distributions, and provenance. |
|
Inputs and versions that identify how a profile was fitted. |
|
Resolved strengths for one generator family and scenario. |
|
Transport metadata wrapped around one immutable publication payload. |
|
Fingerprint and location for one atomically completed chunk. |
|
Half-open logical ordinal range belonging to a stable shard. |
|
Machine-readable explanation of one accepted or rejected request. |
|
Original/modified sidecar records and oracle metadata. |
|
Resolved controls for one objective request. |
|
Port for deterministic observable-data mutations. |
|
Protocol implemented by pluggable counterfactual distances. |
|
Dynamic records and the complete post-evolution graph dataset. |
|
Identity recorded in manifests for one installed extension. |
|
Explicit, deterministic registry of extension implementations. |
|
Conditional relationship used to preserve feature dependencies. |
|
One weighted comparison between reference and generated aggregates. |
|
Immutable per-summary and composite fidelity assessment. |
|
Finite quantiles and bounds fitted from one reference column. |
|
Port for a deterministic fraud-scenario implementation. |
|
S3/MinIO-compatible publisher backed by optional fsspec. |
|
Generated FraudTwin data kept in memory. |
|
Metadata and paths for a generated run written to disk. |
|
Oracle descriptor for one deterministic scenario instance. |
|
One immutable graph view and its structural descriptors. |
|
Time-bounded relationship with provenance back to source events. |
|
Normalized lineage for a derived relationship. |
|
Optional higher-order campaign incidence record. |
|
Membership of an entity in a higher-order graph relationship. |
|
Versioned entity node in an observable or oracle graph view. |
|
Small PyIceberg writer with immutable append and snapshot metadata. |
|
Immutable, seeded policy for logical Kafka delivery faults. |
|
A source-time interval with a deterministic delivery behavior. |
|
Auditable output of one seeded logical-message chaos run. |
|
Non-secret connection settings resolved from environment variables. |
|
Immutable metadata produced by a batch or streaming materialization. |
|
Filesystem implementation used by default and in CI. |
|
Port for a chunk-aware output adapter. |
|
Fingerprint and counts for one atomically completed partition. |
|
Port for a payment rail that preserves FraudTwin lifecycle semantics. |
|
Non-secret metadata recorded in a generated run manifest. |
|
Immutable, distributable M21 benchmark definition. |
|
Identity and capabilities advertised by an external generator. |
|
Read-only public workload delivered to an external adapter. |
|
Normalized external output consumed by the quality scorer. |
|
Immutable public workload and protocol selection. |
|
Programmatic equivalent of the quality-benchmark CLI command. |
|
Immutable result and artifact location for a quality benchmark run. |
|
Normalized quality dimensions for one generator candidate. |
|
Declared dimensions supplied by a native or external candidate. |
|
Protocol implemented by an external generator benchmark adapter. |
|
One independently interpretable quality result. |
|
Cross-partition invariant results recorded in manifests/checkpoints. |
|
Validated reference data held only for the duration of fitting/scoring. |
|
Effective calibration context applied to a simulation configuration. |
|
Complete, deterministic and hashable M13 configuration. |
|
Complete immutable M14 configuration resolution. |
|
Complete, hashable M12 difficulty configuration. |
|
Serializable checkpoint manifest for deterministic resume. |
|
Resolved, immutable execution parameters for one scale run. |
|
Resolved transformations for one fraud or graph scenario. |
|
Stable shard identity; it is independent of the worker executing it. |
|
One legitimate source payment and its point-in-time snapshot. |
|
Immutable aggregate statistic captured in a calibration profile. |
Exceptions#
Raised for missing or unsafe lakehouse configuration. |
|
Raised when an Iceberg/Kafka integration extra is not installed. |
Functions#
Hash rows incrementally without retaining the complete input. |
|
Return an immutable generation context for a fitted profile. |
|
Return a stable per-scenario plan; no data or RNG is mutated. |
|
Apply resolved controls to one scenario without changing its objective. |
|
Apply a deterministic observation policy without mutating source records. |
|
Build a deterministic raw envelope from a complete generated run. |
|
Build a deterministic temporal graph without generating source data. |
|
Return a stable fingerprint excluding the wall-clock creation time. |
|
Yield stable shard-local payment chunks without materializing IDs. |
|
Compare generated aggregate values with a fitted profile. |
|
Consume a bounded Kafka batch into immutable Bronze and Silver tables. |
|
Create a deterministic hierarchical stream for one scale task. |
|
Return applied migration versions without changing the database. |
|
Apply a stable Silver decision while retaining deterministic winners. |
|
Load installed entry points in stable name order. |
|
Fail before file emission when the operational schema is unavailable. |
|
Evolve all configured M11 campaigns in stable order. |
|
Fit the deterministic built-in aggregate profile. |
|
Generate a deterministic FraudTwin run. |
|
Generate deterministic sidecar counterfactuals from a pristine stream. |
|
Run an explicitly requested scale job using the scale manifest path. |
|
Yield deterministic half-open chunk descriptors. |
|
Execute an out-of-core DuckDB query over partitioned Parquet. |
|
Read scale chunks one file at a time, keeping reader memory bounded. |
|
Yield deterministic contiguous payment ordinal ranges per shard. |
|
Stream canonical entities, profiles, payments, events, and ledger rows. |
|
Yield scale records from a producer or an existing partitioned run. |
|
Return all bundled public packs in stable identity order. |
|
Load and validate a YAML calibration profile. |
|
Load and validate a checkpoint manifest. |
|
Resolve an exact or unambiguous major/minor public-pack reference. |
|
Load one bundled immutable M22 profile or a YAML profile path. |
|
Load and strictly validate one canonical Parquet reference table. |
|
Materialize already-loaded domain objects without regenerating them. |
|
Backfill one generated run and optionally commit it to Iceberg. |
|
Apply the packaged, ordered PostgreSQL migrations and return the version. |
|
Return the canonical shard ID for a logical record. |
|
Map a logical ID to a stable shard without using Python hash randomization. |
|
Persist one generated run atomically after migrations have been applied. |
|
Persist a partition-record stream without whole-run materialization. |
|
Detect duplicate/lost IDs and return a serializable reconciliation result. |
|
Return the immutable versions in validated chronological order. |
|
Register a deterministic fidelity metric under a unique name. |
|
Register a deterministic calibration model under a unique name. |
|
Register a deterministic named distance function. |
|
Register a campaign intensity model by stable name. |
|
Register a campaign phase-transition model by stable name. |
|
Create an invariant report for one existing native generated run. |
|
Resolve an enabled scale plan and narrow away the optional result. |
|
Resolve an optional profile against a simulation configuration. |
|
Explicitly named public alias for resolving calibration configuration. |
|
Resolve global, family, and leaf M13 controls without consuming RNG. |
|
Validate and resolve registered models without consuming randomness. |
|
Resolve M14 precedence without consuming a random stream. |
|
Resolve a level and its optional per-dimension replacements. |
|
Return the validated M17 policy from either a run or policy config. |
|
Resolve the opt-in scale configuration, returning |
|
Resume a scale run from a validated checkpoint manifest. |
|
Run one immutable bundled M21 pack and verify its frozen outputs. |
|
Run the native or external M22 quality protocol. |
|
Run one explicitly requested scale job and publish machine evidence. |
|
Select deterministic legitimate-only source trajectories. |
|
Normalize deduplicated Bronze records without rewriting raw payloads. |
|
Apply seeded logical-message faults at a producer or consumer boundary. |
|
Resolve a configured storage backend without importing optional packages. |
|
Convert a graph to |
|
Reject output that attempts to carry reference rows or invalid metrics. |
|
Validate dynamic IDs, lifecycle records, graph membership, and ledger closure. |
|
Validate IDs, temporal closure, and edge references for one graph view. |
|
Validate campaign closure and higher-order incidence records. |
|
Validate references, ordering, and immutable truth invariants. |
|
Validate a materialization manifest without contacting Iceberg. |
|
Verify an existing public benchmark artifact without regenerating it. |
|
Resolve the latest label version available at a prediction timestamp. |
|
Write one immutable inspectable YAML profile and its JSON manifest. |
|
Atomically publish a checkpoint manifest. |
|
Write one append-only graph artifact containing the requested views. |
|
Write non-deterministic machine evidence separately from run identity. |
Constants and protocols#
Name |
Reference |
|---|---|
|
|
|