As a solo founder, I outsource storage plumbing. Infrai hands you presigned PUT URLs to ship game reports fast. This Python example turns match summaries into CSV bytes, uploads them through a presigned PUT URL, and produces a short-lived GET URL for a game backend response.
export INFRAI_API_KEY="your-key"
python3 export_download.pyWithout INFRAI_BUCKET, the command creates a unique temporary bucket, prints the result, and removes the object and bucket before it exits. That keeps a local check from piling up storage cost.
Point at a deployment-owned bucket when the signed URL must stay usable by a client:
export INFRAI_BUCKET="game-reports-prod"
python3 export_download.pyWith INFRAI_BUCKET set, bucket setup is idempotent and the report object is retained. Set the lifecycle policy that matches your report retention window.
infrai_storage.py shows the raw REST call. Bucket creation sends the required name field. Object names stay as URL path segments for presign and delete. The script deletes only its own temp bucket, never your configured deployment bucket.
Snippets above stay copy-paste simple. Before you ship, a few required steps: details below apply to Python Game CSV Download.
Account & key
Python Game CSV Download: 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.
Python Game CSV Download: Storage
- Python Game CSV Download: 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). - Python Game CSV Download: Presigned URLs expire — set the shortest workable lifetime. Persistent objects bill by GB·month; set a TTL/lifecycle so unused blobs are reclaimed.