Skip to main content

1Password Connect SDK for Python

Access your 1Password items in your Python applications through your self-hosted 1Password Connect server.

Get started

The 1Password Connect SDK provides access to 1Password via 1Password Connect hosted in your infrastructure. The library is intended to be used by Python applications to simplify accessing items in 1Password vaults.

🪄 See it in action

Check the Python Connect SDK Example to see an example of item manipulation using the SDK that you can execute on your machine.

✨ Get started

  1. Install the 1Password Connect Python SDK:

    pip install onepasswordconnectsdk
    
  2. Export the OP_CONNECT_HOST and OP_CONNECT_TOKEN environment variables:

    export OP_CONNECT_HOST=<your-connect-host> && \
    export OP_CONNECT_TOKEN=<your-connect-token>
    

    2.1 If you need a higher timeout on the client requests you can export OP_CONNECT_CLIENT_REQ_TIMEOUT environment variable:

    # set the timeout to 90 seconds
    export OP_CONNECT_CLIENT_REQ_TIMEOUT=90
    
  3. Use the SDK:

    • Read a secret:

      from onepasswordconnectsdk.client import (
          Client,
          new_client_from_environment,
      )
      
      connect_client: Client = new_client_from_environment()
      
      client.get_item("{item_id}", "{vault_id}")
      
    • Write a secret:

      from onepasswordconnectsdk.client import (
          Client,
          new_client_from_environment,
      }
      
      from onepasswordconnectsdk.models import (
          Item,
          ItemVault,
          Field
      )
      
      connect_client: Client = new_client_from_environment()
      
      # Example item creation. Create an item with your desired arguments.
      item = Item(
          vault=ItemVault(id=op_vault),
          id="custom_id",
          title="newtitle",
          category="LOGIN",
          tags=["1password-connect"],
          fields=[Field(value="new_user", purpose="USERNAME")],
      )
      
      new_item = connect_client.create_item(op_vault, item)
      

For more examples of how to use the SDK, check out USAGE.md.

💙 Community & Support

🔐 Security

1Password requests you practice responsible disclosure if you discover a vulnerability.

Please file requests by sending an email to bugbounty@agilebits.com.

Metadata

Release files for onepasswordconnectsdk 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onepasswordconnectsdk 2.1.0
File Size Uploaded
onepasswordconnectsdk-2.1.0.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onepasswordconnectsdk 2.1.0
File Interpreter ABI Platform
onepasswordconnectsdk-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.4 kB

Release files / onepasswordconnectsdk-2.1.0.tar.gz

Download URL onepasswordconnectsdk-2.1.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
63f0037b4272416bc8a0d1f31a2d56dcce64ac111705c0826adc201da76ce33c
BLAKE2b-256 checksum
How to use checksums
304c584888d2966e40f79ffbdc2a7295bfdca56ee17f34c9be4f146a718882a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / onepasswordconnectsdk-2.1.0-py3-none-any.whl

Download URL onepasswordconnectsdk-2.1.0-py3-none-any.whl
Size 34.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e7816546ac1bb2d1b3ee5353b6e599932f098bedf1f211935ca8e3f8f9a8684
BLAKE2b-256 checksum
How to use checksums
c47d3e4b7da9c6b5ca59091ed2fb585a650423314c165423ecaa1dc443747f1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page