diff --git a/languages/python/.gitignore b/languages/python/.gitignore index baa13a078..495f6296b 100644 --- a/languages/python/.gitignore +++ b/languages/python/.gitignore @@ -1,3 +1,4 @@ *.egg-info bitwarden_py*.so __pycache__ +.venv diff --git a/languages/python/README.md b/languages/python/README.md index f41fd8a12..e5fe5ae70 100644 --- a/languages/python/README.md +++ b/languages/python/README.md @@ -33,3 +33,26 @@ Set the `ORGANIZATION_ID` and `ACCESS_TOKEN` environment variables to your organ ```bash python3 ./example.py ``` + +# Using Virtual Environments + +If you would like to build & run the script within a virtual environment you can do the following. + +## Build + +```bash +npm run schemas # generate schemas.py + +cd languages/python/ +python3 -m venv .venv +maturin develop +``` + +## Run + +```bash +source .venv/bin/activate +python3 ./example.py + +deactivate # run this to close the virtual session +```