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.0b2.tar.gz (32.8 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.0b2-cp313-cp313-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.32+ x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.13+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.32+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.9+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.32+ x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.32+ x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.32+ x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for onepassword_sdk-0.4.0b2.tar.gz
Algorithm Hash digest
SHA256 86163a03928d3f652f0525430d2020d74b1fe799ea9007b6f29ffc00cc068473
MD5 fd4f9eb4371e6c0bc783b6f2fb66a28c
BLAKE2b-256 4a92bf66d3783e05ffe0a80a4c0f83fb0f852a729a74ed58e2a3fcee8f956caf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8b9c34aa1dfb959c0e7a9c2625577db931aa59168106ff4d29f6c9f260daebcd
MD5 1d6e1a3d134dc8dd8cf1247bb60eae10
BLAKE2b-256 630507f9e81ee8cb8a15647500759e9b9a67cc0c81b54576e9008b78dfd34d66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp313-cp313-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 12503ecaf4543067e7717fef08c610c222f4a6b3568440cd2e5d7a1e749ae7b9
MD5 285d55538b56cb563e287a26f63c5f47
BLAKE2b-256 40c24c7810e46a27e9b1a69681a90ba33d66940a56cfdcd7e0daf15c7db7b620

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp313-cp313-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 41af286864a839da610234c6680ae1c38c0154d63293aaa99005fa33393353cc
MD5 e16a9e6beb981fba4bf07b2ef0d8dba0
BLAKE2b-256 a777587436ede700bdd7185cd2781b2247239038e1448dc790499a198ee840ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0929a38b34e0c690324931187b7a37473711560b0a0ba0b2b02d25e7158ad399
MD5 c162800fe52412f8e35d03982afebeaf
BLAKE2b-256 f0f89a5ed73e1fb2685ce7ffabf3302fb2d07aa04e18e3fdf4df217e432ac88d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b09d0d942f6d9c46ba1b73cbcfec2514d4bf2f93632595e98920b5f345a6d847
MD5 17f70627bc44c80c72fbfd42512463c2
BLAKE2b-256 acbecde4855c0ea787fc967cc284e5c3c9da16653c9fe922c33b58e43df63283

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e30313086f170c4a682b10a7c16f08168a94f2f4e5043c9bc0ee322011fc2190
MD5 72ee532963e0728428a175bafef995d2
BLAKE2b-256 ce3dc8433e02fc0c17a4a93c23db255c501cc5d3c655c52b34f238754b27fb25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp312-cp312-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 2ad699593b56cc0486246ae8fcf98edc8b94d7f847d4f1b62eb3706539deea34
MD5 a7205c8958fa9e59f3e7c01f5d8a01c5
BLAKE2b-256 8c2a9d2b50d98c5a0844f7d6da5f4cdfd0bd218a5f7a595ff36292564afcedfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp312-cp312-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 9cc88b576cd6aa9695edfd48654cc7ac92db7ecd7ae8b9c0a8810d7e2fd36207
MD5 3bc1659b062ccfaf2f0c29455f9999d8
BLAKE2b-256 e482ba87c4e83a9f7042b39a9113d01e5e9dcf1944f105123b0f074a4a90db53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf8e50bfa70770e743899544063ed5d32343a6b95b7aebbdfee67c2c46d0ddd8
MD5 b22d130f26e1541de945b93a25701f45
BLAKE2b-256 5aa9beac7328e666bc01b6a6217c978a94df48f36c79e24bf7aeaa0b08297d22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0579d243ffc2ce2557a88c4cfdbc460487a4292153315128aa81d495b3d55242
MD5 af9db749986826c843d56216ddaef70a
BLAKE2b-256 75c6395fad3acc8ce9effd2d29b8b94d8c79ef301097263b154acda94fcdabb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 791445741f4b3bd52bba707e814d6ce656825755d69f3626b61cd1464ad9b2e6
MD5 4956d4aeb7830306838eb980912f7c46
BLAKE2b-256 3fe28cd3e79a30755dbfd34fbac92529eda246a493c6342606b4487b45cc07f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp311-cp311-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 10b7b570284eb8327e3024f1bccebaef33a7a6147a8769f572ec07336e8be8e8
MD5 1315136e69cdb762a0f3cb15958d0c6d
BLAKE2b-256 bc9c19edabb279daa4ee02b403c0db227e2e57d117af136b8752712d0eaea3bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp311-cp311-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 2eb71fc02e7ad694e67e3b5b68815ff3a7fbc6be28451605374a081d60d63462
MD5 85389eb6f4aacebea4c4b56c308948aa
BLAKE2b-256 ded70cdf13a500d08af2636973436a0b4d42a0bb495f752ce9bfceb47b6bdb22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6a699bb7b455eae6108d2730353da89831ce517bbe599641eb96969e8779b6d
MD5 f7aca8fb67d0cc123e557eed6b469262
BLAKE2b-256 6367af93e87454146ea7633cdc789f6794e8637e83c471c5d983dc64e7b4a784

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 24bfaac17a2b955b623947ea1b5a30607610deea05a4df64bec987a2cb2d2abd
MD5 5df2114c9c3a65f42319fc719d28faf4
BLAKE2b-256 8c3d3844cbc7fc4d0fbac448c096877c7890fb631a9197a97f23ef0883bced42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e414de968c03b936ec8418159fcd163248e3bea30c32930d2856b2c3eda52aeb
MD5 0850e276870f29c09e07996232469744
BLAKE2b-256 0019108b43382a7c06c36ca9cc04fd5a07da7f121b1098eb29f78c6c6cde7393

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp310-cp310-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 c68773dba6a264b34b0ddf2b5ffca70439d0c344b20863855bf205ea1c7ba92d
MD5 0468e79e346e674b3bc1b7cc0a7c65d2
BLAKE2b-256 41da3aa1b1afde0b760f010e77ce0a7107480e7f71e76769b454f67012113f0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp310-cp310-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 a2ae2614a7ac29d04d213ccd4e8a2ad6d9c618afba1e53ff6e971d497e0b00cc
MD5 346dc92bc07fd3aa0a891ee74fbf3ddd
BLAKE2b-256 f3e6d169c28713d770fd0bd190096c774b2832dbb8b4f43ed6c5ed6a90c8be53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34298bf4c696ba2a0dfa45dbe2ed9fbb07daa3e11f253e44e7a5779b92f40298
MD5 e292b52dd50c1da2ade421e8d52ba9f0
BLAKE2b-256 9957aae9b99d695132b117c4f5447b6c27097540dbf9a4a793e84103af718bd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 76ec4e7651c9a9c74a9efc17b97366fb2db44def28ca55eee1cc949f27c902d6
MD5 4d6e849552f76ff51e59b14ede82ec5f
BLAKE2b-256 af1246f772d446d6adb45f3b959e903095f6b010254f9495861f615d1a0cbbe2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c0a5110928af99e26a7e8aed435529f36c107c359666ead0c1de9a4a7223e109
MD5 b06bfc0457ded82bf474be78b5ab5d68
BLAKE2b-256 fb8e921ecd5f0be6422869f4f3d6e82f1934bf7d7ace6d2184048c1225a7541e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp39-cp39-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 ff0dd28eea636161300a7f4d728023005f629e8bfcb9e0f894b658434d077cc1
MD5 e7b0ae31b51dc7e223dbcc4ca1e84793
BLAKE2b-256 ea0d681120af0ed2226dad00f27231ec85b0a33a85e24587b2dc688b1d6dcb8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp39-cp39-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 885e92fc32e5a2ff6060ddf2463b66d3161cc42f611b3b46b97624093e77a954
MD5 57d33f95e097190251e8e371a923d0bd
BLAKE2b-256 7c4f79b67fd0906787141a2316c9eef7f620d36ca240950f9b5eb521d5c6901a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d488edab3ad267f284d1e18ea13657dd9632317ebb99bb9021a7449a99daa1e
MD5 a18257fb1c9704139e14bc170edb9645
BLAKE2b-256 ed9499ffed0b2975aa5044dba11c78cac21407098beab8ef275b3bba84111605

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6b2aaa4ea85b2a9582c04642f97305aa174eca909845b8ec70eb61cdab529ba4
MD5 43fdb5a03a4ccf0eef537b9023fd0f45
BLAKE2b-256 6099efee3a4c029688b666bd7aa32f29f6703a7fb6c32346a6f769731a7774d4

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