py_env
A Rust library to run Python scripts and install dependencies within a given environment path.
Table of Contents
Installation
Simply add the library as a dependency in your Cargo.toml as follows, and invoke via the usage instructions.
[]
= "1.0.1"
Usage
Creating a Python Environment
This library uses a very simple syntax to run Python scripts. To create a Python environment, simply run PyEnv::at(PathBuf)
.
use PyEnv;
let env = at;
Running Arbitrary Code
use PyEnv;
at
.execute
.expect;
Installing Python Dependencies
The following code installs numpy into the ./py_test
directory's site-packages and uses it in executed code.
use PyEnv;
at
.install
.expect
.execute
.expect;
Making Environments Impersistent
The following code deletes the python environment off of the disk once it's done running.
use PyEnv;
at
.persistent
.install.expect;
Contributing
This was made as a code bounty, and as such is not a maintained project, but PRs are always welcome and will be reviewed when I see them.
License
This code is licensed under the MIT License.