This release is a pre-release and may not be stable for production use.
Restricted Python Virtual Machine
Restricted Python Virtual Machine (R-PVM) implemented by pure python.
specification
- aim for complete safe sandbox
- designed for Python3.6 bytecode
- execute one by one
- good for smart contract of crypto currency
- No warranty and unstable
check
- cannot use MAKE_FUNCTION op (lambda, comprehension and inner fnc)
- cannot use async/await
- limit to execute function
- YOU must select safe function
Install
pip3 install rpvm
How to use
from rpvm.vm import VirtualMachine
from RestrictedPython import safe_builtins, safe_globals
source = """
a = 1
b = 2
c = a + b
"""
code = compile(source, '<example>', 'exec')
b = safe_builtins.copy()
l = dict()
g = safe_globals.copy()
vm = VirtualMachine(code, b, l, g)
steps = 0
max_steps = 500
while not vm.finish and steps < max_steps:
vm.exec()
steps += 1
print("complete?", vm.finish)
print("result", vm.return_value)
print("c is", l['c'])
test
python3 -m pytest tests
Author
Metadata
Release files for rpvm 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rpvm-0.1.0a1.tar.gz | 8.0 kB | Without provenance | Details for rpvm-0.1.0a1.tar.gz |
Release files / rpvm-0.1.0a1.tar.gz
| Download URL | rpvm-0.1.0a1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d352685e38b9bca4355419a5238ecb07802aa0bb0593366fbf0ca442381ba15
|
|
BLAKE2b-256 checksum How to use checksums |
588d965446ed7bc26253a6bedf1148b3c207009c206975765e67f16a28f3349c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.8
|
Security for rpvm 0.1.0a1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.