Safe way to execute Python code with containerization.
Project description
SafeExecute
This module provides a safe way to execute Python code in a container. It is intended to be used with language models to enable them to execute code in a safe environment separate from the host machine (your computer or server).
The container comes preloaded with the following packages:
- numpy
- matplotlib
- seaborn
- scikit-learn
- yfinance
- scipy
- statsmodels
- sympy
- bokeh
- plotly
- dash
- networkx
- pyvis
- pandas
- agixtsdk
Installation
pip install safeexecute
Usage
You can pass an entire message from a langauge model into the code field and it will parse out any Python code blocks and execute them. If anywhere in the code says pip install <package>, it will install the package in the container before executing the code.
from safeexecute import execute_python_code
code = "print('Hello, World!')"
result = execute_python_code(code=code)
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safeexecute-0.0.23.tar.gz.
File metadata
- Download URL: safeexecute-0.0.23.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddd41ef9802d44a9d3ff0b41564ebc7bc1886d0a959767f17c3493ecb2306725
|
|
| MD5 |
0b37cb8d8fece90ce3c53c82db85dd09
|
|
| BLAKE2b-256 |
a1338e793628fc887cdac6e7f9263863fca81f4150150fa252b86c7106321077
|
File details
Details for the file safeexecute-0.0.23-py3-none-any.whl.
File metadata
- Download URL: safeexecute-0.0.23-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3af3d423bf55dbc3bb34ed36b2bb5d1acd78286abb18bc1e8fa6c26fd386a404
|
|
| MD5 |
764718ac186308490ea1090da5d677fa
|
|
| BLAKE2b-256 |
e677ae06d417e6dcb5d8a97dbbf4f1375dd5dff72356bcef187f3ca11c9d40d9
|