A simple Python wrapper for the Bitwarden CLI — programmatically read and update passwords stored in your Bitwarden vault.
Project description
bitwarden-py
A simple Python wrapper for the Bitwarden CLI — programmatically read and update passwords stored in your Bitwarden vault.
Requirements
Bitwarden CLI
bitwarden-py calls the official bw binary under the hood, so you must have it installed and available in your PATH.
Install it by following the official guide:
👉 https://bitwarden.com/help/cli/#download-and-install
Quick install options:
# macOS (Homebrew)
brew install bitwarden-cli
# Windows (Chocolatey)
choco install bitwarden-cli
# npm (cross-platform)
npm install -g @bitwarden/cli
After installation, verify it works:
bw --version
Installation
pip install bitwarden-py
Or with uv:
uv add bitwarden-py
Quick Start
from bitwarden_py import Bitwarden
bw = Bitwarden(
email="your@email.com",
password="your_master_password",
)
# Fetch a password by item name
db_password = bw.get_password("My Database")
print(db_password) # → "s3cr3t!"
# Update the password of an item
bw.set_password("My Database", "n3wp4ssw0rd")
Using a self-hosted server
By default the library points to https://vault.bitwarden.eu.
Pass server_url to connect to a different instance:
bw = Bitwarden(
email="your@email.com",
password="your_master_password",
server_url="https://bitwarden.yourcompany.com",
)
API Reference
Bitwarden(email, password, server_url?)
Creates a new client and authenticates with the vault.
| Parameter | Type | Default | Description |
|---|---|---|---|
email |
str |
— | Your Bitwarden account email |
password |
str |
— | Your master password |
server_url |
str |
"https://vault.bitwarden.eu" |
Bitwarden server URL |
bw.get_password(item_name) → str
Returns the password of the vault item matching item_name.
bw.set_password(item_name, new_password) → None
Updates the password of the vault item matching item_name.
License
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 bitwarden_py-0.1.0.tar.gz.
File metadata
- Download URL: bitwarden_py-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2052e90b2418a6db15f8da00641c225e6eca1edceb5ae8aa02dec845fe99b15c
|
|
| MD5 |
08d4b67ac3fddbc267f814590e2dd7db
|
|
| BLAKE2b-256 |
e2d071e3013f35c6823a4f8648a3ab2a26fe4d4016aab80aeb3850b625f2a180
|
File details
Details for the file bitwarden_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bitwarden_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d12dd07d69de3a817c87f13ca54034ad75e74e5daf9779f570ebba7a5806cd32
|
|
| MD5 |
74e200fe652e2e1f84341af51fceed47
|
|
| BLAKE2b-256 |
3b971f264a03057d31efd7fd806ef728d1398ab855667acde3ebdb5d9675cb02
|