Skip to main content

PyVaultRCE

Remote Code Hosting client for PyVault.

Upload Python scripts to a PyVault server and execute them remotely — the source code never leaves the server. Clients only ever hold a 21-character hex Session ID.

Install

pip install PyVaultRCE

Quick Start

from pyvaultrce import CodeManager

# Upload a local .py file → get a 21-character Session ID
sid = CodeManager.enc("my_script.py")
# [PyVault] ✓ Uploaded  — Session ID : 3a7f1c9b2d0e8a5f41c7e

# Upload from a paste service URL
sid = CodeManager.enc_url("https://pastebin.com/abcXYZ123")

# Execute in a short-lived isolated subprocess by default
CodeManager.run(sid)

# Upload with a short share link and library metadata
sid = CodeManager.enc(
    "my_script.py",
    label="analytics demo",
    libraries=["requests", "pandas"],
    username="your_name",
    description="A public demo post",
    tags=["python", "demo"],
)

# Hide PyVault status messages while running
CodeManager.run(sid, show_terminal=False)

# Check metadata without incrementing execution counter
CodeManager.info(sid)

# Verify server is up
CodeManager.ping()

Configuration

Set PYVAULT_URL to point at your hosted PyVault server:

export PYVAULT_URL=https://secure-code-runner--diwasrepl.replit.app

The package uses the public PyVault deployment when PYVAULT_URL is not set. For local development, explicitly use PYVAULT_URL=http://localhost:5000. You can also control status output globally:

export PYVAULT_TERMINAL=off

Library names are metadata only. PyVault does not auto-install packages or execute dependency installers; install the libraries in the Python environment where CodeManager.run() executes.

API Reference

Method Description
CodeManager.enc(file_path) Upload a local .py file → returns Session ID
CodeManager.enc(file_path, label=..., libraries=[...], username=..., description=..., tags=...) Upload with public profile metadata and visible library metadata
CodeManager.enc_url(url) Download code from a paste URL and upload → returns Session ID
CodeManager.run(session_id, show_terminal=False, isolated=True) Fetch and execute code in an isolated subprocess with timeout/resource limits
CodeManager.info(session_id) Get session metadata (no exec count increment)
CodeManager.ping() Check server connectivity
CodeManager.edit(session_id, file_path, admin_token=...) Replace stored code (admin or owner token)
CodeManager.delete(session_id, owner_token) Delete your own session

Supported Paste Services (enc_url)

  • pastebin.com
  • hastebin.com
  • dpaste.com
  • paste.ofcode.org
  • GitHub raw URLs
  • Any URL returning raw Python text

Error Handling

Exception When
FileNotFoundError Local file not found
ValueError Invalid Session ID or empty file
ConnectionError Server unreachable
TimeoutError Request timed out
RuntimeError Server error (404, 403, 500, etc.)
SyntaxError Remote code syntax error (during run)

Security

  • Session IDs are 21-character cryptographically random hex strings
  • Source code is never written to disk on the client
  • Code is encrypted at rest with Fernet on the server
  • Code runs in a short-lived subprocess by default with a clean environment, temporary working directory, CPU/memory/file-size limits, and a hard timeout
  • isolated=False is an explicit trusted-code escape hatch for shared namespaces; it is not recommended for untrusted sessions
  • Share links expose only session metadata and declared library names, never source
  • Admin edits require the admin access code; owner edits/deletes require the one-time owner token
  • Sessions never expire unless an expiry is explicitly selected

License

MIT

Metadata

Release files for PyVaultRCE 2.5.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 PyVaultRCE 2.5.0
File Size Uploaded
pyvaultrce-2.5.0.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyVaultRCE 2.5.0
File Interpreter ABI Platform
pyvaultrce-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / pyvaultrce-2.5.0.tar.gz

Download URL pyvaultrce-2.5.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f967425465913ab4b7b442167afcbaa9d2502bc5921fd2310bb65e8b32ee859e
BLAKE2b-256 checksum
How to use checksums
88abe744464270d23e7baae06a1d064893b23d74ffd0ce76ce86d9baa96f3095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / pyvaultrce-2.5.0-py3-none-any.whl

Download URL pyvaultrce-2.5.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6002afd0f5296e8ec4153f16518ecbcb05ff0880837daab5f43225ad2a19319
BLAKE2b-256 checksum
How to use checksums
f2b41ac965a489bea85f231b3071d448b2ea02fbe2e95b0ba5033ee09471ffb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

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