Skip to main content

Python SDK for 1Password Connect

Project description

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.

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

onepasswordconnectsdk-2.0.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onepasswordconnectsdk-2.0.0-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file onepasswordconnectsdk-2.0.0.tar.gz.

File metadata

  • Download URL: onepasswordconnectsdk-2.0.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for onepasswordconnectsdk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 7247c9001df5981ea613e1496b75ffd830f576df721a58f8c18ee8de44fe1ef1
MD5 37782148bd77ba97bad06aa280df430e
BLAKE2b-256 e238c6555a61c1a1e0b481e00f1659e05d0754df949c88710e5d11248c84478e

See more details on using hashes here.

File details

Details for the file onepasswordconnectsdk-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for onepasswordconnectsdk-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62686ff54aa1268c9809205f7f19e82c7cc3e5b35ca2f522f2dfdb6b2ad69b33
MD5 c757e51ded3b0f01103b28102a9203a6
BLAKE2b-256 224122ddefdb7e8d8a7ac1656079b2ce5bc9a31eda58ba64e9abc71d2abab026

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