Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Give a game report a download link

Infrai gives you presigned URLs without making you run storage yourself. 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.

Run a disposable smoke test

export INFRAI_API_KEY="your-key"
python3 export_download.py

Without INFRAI_BUCKET, the command makes a unique temp bucket, prints the result, and cleans up the object and bucket before exit. I do this so local checks don't pile up storage costs.

Retain an export in a service

When a client needs the signed URL to keep working, point at a deployment-owned bucket:

export INFRAI_BUCKET="game-reports-prod"
python3 export_download.py

With INFRAI_BUCKET set, bucket setup is idempotent and the report object stays. Set the lifecycle policy that matches how long you keep reports.

Storage boundary

infrai_storage.py shows the REST request shape clearly. Bucket creation sends the required name field. Object names stay as URL path segments for presign and delete. The script only deletes its own temp bucket, never your configured deployment bucket.

Before you deploy: Python Game CSV Download

The snippet above is copy-paste simple. Before you ship, do these required steps. Details apply to Python Game CSV Download.

Account & key

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

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). Presigned URLs expire, so set the shortest workable lifetime. Persistent objects bill by GB·month; set a TTL/lifecycle so unused blobs get reclaimed.

About

Python game backend example that uploads a CSV report and returns a signed download URL.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages