Skip to main content

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.

Documentation | Examples


Requirements

The 1Password Python SDK is compatible with:

  • python 3.9 or later
  • libssl 3
  • glibc 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:

  1. 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.

  2. 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>"
    
  3. Install the 1Password Python SDK in your project:

    pip install onepassword-sdk
    
  4. 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:

Field types:

  • API Keys
  • Passwords
  • Concealed fields
  • Text fields
  • Notes
  • SSH private keys, public keys, fingerprint and key type
  • One-time passwords
  • URLs
  • Websites (used to suggest and autofill logins)
  • Phone numbers
  • Credit card types
  • Credit card numbers
  • Emails
  • References to other items
  • Address
  • Date
  • MM/YY
  • File attachments and Document items
  • Menu
  • Passkeys

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

Authentication

📖 Learn more

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

onepassword_sdk-0.4.0.tar.gz (34.5 MB view details)

Uploaded Source

Built Distributions

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

onepassword_sdk-0.4.0-cp313-cp313-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.13Windows x86-64

onepassword_sdk-0.4.0-cp313-cp313-manylinux_2_32_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.4.0-cp313-cp313-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.4.0-cp313-cp313-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

onepassword_sdk-0.4.0-cp313-cp313-macosx_10_13_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

onepassword_sdk-0.4.0-cp312-cp312-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.12Windows x86-64

onepassword_sdk-0.4.0-cp312-cp312-manylinux_2_32_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.4.0-cp312-cp312-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

onepassword_sdk-0.4.0-cp312-cp312-macosx_10_9_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

onepassword_sdk-0.4.0-cp311-cp311-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.11Windows x86-64

onepassword_sdk-0.4.0-cp311-cp311-manylinux_2_32_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.4.0-cp311-cp311-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

onepassword_sdk-0.4.0-cp311-cp311-macosx_10_9_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

onepassword_sdk-0.4.0-cp310-cp310-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.10Windows x86-64

onepassword_sdk-0.4.0-cp310-cp310-manylinux_2_32_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.4.0-cp310-cp310-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

onepassword_sdk-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

onepassword_sdk-0.4.0-cp39-cp39-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.9Windows x86-64

onepassword_sdk-0.4.0-cp39-cp39-manylinux_2_32_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.4.0-cp39-cp39-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.4.0-cp39-cp39-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

onepassword_sdk-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl (13.6 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file onepassword_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: onepassword_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 34.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for onepassword_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 dbfa0914a8eae46ac5a5c924cd0c96ca5be3755b320740a5ef2a389216c2f68e
MD5 495a6ecc9a9e440b8afa85671995f836
BLAKE2b-256 7ee7004a561d60c91bf0493dfdef422813848c4695e70d9715cc832757985823

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 35ba70572af64f0b5736f4673120e7931e58c7c7008fc1fc8f27b21923bdf65d
MD5 fcc9e1cca2e579b2385cc2c8807c1e55
BLAKE2b-256 ca9cd5e95cfa7495127f962f171ab8e0fd7daaa91c7c0c9281b500d3c0af74bc

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp313-cp313-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp313-cp313-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 6e1775ec247401e8be5c8e31b334d01948c543312e0cbdcbcb49dab03e526d19
MD5 92dd8c338c2e2167efd52cf8d4a317c0
BLAKE2b-256 d7f85be5ee156456d88903f5ac965ce5d00cbfbb06643bbdad305311f97e8f1a

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp313-cp313-manylinux_2_32_aarch64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp313-cp313-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 1ff3a24575f0489a9f51bf6900df69ab902b08f35158e6fd3bdfb9d3ca63b131
MD5 1d2be930afb34118ae0abf7c7255d39a
BLAKE2b-256 c4d4404da62326bea04ade970dc88c7b556b756edb79f51b49a017f33b3ecfe8

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 751b2279819320f09db2735ea36f6612e1d46c897679bb35ab1d28fe85acbea6
MD5 b811af54825c22ea066a271b42b05270
BLAKE2b-256 be45e5eb2416112ab3b05ed8bd27aab92374c5988583d82ebe02146368520c40

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 39fc7832fdf9304c18c658d5ded36f5128a8a811acc1159e6755f86303bb29ea
MD5 f2582752afbc31bd15c6e7d7f7d0d3f7
BLAKE2b-256 fb0d23456cf0f6a295d9c945522a543edd686598c9a4ceed2fa61245cc64a5c1

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e02a4eb4e11d3bf9be055b866b0f52011fe293f612c378192e9ca729381217dc
MD5 16c722b3bb0194e1fe13a7bf53b416d8
BLAKE2b-256 c881cb7377cac5d5996e4c580aec6d4d0b1d7b5ffa225843881bed86e93d2f35

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp312-cp312-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp312-cp312-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 1ab3cf3a116b77288ac985a5b141a1475cd8b01fba10aeb046337f972aa20e0d
MD5 6dbaf1ee1d9f4f5e6fe20f8d4de830eb
BLAKE2b-256 d0cd03212cce57743aff296f68a79f5cdb810b28f19c8bdf4a9ba5c9a377b569

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp312-cp312-manylinux_2_32_aarch64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp312-cp312-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 cbea5920c319a01faf9c711cb20337acdd9fc9a94601c065c19c70648ddd5aa2
MD5 a894b7f50c13a4d27db79b810f26e0b6
BLAKE2b-256 cebb671012ec4b2597d5ac6761d72816487a905238d44f0be003a47f57e9cb10

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b5b0864774c1b5f8d434f64201c6ba00bdac8daf3adbff13ce4070f4e9fcd15
MD5 4a76907e78e0ce89589a6fc929e7a11d
BLAKE2b-256 8369413d47c1bd468007e138a58c967a611ad61427f0b57b0e6e09a1b04199eb

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 93d16554c2cefde6232d880030dce614a0541ac4b61b395d9d450b8e839f53a5
MD5 58ffc4e1d309363831314ceaabf581f6
BLAKE2b-256 a79cd2c0b9723fe659a9726d1168d852ffc668c705fd4f5fad462b35917b5348

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f071957fec369828217263630bfcaa8db792ed08d4705b194a7a92f02b6618f1
MD5 7651e97cc6dcb3c6e9b0fdd1587b8a05
BLAKE2b-256 ca69b0584d5659bf8ce827539157e3d8a769ff33c04a8868089d48f8024fca4f

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp311-cp311-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp311-cp311-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 060d20714a331e70392cbb18f249d65ac9fe4cae22076f5e0beb3d0a29f5a6cf
MD5 f86dcae629a0fe76f8eacf61928a2ee0
BLAKE2b-256 df2aeb2fc0168fdc3ebfb6bd82c305773f8e7f839a508a278a4e6e565cb9616a

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp311-cp311-manylinux_2_32_aarch64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp311-cp311-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 1e8d7a13327cf675924f8786e24bd89049b2879bcd3f7aa407b5fb1cbec1d973
MD5 cc2e4705b08e3efe6de61c8f667b1a62
BLAKE2b-256 4fb775791d0cf7777a8119551420aa421bfc243dcfbaa37afaae8e4fe7c634d4

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d6477d9d9604566655a1ab3f995fe71e1f7b3b0b6e5e797d07982cfe13abf56
MD5 ccbcb947ee3040619063270e5ed64ea9
BLAKE2b-256 4b49d3050dc93fbc9d44e0b3f64af16d5583047701ddb8bbdcb1714dede9630e

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f4fa3b8324bdc4be4b869f28a7d23604be0c52f8f39015b45b389620dd321da4
MD5 d84981d62666dc6fca84fa4346eb3c5f
BLAKE2b-256 d62f83630306c187af478f378fb5a58d1e91be22ac9abad34602d6d92887c204

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c99d7080c1fd15d02157da0c502dd53b24ea36bb5c6bcf6d2b5a7f8d8baf893d
MD5 f04400ec8950add93a697216fac9dd88
BLAKE2b-256 9a3de447750519772c5639b5aefa65af0e25841428432bece5f602643bb64a01

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp310-cp310-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp310-cp310-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 62152572609e4d5afe8c4741e44149459ab8a4e6fd2da30f1fa4fa9d2014c738
MD5 099aa07918d26ea8db0dd62dc34e5fa8
BLAKE2b-256 919876c202f2df2969b8a927d3af326c63af5df098e114afffb4d99970b3f92f

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp310-cp310-manylinux_2_32_aarch64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp310-cp310-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 f4849f87654ef5ffe8ca3bb96197183f973f59255d2f8f591ad6453761fcb2e2
MD5 7aef94f05e9d23e8280570b9244aeaa0
BLAKE2b-256 9e490e56843624097f7b44f4574bb481ffd33db3874309cc3e4093cc300bb353

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af19c70893bc3565617d9d2e42446632cf872a8681f676f65be2b6a9a6ba2bd1
MD5 11a939d2ee7c9dbfd8480484a840166a
BLAKE2b-256 86d1e02d6d7545bae2e761d5c3f236df9c272e898b4fe591af9e109d622dee62

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4b1b845c704f42b9fb5221649836e3c07eb63de9cc10d2e271afc383478b6443
MD5 ef8f8a8b6b2cf86366734593530dc298
BLAKE2b-256 c569f0bf619d26399cf7c43ebf8499f1311d029078ce63e4a33184094d11015f

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f6cd0192f29f164552134f26c7300daddd6153ce359755634f24d89c8bb199ac
MD5 04039ad683991ca698bc7c2cc3e8f13c
BLAKE2b-256 a41617394761e09139c332878cdc105c3939eb4885402f15d160fbd4bc45c26a

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp39-cp39-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp39-cp39-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 67c0a838d47d3bd0d58a8dd136d47115a337ed784982452efbcb80ed0181728f
MD5 f2ad2827d6366564703b7b85d8cc46ee
BLAKE2b-256 20d9aabbec9ac27ddf42d062f5327f3da4b5ca1f5ce34b3319d5e0ec41fea67b

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp39-cp39-manylinux_2_32_aarch64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp39-cp39-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 2526d9b04eebd29f2519f15293c801a7fc2705c9df02358aaef0fb8b72db161c
MD5 b0f8c1594113f0dbb0740feec75f3287
BLAKE2b-256 22fb54e1615166330f10bfaed806b2872bb3093a49ccb1e4a4e50ada7275e150

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e179d6b69c96e5bd40375f7eb08194a54693b4807635ec168cfd6fff4fde84e0
MD5 aaf7f996a210070ca4f929b6c68d489e
BLAKE2b-256 5290e1f5867161e20605a0b4f7c520327698b34e05c59844df37a7f6e70308e3

See more details on using hashes here.

File details

Details for the file onepassword_sdk-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c533c829cd9edeceecd53f7027fdb7fd81a4de6153e46f6d126a7cf91d082d4c
MD5 4d5a29aa8f8f151e9fa0980ab7f4b7af
BLAKE2b-256 2f35195045a31f950809477c8aec277ec39e5dc423ad8ffa35d9cd629d951256

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