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 (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

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.1.3.tar.gz (19.7 MB view details)

Uploaded Source

Built Distributions

onepassword_sdk-0.1.3-cp312-cp312-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.12 Windows x86-64

onepassword_sdk-0.1.3-cp312-cp312-manylinux_2_32_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.1.3-cp312-cp312-manylinux_2_32_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.1.3-cp312-cp312-macosx_11_0_arm64.whl (3.7 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

onepassword_sdk-0.1.3-cp312-cp312-macosx_10_9_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

onepassword_sdk-0.1.3-cp311-cp311-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.11 Windows x86-64

onepassword_sdk-0.1.3-cp311-cp311-manylinux_2_32_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.1.3-cp311-cp311-manylinux_2_32_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.1.3-cp311-cp311-macosx_11_0_arm64.whl (3.7 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

onepassword_sdk-0.1.3-cp311-cp311-macosx_10_9_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

onepassword_sdk-0.1.3-cp310-cp310-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

onepassword_sdk-0.1.3-cp310-cp310-manylinux_2_32_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.1.3-cp310-cp310-manylinux_2_32_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.1.3-cp310-cp310-macosx_11_0_arm64.whl (3.7 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

onepassword_sdk-0.1.3-cp310-cp310-macosx_10_9_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

onepassword_sdk-0.1.3-cp39-cp39-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

onepassword_sdk-0.1.3-cp39-cp39-manylinux_2_32_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.32+ x86-64

onepassword_sdk-0.1.3-cp39-cp39-manylinux_2_32_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.32+ ARM64

onepassword_sdk-0.1.3-cp39-cp39-macosx_11_0_arm64.whl (3.7 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

onepassword_sdk-0.1.3-cp39-cp39-macosx_10_9_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: onepassword_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 19.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for onepassword_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 98cdf3553012279f318ba47ff4e4e156f5608c1e53f52339ecb36b5a344a9621
MD5 5c41e88a1bdc316e0a3e58afc0499a87
BLAKE2b-256 ef706992c4668ae1cf724508b755f95d63005e29f2a583a597eeb53b6c9f2025

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d3142c0dcd026a0cef73d43d5fa7017250ffd5183606d6608f3f83016cddfd3c
MD5 67d26586fb50fcf88e0afe9a88e5bbfc
BLAKE2b-256 cc39e6f55dba2c8fe0d91d85f2834fc092829d0f319133fd6776d5f51bb25477

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp312-cp312-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 f7eb326c513748b3274e30e689bcfad58d21e333170fe10a33ae13487d98d55f
MD5 2f4ff766a5cf5b2545c52792d6c056b1
BLAKE2b-256 6fd76660076ee776f54e5f75a1cdc1facf0de261bd10006d61e6207647de27e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp312-cp312-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 a82fa02a0b73564bb952e0ef2ff272a5a3899628e2be07daade1ff7a81141c0d
MD5 48eac815f6172fe06631474d837987e4
BLAKE2b-256 f2b9e0e870c289a23c53d655cf7ef47403ce269dab034ff6fe386c8ea351c749

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8f10bf6dc8357289b123fa7a5b63ca4c028189bc86f796605b90ea4ce6d7fafb
MD5 715609b53adb3093c03905b8f8e22794
BLAKE2b-256 91adfc9b64f6398199de6ea92aa221107356344a84ec8f876662363a45e06d95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bc2df3c110707e7758cdb53b0054bcc74fe64e01d296a55806108397788657bf
MD5 cc3475a176073c001b46d857823f43ef
BLAKE2b-256 f66db81b6065c5434778f25d3e072f7fd9b126ae59e6023fd4affc834ccd9829

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 002b06d655ffc80516c2a9209fa5fd563f78c0e62bd4359ae65680a42eee103f
MD5 3db576f8545a448357adf42aa2e94619
BLAKE2b-256 d1b703bf65f34d566d3b9b1cba133dc22f99fdda8e646e532216d21ba26c5e22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp311-cp311-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 b722770f37561994630825b96e90941863c15e4215b5ff7a57dd8a467fc83b77
MD5 9ecf805e36efe07ac01ff5452a3fdb65
BLAKE2b-256 512017698aea262647cd82daed0ab379df217c692038195d18066e27c34d7c0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp311-cp311-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 2f0287559467391b3ed4d1a591c5220ca441090df0b069a110a21b96b92dfb18
MD5 8c7943d80944b8b11e6471995b84cc72
BLAKE2b-256 c795b841fc8389b3f6ba1341e1be2524b9926e30b0aef61532ddbc073a20a231

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73cb42e8d40fbf9c660885948bf7f7b28b39a4d71790140a8363a0497bef8218
MD5 17999de247784c913c3bfa2ab5e1e19f
BLAKE2b-256 8446f2b38ecaf12433f4d8e4a88cfa9af40c4b858e2bb2e16eb5592a288dd59b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a97cb3bd91c6e86cd758dd3390ad89e6f7f9493b5003b35ee68c2e021a9a7199
MD5 d7a76291071fd7439c9ca8bacd6ff9e5
BLAKE2b-256 0e33f7bdef70bbf665095cc5bd5a07a1a39ede86e18fa25977bd2fa264f6ef26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3cd73b5dd795faaec72f800b4c500cf2fdaeeaaf1076d4a25b4dbff5f4c33fb1
MD5 a7aeac42b31a7e47c93aaaf617b45c93
BLAKE2b-256 4f26ecb73b3f6d4c52a001d059cf1beb20a6eb37c38cb91dfd10f3ae34dfdf93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp310-cp310-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 350596d6a1d20badc0010807e148e58b7591201dfd676a421708abf146dd8274
MD5 0a354ffbadb61d375b3dbb58f4c5763f
BLAKE2b-256 b1bc9a96b5dc544ae4301b93b33a73abffdf3a03fce002a6b9d0a70c781842d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp310-cp310-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 a24519c353ce0ec96c234bb460bcae4bc39bc83bd914e365786910684313866d
MD5 f38ce0a05d8d61f44a2ce5861ef021a1
BLAKE2b-256 d673d1641ccd9ea68843e8dd79297773ea486d6b443a784c0a242d3be0119a04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 88516285bf996c448e72509c24a2eb95646087e5e767e27937ee35e22f9b1b46
MD5 86d9c648cae87bd74111b520417f0e21
BLAKE2b-256 88c4f217e7540d5245aa5481bff610437df5a1c7763d62c489760bcfcfb5322f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 16b75c479efcf7dbe1729ad220851d029cdc46b88d0adbd88997650d2bdafa3b
MD5 860607e8c7d320bfa71d53d7600c66e4
BLAKE2b-256 9b5bd2fb0562f15461693623555f949f626b77d6b8711ece283cd3e61c288613

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 837ed3d609ac06ec5f0bde4e8513bc50396606de07e73cfca6856ea572db8b0e
MD5 082b2041452a039456e303747e8471de
BLAKE2b-256 b2261944e74a4f3dfff9c5484175bed2a6f3b33c1be8c1ad6be94bf8c2b9a350

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp39-cp39-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 8cad08ee606c0c11f407747050869bad2f95482abc437999a2cdfcedaa53a31e
MD5 8f6d9c2c895aaf438fc2b1d0528d7988
BLAKE2b-256 0920f51bad03ba4143d632469b8cc3b1a753050851c7e48dbd25aea2ce2744dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp39-cp39-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 f1ed540661a41d092aa2219de925dd58e75c5a190e204d2accb4d24379a399f3
MD5 1c55475e2a88ab9f7fac3c1cc3de5f22
BLAKE2b-256 7f6961fbf69eafc13125d8cf5a94a6eb6589b850b1ff9a78bc187aba3e88f0da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 995bb8c70133ab9083ac69a70fb3256555a6f423674ea125d79e7d8630a354c6
MD5 6344edd6c9318071464f0f8192bbc5bf
BLAKE2b-256 181635f22a79f3e49c7f2004f966db022a80dea5d53b8a19ada98b4fc522be28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.1.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d199bb4df6f17845e9f3a5b0990bac5da29d759a232d0bee8aff0f5f317048eb
MD5 8df816292dfa3c259b3bb477ed52f3be
BLAKE2b-256 f0d18f02c6543cdd486ff28f11513154b18df2736ba3220ece5502bc196e4d7e

See more details on using hashes here.

Supported by

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