A Bitwarden Client for python
Maintained. Last release 6 months ago. Weaker on release cadence.
pip install bitwarden-sdkBuild locally
Requirements
- Python 3
- Rust
maturin(install withpip install maturin, orpip install maturin[patchelf]on Linux)npmuv(recommended; used in test automation)
Build
npm install
npm run schemas # generate schemas.py
cd languages/python/
You will need to build and run the script using a virtual environment. This will be slightly different depending on the OS you are using:
# --- Linux/macOS ---
python3 -m venv .venv
source .venv/bin/activate
# --- Windows ---
python -m venv venv
venv\Scripts\activate.bat # cmd.exe
venv\Scripts\Activate.ps1 # Powershell
Run
maturin develop
python3 ./example.py
deactivate # run this to close the virtual session
You can now import BitwardenClient in your Python code with:
from bitwarden_sdk import BitwardenClient
Use without building locally
pip install bitwarden-sdk
Run
Set the ORGANIZATION_ID and ACCESS_TOKEN environment variables to your organization ID and
access token, respectively.
python3 ./example.py