The 1Password Python SDK offers programmatic read access to your secrets in 1Password in an interface native to Python.
Project description
1Password Python SDK
Build integrations that programmatically access your secrets in 1Password.
Requirements
The 1Password Python SDK is compatible with:
python
3.9 or laterlibssl
3glibc
2.32 or later
If you're running a Linux distribution that still uses libssl
version 1.1.1, such as Debian 11 or Ubuntu 20.04, you'll need to update to a later version of Linux or install the required dependencies.
🚀 Get started
To use the 1Password Python SDK in your project:
-
Create a service account and give it the appropriate permissions in the vaults where the items you want to use with the SDK are saved.
-
Provision your service account token. We recommend provisioning your token from the environment. For example, to export your token to the
OP_SERVICE_ACCOUNT_TOKEN
environment variable:macOS or Linux
export OP_SERVICE_ACCOUNT_TOKEN=<your-service-account-token>
Windows
$Env:OP_SERVICE_ACCOUNT_TOKEN = "<your-service-account-token>"
-
Install the 1Password Python SDK in your project:
pip install onepassword-sdk
-
Use the Python SDK in your project:
import asyncio
import os
from onepassword.client import Client
async def main():
# Gets your service account token from the OP_SERVICE_ACCOUNT_TOKEN environment variable.
token = os.getenv("OP_SERVICE_ACCOUNT_TOKEN")
# Connects to 1Password. Fill in your own integration name and version.
client = await Client.authenticate(auth=token, integration_name="My 1Password Integration", integration_version="v1.0.0")
# Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
value = await client.secrets.resolve("op://vault/item/field")
# use value here
if __name__ == '__main__':
asyncio.run(main())
Make sure to use secret reference URIs with the syntax op://vault/item/field
to securely load secrets from 1Password into your code.
Supported functionality
1Password SDKs are in active development. We're keen to hear what you'd like to see next. Let us know by upvoting or filing an issue.
Item management
Operations:
- Retrieve secrets
- Retrieve items
- Create items
- Update items
- Delete items
- List items
- Add & update tags on items
Field types:
- API Keys
- Passwords
- Concealed fields
- Text fields
- Notes
- SSH private keys (partially supported: supported in resolving secret references, not yet supported in item create/get/update)
- SSH public keys, fingerprint and key type
- One-time passwords
- URLs
- Websites (used to suggest and autofill logins)
- Phone numbers
- Credit card types
- Files attachments and Document items
Vault management
- Retrieve vaults
- Create vaults (#36)
- Update vaults
- Delete vaults
- List vaults
User & access management
- Provision users
- Retrieve users
- List users
- Suspend users
- Create groups
- Update group membership
- Update vault access & permissions
Compliance & reporting
- Watchtower insights
- Travel mode
- Events. For now, use 1Password Events Reporting API directly.
Authentication
- 1Password Service Accounts
- User authentication
- 1Password Connect. For now, use 1Password/connect-sdk-python.
📖 Learn more
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 Distributions
File details
Details for the file onepassword_sdk-0.1.2.tar.gz
.
File metadata
- Download URL: onepassword_sdk-0.1.2.tar.gz
- Upload date:
- Size: 19.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029ba2e03accc9ffe762414721bc29fd153103afa972d361c1a67d75678d9a5f |
|
MD5 | bcff61e665c59e5d32e2683cc2f3d4bc |
|
BLAKE2b-256 | 1b960de6ed472a953ac55ca97e78fcd6e96442921b7b050993dcad402ab1c2c4 |
File details
Details for the file onepassword_sdk-0.1.2-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33fa9d53f93fdaf5593aeb45a270023f49df42b4790aa498d521e47c4c1c0a80 |
|
MD5 | cf2fb46a2233a31bf669443ad3bd64ff |
|
BLAKE2b-256 | 912588c6ce80f3317f53e6cdb9a4e83c3b33c4222cdf863dbf245f45c1323e1d |
File details
Details for the file onepassword_sdk-0.1.2-cp312-cp312-manylinux_2_32_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp312-cp312-manylinux_2_32_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.32+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 663cc389c34eb88bd6f6d74fff5aa6ea7dd96365998c8a3c86ea3528675cd919 |
|
MD5 | 1a61ba0f9f058883bf3f435104fadcff |
|
BLAKE2b-256 | 6e0b6e4cac1821ccbb045c4cc707b8408c878a1129fb213142dbda81b554f5a7 |
File details
Details for the file onepassword_sdk-0.1.2-cp312-cp312-manylinux_2_32_aarch64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp312-cp312-manylinux_2_32_aarch64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.12, manylinux: glibc 2.32+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a03517073b581d7a6525976b2ee79b3a16adc5cd39640ae7e596c33d28d23853 |
|
MD5 | ca0d665a3ee1090ff9d5b50a6561d6ef |
|
BLAKE2b-256 | 9b2e9a61dfa30d403a3b97c9be0aa2b6cfe154a7643f60b3e534d6ed2021b848 |
File details
Details for the file onepassword_sdk-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d28ed9f1f27cb32d418e36ec26b59c4436b2d6627d8ed41a8a84f61c73f28271 |
|
MD5 | c5c81d907d507e34fa074dc91d683331 |
|
BLAKE2b-256 | 9c8ad0e392430d53aee6aef20402b9042c8531cbdae0535ce9f867ff20a7bc17 |
File details
Details for the file onepassword_sdk-0.1.2-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6da00e28c74a268597d104c3b77fa6f75dc7e75300273d7d245bd07c037d1dd2 |
|
MD5 | 72f115d9b96ee8953d0f253b92967373 |
|
BLAKE2b-256 | 40b78fffb74933b294a274959f4b1f4044ccfeb2fc7f17cba034bbf7538f5085 |
File details
Details for the file onepassword_sdk-0.1.2-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55550e1f9756ba6fbe7dab548e1958ba31b1e4ece228e24b407dbd2013b04248 |
|
MD5 | f56b27957c8acf654c6d27e422b66bf2 |
|
BLAKE2b-256 | e93f423315c741dcca86a21ef1b076642e4cb8a58fd9d846275a46a1c708760e |
File details
Details for the file onepassword_sdk-0.1.2-cp311-cp311-manylinux_2_32_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp311-cp311-manylinux_2_32_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.32+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 809f4d41c1779e980412a4c016917d5fde0a6be7ea54743ef38c13b3fddd577b |
|
MD5 | 49b5a5b4a8f85d063491551a926abe2d |
|
BLAKE2b-256 | 7c7f6dd0baccab589d74385b2e9c9530553ab18d23a83da3e56364c62ef68610 |
File details
Details for the file onepassword_sdk-0.1.2-cp311-cp311-manylinux_2_32_aarch64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp311-cp311-manylinux_2_32_aarch64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.32+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27516b172bbc0c9156ff1ee3d551703f12c3ae135786e5936acf670d5892cab0 |
|
MD5 | 6becc57090e28f973c418907a1b0be5f |
|
BLAKE2b-256 | 649c9312ce194606b084aa82b3374f85db5c649a5c697dcce2665044f140a237 |
File details
Details for the file onepassword_sdk-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72beaa348d8e3e11adc63765e93569b2ca0201a61034889bb0344f1071a91088 |
|
MD5 | daaafd1c726716ae5e7f245ac1dc47b7 |
|
BLAKE2b-256 | a3519c86872d0bdb950d8a6abfbc255e69732a18accf614c70f685c16bc92154 |
File details
Details for the file onepassword_sdk-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e7a6534042a69067ff117998693956bc1429d58cfeac3eb1caa5afb99d7a35 |
|
MD5 | 53e71936cf3444476e55959a4fc7ec6e |
|
BLAKE2b-256 | dfa57c60f73722b4cdfb3d1534848ce95179a7b25a36cebd08500ef1f259c330 |
File details
Details for the file onepassword_sdk-0.1.2-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 567828bae40ca48bf493118efec990efd898e10ac3ef7a9cbdc3e2f786241180 |
|
MD5 | d0fa5889cead17d51968d211be8c4f80 |
|
BLAKE2b-256 | 32a806b4e5192d0bcda6645b9d7bbb160fcd2add2c304d55c04d112eadf57838 |
File details
Details for the file onepassword_sdk-0.1.2-cp310-cp310-manylinux_2_32_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp310-cp310-manylinux_2_32_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.32+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e50d86fc033730f551217d2cb34cab1e486ff4d2bc18918cf36b71955d935c |
|
MD5 | 67c2259aa36cf583d0cd3f95f6ff343b |
|
BLAKE2b-256 | 1db812d51bc18ad521ad50e0d71d02d6f366d8538afea25598125cb0599538f9 |
File details
Details for the file onepassword_sdk-0.1.2-cp310-cp310-manylinux_2_32_aarch64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp310-cp310-manylinux_2_32_aarch64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.32+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcf824a3c874833e9534a9c633c1b2b68e5ce04121e82cbb9808328459ecc3b3 |
|
MD5 | 3bb6ce08992fbf2dbfb56d3a1ea3a139 |
|
BLAKE2b-256 | 3bc3b41f1a5332df4ab8aa8c6e95aaf6ed8698c1b262b346e29ed69b55044125 |
File details
Details for the file onepassword_sdk-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 714c9f9ec17612e1ed96789145e603335c838cfb29cf78924400a47034bf3688 |
|
MD5 | 0ca24421972d2a0a2118d795eb5e8e7b |
|
BLAKE2b-256 | 5543828510a5716b77b861d35f0e200dad739bff79e675c770939cb5e57ca738 |
File details
Details for the file onepassword_sdk-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ecf5cf2dd51d409171e6fac45cc782dcbb2d87fcc030268a65348224bad23e8 |
|
MD5 | 222bc71a71230d110191d2712f320abc |
|
BLAKE2b-256 | fbe95883823e3564837eda6b19c8e529228910a61a7c49c0d7500d60dc404687 |
File details
Details for the file onepassword_sdk-0.1.2-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 505d5a4e16e59da19578014dbc598d7ecda4fe50f2b61ef45f20719bd0a0ccc0 |
|
MD5 | fc6a455e395fd9614fd1b2f4e60fdac3 |
|
BLAKE2b-256 | 7d61cdd98854ceda7fa8a49f01c23fc5404b6b5451d242c4faf146078e577946 |
File details
Details for the file onepassword_sdk-0.1.2-cp39-cp39-manylinux_2_32_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp39-cp39-manylinux_2_32_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.9, manylinux: glibc 2.32+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0391a7d00b426cb0147264fa421436cfe9465b4cbe08468f6e8b23f735db1f9 |
|
MD5 | 744182f2485b68a328bad4bd327357d2 |
|
BLAKE2b-256 | aefb3fa9bb2ebebbc61d84acfb12d9f85dff49048133ab420396b3b7991c99df |
File details
Details for the file onepassword_sdk-0.1.2-cp39-cp39-manylinux_2_32_aarch64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp39-cp39-manylinux_2_32_aarch64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.32+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01f73d0a781826c85610fbc5e72f67e650cd252c9416863f30b6da649ec0c38a |
|
MD5 | b5626aab565e2c4e69d1f60632f20546 |
|
BLAKE2b-256 | 2a8ddffc7585594acb39b0208de66e326972d79120d0e6444e783ec438ea8ad9 |
File details
Details for the file onepassword_sdk-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcea1bcff89bb4e9d14e87d22e1069f8dfd457790b418f60b146dabcbb34a1f8 |
|
MD5 | 09afa4cab07fa1194f3c79a4ef62d315 |
|
BLAKE2b-256 | 1ce7ce256a93b76a193d127682647a61aa54f4c008484b643e6a8212dc5c9120 |
File details
Details for the file onepassword_sdk-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: onepassword_sdk-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4720067bb35a15e1bee6f539295290cd5cf6b44c5704aeec62a254c23c164d19 |
|
MD5 | 8854bfcfd376de37c138bb2bbabf4c9c |
|
BLAKE2b-256 | 845ee13633cbfbd024cc14c5ac4a3f619e91b082c384ffb2a1a99c47c3397be6 |