Beamcode for Python
Encrypted QR file transfer — the same product as beamcode.vjyas.online, available as an SDK and CLI.
pip install beamcode
Why this exists
Share any file (PDF, video, archives, binaries) from a terminal or Python script. Files are encrypted on the client with AES-256-GCM before upload. Recipients open the link on any device — no shared Wi‑Fi, no accounts.
CLI
# Send a local file — share_url is copied to the clipboard
beamcode send ./report.pdf
# Mix local files and remote URLs (PDF/docs fetched then attached)
beamcode send ./clip.mp4 https://example.com/whitepaper.pdf --ttl 24h
# Receive
beamcode receive "https://beamcode.vjyas.online/d/….…#k=…"
beamcode receive "bc:transferId:key"
# Ops
beamcode limits
beamcode doctor
beamcode revoke <id> --token <revokeToken>
Progress is staged with clear percentages: Prepare → Fetch → Encrypt → Upload → Finalize (and Download / Decrypt on receive).
SDK
from beamcode import BeamcodeClient, send_files, receive
result = send_files(
["./video.mp4", "https://example.com/doc.pdf"],
ttl="1h",
on_progress=lambda e: print(f"{e.stage.value} {e.percent:.0f}% overall {e.overall_percent:.0f}%"),
)
print(result.share_url) # primary — copy and share this
print(result.compact) # denser QR payload
print(result.pair_code)
paths = receive(result.share_url, out_dir="./inbox")
Low-level API access:
from beamcode import BeamcodeClient
with BeamcodeClient() as client:
print(client.get_limits())
print(client.health())
Configuration
| Variable / flag | Purpose |
|---|---|
BEAMCODE_API_URL / --api-url |
Override API host (default https://beamcode.vjyas.online) |
--allow-private-urls |
Allow fetching localhost / private IPs (off by default) |
--json |
Machine-readable output for scripts |
--watch |
After send, print open / download receipts |
Security notes
- Encryption is required; keys live only in the URL fragment (
#k=) or compactbc:payload. - Large files use disk-backed encrypt/upload/download/decrypt (≈1 MiB crypto window) — not full-file RAM.
- Multipart uploads resume from local checkpoints after failure.
- Remote URL fetch blocks private/loopback hosts by default (SSRF protection, including redirects).
- Compatible with the web app: files sent via
pipopen in the browser, and vice versa.
Production options
beamcode send ./video.mp4 --password 'long-secret' --ttl 24h
beamcode send ./a.pdf --turnstile-token "$TOKEN" # when API enables CAPTCHA
beamcode extend <id> --token <revoke> --add-sec 3600
beamcode bump <id> --token <revoke> --add 3
Env: BEAMCODE_API_URL, BEAMCODE_TURNSTILE_TOKEN, BEAMCODE_CHECKPOINT_DIR.
Development
cd python
pip install -e ".[dev]"
pytest
beamcode doctor
Publish to PyPI (GitHub Actions)
Publishing is tag-driven. A normal push only runs tests; it will not upload to PyPI.
1. One-time: Trusted Publishing on PyPI
- Create / sign in at pypi.org.
- Open Publishing settings.
- Under Add a new pending publisher:
- PyPI Project Name:
beamcode - Owner: your GitHub username or org
- Repository name:
QRFileTransfer - Workflow name:
python-package.yml(exact filename) - Environment name: leave blank (do not set
pypi)
- PyPI Project Name:
- You do not need GitHub → Settings → Environments for this setup.
No PYPI_API_TOKEN secret is required with Trusted Publishing.
2. Ship a release
Version in python/pyproject.toml / python/src/beamcode/_version.py must match the tag (e.g. 1.1.0 → py-v1.1.0).
git add python .github/workflows/python-package.yml
git commit -m "Release beamcode 1.1.0"
git push origin HEAD
git tag py-v1.1.0
git push origin py-v1.1.0
Then open Actions → python-package for that tag run. You should see jobs test and publish.
After success: pip install beamcode → https://pypi.org/project/beamcode/
Why publish was skipped before
The publish job only runs when github.ref is refs/tags/py-v…. Branch/PR runs show test only — that is expected.
License
MIT — same as the Beamcode monorepo.
Metadata
Release files for beamcode 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| beamcode-1.1.0.tar.gz | 30.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| beamcode-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 63.5 kB
Release files / beamcode-1.1.0.tar.gz
| Download URL | beamcode-1.1.0.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3b27218a160096ec78fde17eaa338213583a618a7d4227330e73e3abdbbb414
|
|
BLAKE2b-256 checksum How to use checksums |
d1bac77403c81da0236c34a1fc4cc8f073d314bfbcc6afc90d3a834b5af8c34d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / beamcode-1.1.0-py3-none-any.whl
| Download URL | beamcode-1.1.0-py3-none-any.whl |
|---|---|
| Size | 33.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74a4716a62b9967eed434de46d1544c2895be22547bba786aad8abddbb5fe937
|
|
BLAKE2b-256 checksum How to use checksums |
8823dce2f7928ede3ca4a09428a77760d21b6c82c5f0249f84b63a071d454bfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency log