Skip to main content

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.

PyPI - Python Version PyPI - Version Code style: black Linting: Ruff uv GitHub License


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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitwarden_py-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitwarden_py-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for bitwarden_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2052e90b2418a6db15f8da00641c225e6eca1edceb5ae8aa02dec845fe99b15c
MD5 08d4b67ac3fddbc267f814590e2dd7db
BLAKE2b-256 e2d071e3013f35c6823a4f8648a3ab2a26fe4d4016aab80aeb3850b625f2a180

See more details on using hashes here.

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

Hashes for bitwarden_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d12dd07d69de3a817c87f13ca54034ad75e74e5daf9779f570ebba7a5806cd32
MD5 74e200fe652e2e1f84341af51fceed47
BLAKE2b-256 3b971f264a03057d31efd7fd806ef728d1398ab855667acde3ebdb5d9675cb02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page