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.0b1.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.0b1-cp313-cp313-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.13Windows x86-64

onepassword_sdk-0.4.0b1-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.0b1-cp313-cp313-manylinux_2_32_aarch64.whl (7.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

onepassword_sdk-0.4.0b1-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.0b1-cp312-cp312-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.12Windows x86-64

onepassword_sdk-0.4.0b1-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.0b1-cp312-cp312-manylinux_2_32_aarch64.whl (7.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

onepassword_sdk-0.4.0b1-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.0b1-cp311-cp311-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.11Windows x86-64

onepassword_sdk-0.4.0b1-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.0b1-cp311-cp311-manylinux_2_32_aarch64.whl (7.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

onepassword_sdk-0.4.0b1-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.0b1-cp310-cp310-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.10Windows x86-64

onepassword_sdk-0.4.0b1-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.0b1-cp310-cp310-manylinux_2_32_aarch64.whl (7.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

onepassword_sdk-0.4.0b1-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.0b1-cp39-cp39-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.9Windows x86-64

onepassword_sdk-0.4.0b1-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.0b1-cp39-cp39-manylinux_2_32_aarch64.whl (7.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

onepassword_sdk-0.4.0b1-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.0b1.tar.gz.

File metadata

  • Download URL: onepassword_sdk-0.4.0b1.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.0b1.tar.gz
Algorithm Hash digest
SHA256 f291d4c4f39b1912dd2d910e779dc959686105aa1afced101c15dc7d242c3c5b
MD5 985ce249cf0a18c7eaa8bbccc21ed60b
BLAKE2b-256 571a60efa9d07560ce82768cdf388e8f86fead2d2b9a80ba66edbf33ce12b436

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ed7323406aaaeb60804952b859d2d548a3464913f65670819cafc176c41fe973
MD5 ee28702c84836b82baaee9cb5801e0e7
BLAKE2b-256 3f9ce6a9f03b48c8b2d81698d03a21f58827855e474b97f109686849a36cec01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp313-cp313-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 f70dd25eb90f2a7a2b186255cd2fcefce91cbd1327a33da7b36c162b0c73a8fb
MD5 f80400a37c8c471110f5636798f1892e
BLAKE2b-256 493a0b78154845b1a3ecadefa3002f6e5fa0365117f98a981b70dfee6918caff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp313-cp313-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 adc7c0c5de7172c5982a398544459507706c52915302a248675069e709c8dc03
MD5 10b178c4a198555b236c5da2a006a6c6
BLAKE2b-256 e5a0cc337fd392b7a9f3005e684e7e544c86dc490e1aff0d20c340c2bd12fb71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 db0a5ceeec097d1539d604d75167db613f46b89a44e029831af7b2765842f0f9
MD5 5e6308191ebdb6689edd929f207e9aff
BLAKE2b-256 d449d76f014adcdbd7eb635f98e75840781710883d5bec6723a7bbc01708acd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 e4ce07944ae7f8992ca021c8227714344132a01a9e35a3e8efe338a2deeb12d3
MD5 869a96bfd066f66ba0fb9c02020a9b0b
BLAKE2b-256 3ba4278ba6bb6d2be53b9af1abc12609d9b362c21fa9e2f37e21f3656f494631

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ae4edcc1551d271f9c50bc78debd0d9633270c71852cd365e6dc04465970beef
MD5 fb1d63ea5f45f249eab1e45496e8aaa3
BLAKE2b-256 aa0042e2e7b66bfe3b7575e57607c71d69a15490cd7c2396f3ce3da69f4fc8cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp312-cp312-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 c1c38224820216cdcfb0834bbcb19659149e3c1c13586b667b6a978a350e9874
MD5 69a99c00d937a63d74019406ac2861a4
BLAKE2b-256 8cc86145f88feae8763b66e8a58e31856ade1289c289d62844b518dffa7903a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp312-cp312-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 2c1cc9685d647482bd436f75c24e18c5e78c5b913df55ab8bab19aa2905a2618
MD5 b78ef6f25345481e1a8cf466741bfdb0
BLAKE2b-256 47e6bb8a59109dbf0354dc9f6dab48522d18b858c586a019a9e8a38587a6d8fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afe1ff354401f3529e11de5ab28b1077b9a2b665bb345f30898d0ba7cf7fe868
MD5 c7f9b9e6e0a883862a44e59d7a529756
BLAKE2b-256 9dd2598224dc4e60ac7aadb7c8909616489262ee6262bc8162bfee156d0a5eb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 55a2c4993346349d187197172f03a4ee580208ed8b185555d3d6593c73d63a4e
MD5 865b4712b49339eae0012f4082d12157
BLAKE2b-256 24d1404f8c1648acbfd9672882f31a34b7fbfeffa44d14d3d6ec1fbe9a13a52d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5829f091b8580638e36189fd1001f3aaceb180f6f31cc07a2e2a072b28b3accc
MD5 14839b37f4c2a1f936eccdcce0bce763
BLAKE2b-256 bc934b8c477e585acf80b6417e825e3a64db573693225bcb9dcd837bed9866a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp311-cp311-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 74b66bb880bdb010bd0cb1dd805394d985eb3b0c91c3d6c1b392db701d57fc51
MD5 6ae517f29f03a221b07503761dea2ef0
BLAKE2b-256 8912be345ff563d64decaa0a329a246b3040f256ea07c984b78f2719dc1aa8fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp311-cp311-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 e36b4e718ed682905a3f53501dcdad8b014e5e18a97a3a352e584d7bf27700ec
MD5 84e2ed24a8d631764991008d0c774c98
BLAKE2b-256 e51a90dfb7c6e9e9a7457054bae33549dcace79d1d9cb65215e594b00ce73e76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ace734dce19b9c5be39dc49687b4591fc654f1a07c4db957437460dd4ca8dc8a
MD5 69db408578f4430d22195285d785c11a
BLAKE2b-256 eb692b0ffd1e1bba1e6c1b912cb2915181b6ea305f947b4f426150f3db6e44d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 43b54ef02929d98544b755151e42a3e0fd2a1f6283df8184aeba5d7e61d70c5b
MD5 9d0ffd504edb144e999baf746026cfac
BLAKE2b-256 79fb91fe588d1791e8dbfcfc8dd33e955be339baa84f4964a9d42661d68476fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d8edcacc2e78b7440a21319785b9a14d49eac32b6153951bbdbd8e73f1ce8f0f
MD5 649c285ff18ce83cbf45de976e5c11cb
BLAKE2b-256 cb86cd08d040d5d7d6f2bf8220f45a81311f82eaf119b374bcbd2f631cae5362

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp310-cp310-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 7781cbc2f415725c58305c369bef44baa8f6bbc539be42c05cf404dad1ccde34
MD5 397c3fcef22bb4584ff186bc20f3b619
BLAKE2b-256 846c8019063f291f9d638b637607ee1888bbac350537de256e19d68bce31cd68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp310-cp310-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 7c7c5dd4bad2014dceb2aa4c9c16f88b2afa3d4c65fac9a39267adc2d0356fe9
MD5 5984905edb054a66fac69ef3b312fc57
BLAKE2b-256 5c71e2ce1f2d2a014383df2b4e678b24c03c8ccd5d0cf780bbc7b88f724292c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5db655e1ada93abffd4c832c241a24d021080d5683a1fe887c9b38a439319ef1
MD5 904ab564ecb4ad4da036190757cccfeb
BLAKE2b-256 64bb11452156fe9307b24c265bbdb713d15adaeb2c7e9c447528a74e867922ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c7d95aa25c6ee8445e0365afb1b9a654c83be2b094cb0e6571604e63a791c4ed
MD5 8de86065f88181bfc7cd2331ad3cb707
BLAKE2b-256 09e199c8517dfa3e1f44d9c09ef80df9a1998b3e024e3823939bd432cbc20cee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ba6a4828952749b4248d24632510ec6241ea5a416cc7a42f581c7b843ebd1054
MD5 7555520cbb406539e9b7cd229125c1d9
BLAKE2b-256 59798b35d522b7976828615915d4398b9740a322328f93589336f9e38ef85fd1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp39-cp39-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 1b5445b61b3adb51a779fd3cf68ae2bb843dc3d3c52f8ba4d4a888fbc7f12f5b
MD5 2bbfa3f59c0d1204dc53682d1be610e5
BLAKE2b-256 d4e7b7717de954cea8bb090dcf291eaa79e3962804d54282379c8c60b3c0fea8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp39-cp39-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 e0dba79ca9657cec654d502d5188a786f84c907c3aea4e70cdc1d50ad0fa1d31
MD5 e51f09a29ae1b113973197d19b38412c
BLAKE2b-256 f6a9a05c7cffc1b6f69de79fbc65b6deafec52f0cd609898bc22c3901550a6dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a7a2be59be691ecbcf825fdbd8f628f202de6487cb5b6ff76e632980c955d49c
MD5 15d065351b14ddc86635cbab72e67090
BLAKE2b-256 c7d2494adbbc21883ec31b69687ad5d945ddf7d2d5e0fa778001ea33bbc0d4d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.0b1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 04eb99c2d0af00fa1b82c0e9c4e25dcb02f46f1917e8d6016e44b35378bf1e4e
MD5 895a6eecd803bb4d701aedc8cef03054
BLAKE2b-256 6cbf9d90f1d7363b291dd53af317b92a646e69f6aec1c6c78a1ed8f9cce8068b

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