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.1b1.tar.gz (34.6 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.1b1-cp313-cp313-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.13Windows x86-64

onepassword_sdk-0.4.1b1-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.1b1-cp313-cp313-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

onepassword_sdk-0.4.1b1-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.1b1-cp312-cp312-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.12Windows x86-64

onepassword_sdk-0.4.1b1-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.1b1-cp312-cp312-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

onepassword_sdk-0.4.1b1-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.1b1-cp311-cp311-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.11Windows x86-64

onepassword_sdk-0.4.1b1-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.1b1-cp311-cp311-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

onepassword_sdk-0.4.1b1-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.1b1-cp310-cp310-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.10Windows x86-64

onepassword_sdk-0.4.1b1-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.1b1-cp310-cp310-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

onepassword_sdk-0.4.1b1-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.1b1-cp39-cp39-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.9Windows x86-64

onepassword_sdk-0.4.1b1-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.1b1-cp39-cp39-manylinux_2_32_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.32+ ARM64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

onepassword_sdk-0.4.1b1-cp39-cp39-macosx_10_9_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file onepassword_sdk-0.4.1b1.tar.gz.

File metadata

  • Download URL: onepassword_sdk-0.4.1b1.tar.gz
  • Upload date:
  • Size: 34.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for onepassword_sdk-0.4.1b1.tar.gz
Algorithm Hash digest
SHA256 e7a6b6fdae3df09760516633a5d2dc815397000587d1ba01f5ef47fe5ab5fcee
MD5 b494b301b9ed7136e2a86bf8bb0e6e3d
BLAKE2b-256 52136bb49111471bddbd3f9db3cdbc8a859a6fe633c9455955cd96bdadb8fdcd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0c06b7df4108fd6a999b9427835c60556e2c94df52e582702023502c6a1b8044
MD5 7cd9eb4dbad151a047e4a2b9ee527566
BLAKE2b-256 83866eec4c512ac8ca39076292f1a8df1b3bcf7f7778f2f9bd37d82b03554bfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp313-cp313-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 c4541228ddf63e79f6b539ad49dfebcec48f8193a1cb974d9ceb595eeff670ff
MD5 9f5ca65739a5bdc224cfe9725cdd8bd3
BLAKE2b-256 bdf47b60d5cad2ff11bc80479f67d9d0091cfd1e4750cfafb6edbe5f04b06ed2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp313-cp313-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 669bc9b6808e74f8522ee4e4874ed64a94d4d30477984c730736d68ab76d71ff
MD5 68015fe98c4294d685ab97fa408d1ba4
BLAKE2b-256 6c2ff3ce924d141813e51d75e79c72c050b382fa2e674462cceab1d9766f9436

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d402c76d6cb909bf3df2e3bb959f071ce3801ffabefa199cc2863e70256dc74d
MD5 f885d3bfbbd1d8db604f506e1cbbf515
BLAKE2b-256 0e06143960d89fb02d23c0edd0de940c6f38781812b9f8427d943b202371f382

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 d55f97e3cce6cee2bd3304be894366dbd193228bc7ace162be025a4dd445d2b5
MD5 72525abdcd8d121596fa424add8e2633
BLAKE2b-256 6c34417b343ffdf8928797ad9db4cb4b799c3980c1692fba979d8f04e886114b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1829697b20efc26d404b81011e0740891ad1587be54c124c871bc6c21eedf4a7
MD5 4ca0212e3f73c0188f15f71ad6e30e9b
BLAKE2b-256 625194ad18f877fdb00924ad21691d55148384423e17aa70bdcfa83eabcf0353

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp312-cp312-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 174c14569ca0634cdbf99ae347bfa4a53c64d759042112e60cf63d8dadd88458
MD5 0c7d2dd35f4482a6a06dabd4a08c491e
BLAKE2b-256 8b1d3958eaf36868f5a5852d0af9fbcd3b15e0aa20a4d2e85791a92af53360c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp312-cp312-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 b4e906296531057635490087f4423b573880c60be0df38b78845717b1fe34c8a
MD5 914458f08464185b0b7c794d6ad1333a
BLAKE2b-256 e8bb17f60a1a37f6ec6f5cfd96910f84cc47f7deaea651759302b5456aee440e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 385d3476f88e277094ec91c2922e2659209d4c7968e0c8d71b288e25763d82bf
MD5 44ad486d18adb2d60a0aa75c83e01d20
BLAKE2b-256 2bd56f27664c30ec296b61ce6c1a5d9e7e4aaa10855e3a7d1924cd0a2f624a6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7300188148f7cf8442aab6bcde97830f31963d6714b1bab947128bc1529046cd
MD5 a5c5a3e0e76034d85cdbfa4616f22137
BLAKE2b-256 731323a754c7e78d9ef08bf04b1a78444b2a2dda7e8cb51c4dc2078aa8ffcee2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 94d2126a59ba32a105459ad3bd88967a5df07eb8134b1bc1c4b738ec3bbb6ed8
MD5 b2d51f16b32e3a11ec3e7d6ce491de18
BLAKE2b-256 f62a2038aae904b34971d79999a811f1aeacf5b52dbf940539139532ce8e9ef7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp311-cp311-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 1129cd5fd498407120b66689603d2ccf0bf312930b779eaa009cc5d369a1e92a
MD5 28a9917c6f7edc0fbaea95f328958928
BLAKE2b-256 6f4cd748293e2cf451d0b30b24f321a0b3501363d95314f76eb24dadf9e254db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp311-cp311-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 78f0b10a2b3dbe71d60e6318acbb81deea3a6e0d77f869ced7ef49059fb58bec
MD5 8121ea6423be4003c4a7b34517c9adbd
BLAKE2b-256 c2bb8d174bbc53d0f81df6bfebebbcfa05a2cd324906e838837dd7907716ada2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7a90a8db76c3de7cf1687ac32a30f4abba2f192ace34ff12318059e8e25f4a1
MD5 adc743dec4741d379393abfbf5e50bf7
BLAKE2b-256 b302d1246f20a177fc9b6bf3c6b4b45e2e308ab7e4428a33c0ce3795587b8ed9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 da47a1621bedc4dc0e99c6cded6fae3514c1133116dd34ebfc435378f95d7d36
MD5 544ef0b8213634b35ece5107f0250ccc
BLAKE2b-256 c4fb647c909612ff7c47a3278f1dcc1cf08cfa68c1d76c478dc4e90a9a8ba92e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f47d55c85b17cd78c144424b95c7fee551ce8c4a5b5dd7acaf26dbb82b88f3b0
MD5 a3c970a50b3a1d8f6dabf5e4d7509b98
BLAKE2b-256 91ae1f0cc6cefb02613c18ce587a4f213f3f567ad01fa108ba4f7112b0b9a549

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp310-cp310-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 9c2a35a9a0e11b3c94c3a287b8e27f7edf34d704468769e48a3a5d4c31fb1a24
MD5 b254c7035d2f56413635d90e6885bac6
BLAKE2b-256 9515e4117104c1d77fa0546113952f5e344d28e9055b68cbe5c88e9e81de4f12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp310-cp310-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 42726f3fbf263a8e688cae5cb463b04cc40fa43c870ac86c82e650d667ba4b8f
MD5 fac1aecc2acb8a4440e5b183dee5ba84
BLAKE2b-256 9906f6d980a6bea6c7aa4e714bc89ac90e9db3a2cee71d2600dc8ccb53cf0ec4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 387c7feb952cbf2748db8ca733bf56ac6ac913cddb3ab9542a878f6050a3e4a5
MD5 cdc247e4d0c7ca1bafdfbd0dcf498e2d
BLAKE2b-256 397fcdb0ab30ff27d56e11edd715087522660dfb2c5a7548dc8384d9521ca5ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 aff0be99c70914dfa36706e73475f6bc3e7c4561ceff2833679c28873c34c852
MD5 3befb403afae003a9d777762c619fd69
BLAKE2b-256 46418b236eadf34167ba325889ca1cb4ab7cf115f2db60e4a356f7528666235a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 728470371ec016878f89e19c74ef20b8dfb4503397e37d40e7f6588e41fed0be
MD5 b7078e92a5e0e479904f18f59a8fe9b7
BLAKE2b-256 5be7825f75f07694041bd7ea2070541e3c9fa9debe06f8a484e2612c74df26ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp39-cp39-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 48ef9e3eabc7e8bb74ce9cf2f88a97db20caa23aa41fdad49e2b39be1afdc043
MD5 94ee3896f3b5fdad78fde03c6d59efa6
BLAKE2b-256 262e772deae7d4b9b4b4bc3f2fc3446d4ed54bb01ab67b5dc79daf43ae89ee44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp39-cp39-manylinux_2_32_aarch64.whl
Algorithm Hash digest
SHA256 7c16869a9aad0217c268575d7436e0f69040592584330a576020ad3ad0cc21f8
MD5 57d4746d453748877b4b20aed5334ddb
BLAKE2b-256 161fe6968c483cf36f87440cd109c46df83b0fb760ce1875f22454e5a402ebbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba2f24f73a84f357c288a7e1321d4e0f57389adffca2ca6d5f5e3a792ffb140d
MD5 217f2e7bf202235fbf7e9ad0fc73900e
BLAKE2b-256 4099c2f449885354d11c4539f0b5d20a5cfc7fed5a71b6f5884a515d00ad8919

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onepassword_sdk-0.4.1b1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d8e40dd3446e1efc9575acc0309c0d9edc11c72e5ea537037f5de6cd0abc2d58
MD5 c1dc50e4a5efc9f300ceed102718dcb9
BLAKE2b-256 91fa0a1077e90c83aa21c480d079e97f3b817d7eae81363ca39f2c164252a372

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