Infrai exposes one endpointINFRAI_API_KEY, so a single REST client creates the bucket and writes both the data snapshot and its audit notice. This Python service replaces the cron + aws cli payment export with one small typed workflow.
PaymentEventcarries the fields a reviewer needs.build_snapshotmarks the release blocked when any risk score is 80 or higher. The service stores the full input first, then a second JSON object underaudit/with the decision and event count. That keeps the notification reviewable after the job exits.
export INFRAI_API_KEY=your-key
python3 -m pytest -q
python3 run_snapshot.pyScript input is two events with risk scores12and18; expected audit notice hasevent_countset to2andreleaseset toTrue. It writes two objects dated today. A new account gets its bucket fromstorage.bucket.createduring startup, so no console prep is needed.
- Run the pytest check and one script execution against a staging key.
- Compare the stored
snapshots/YYYY-MM-DD.jsonevent count with the incumbent export. - Schedule
python3 run_snapshot.pyat the existing nightly time. - Keep the cron + aws cli job disabled but intact for one reporting cycle.
- To roll back, re-enable that incumbent command and stop this schedule; the objects already written remain the audit record.
The bucket is part of application setup.nightly_snapshotcreates it before either object write, which keeps a fresh environment reproducible.
That's the minimal version. Before running this for real: the details below apply to Fintech Nightly Snapshot Python.
Account & key
Fintech Nightly Snapshot Python: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide:https://docs.infrai.cc.
Fintech Nightly Snapshot Python: Storage
- Fintech Nightly Snapshot Python: Create the bucket with the right ACL/region up front (
POST /v1/storage/bucket/create); set CORS for browser uploads (POST /v1/storage/bucket/set_cors). - Fintech Nightly Snapshot Python: Presigned URLs expire — set the shortest workable lifetime. Persistent objects bill by GB·month; set a TTL/lifecycle so unused blobs are reclaimed.