Skip to main content

brsx-archive

Python client and command-line tool for BRSX Archive file storage. No dependencies beyond the standard library.

pip install brsx-archive

Get an API key

Sign in to archive.brsxlabs.com, click your name at the top right, open API keys and create one. The key starts with brsxa_ and is shown only once.

export BRSX_ARCHIVE_KEY=brsxa_...

Files you upload go to your own account and count against your storage quota.

Python

from brsx_archive import Archive

archive = Archive()                      # reads BRSX_ARCHIVE_KEY
backups = archive.folder("backups")      # created if it doesn't exist

f = archive.upload("db.sqlite", folder=backups, overwrite=True)
print(f.id, f.size)

for item in archive.files(backups):
    print(item.name, item.size)

archive.download(f, "restored.sqlite")
archive.delete(f)

usage = archive.usage()
print(usage.used, usage.limit, usage.free)

Large files are uploaded in chunks (up to 2 GB per file); failed chunks are retried automatically.

Keeping only the latest backups

from datetime import date

name = f"db-{date.today()}.sqlite"
archive.upload("db.sqlite", folder=backups, name=name)
archive.keep_latest(backups, count=7, prefix="db-")   # delete older ones

Errors

Exception When
AuthError Missing, invalid or revoked API key
ConflictError A file with the same name exists (use overwrite=True)
QuotaError Storage quota exceeded or file too large
ArchiveError Any other API error (base class)

Command line

brsx-archive usage
brsx-archive ls --folder backups
brsx-archive upload db.sqlite --folder backups --overwrite
brsx-archive upload db-2026-09-21.sqlite --folder backups --keep 7
brsx-archive download 42 -o restored.sqlite
brsx-archive rm 42

A daily backup with cron:

0 3 * * * BRSX_ARCHIVE_KEY=brsxa_... brsx-archive upload /var/backups/db-$(date +\%F).sqlite --folder backups --keep 7 --quiet

HTTP API

All endpoints take Authorization: Bearer brsxa_....

Method Path
GET /api/v1/me account usage and limits
GET /api/v1/folders list folders
POST /api/v1/folders create folder {name, parent_id?} (returns existing if present)
GET /api/v1/files?folder_id= list files (omit for root)
POST /api/v1/uploads start upload → {upload_id, chunk_size}
PUT /api/v1/uploads/{id}/{index} send chunk as raw body, index from 0
POST /api/v1/uploads/{id}/complete finish {name, folder_id?, overwrite?}
GET /api/v1/files/{id}/download download
DELETE /api/v1/files/{id} delete

License

MIT

Release files for brsx-archive 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brsx-archive 0.1.0
File Size Uploaded
brsx_archive-0.1.0.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brsx-archive 0.1.0
File Interpreter ABI Platform
brsx_archive-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / brsx_archive-0.1.0.tar.gz

Download URL brsx_archive-0.1.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dca7922785b043b35abb64eb249e27f7a264f469c74b6b410dd37a39118c437b
BLAKE2b-256 checksum
How to use checksums
d430d3e71788d48f997cd8b54b0cdeac6095e25198a3b3276a78a157c5037229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.10

Release files / brsx_archive-0.1.0-py3-none-any.whl

Download URL brsx_archive-0.1.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa1bd051137b13bcefa389281c07f9b36efe76e578f0394e6ad2b76d46b78cdc
BLAKE2b-256 checksum
How to use checksums
9ee5a782f07234e48e9266975297f4137b069f013cb8895c63f54a45dc339821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page