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.
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
-
Install the 1Password Connect Python SDK:
pip install onepasswordconnectsdk
-
Export the
OP_CONNECT_HOST
andOP_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
-
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
- File an issue for bugs and feature requests.
- Join the Developer Slack workspace.
- Subscribe to the Developer Newsletter.
🔐 Security
1Password requests you practice responsible disclosure if you discover a vulnerability.
Please file requests via BugCrowd.
For information about security practices, please visit the 1Password Bug Bounty Program.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file onepasswordconnectsdk-1.5.1.tar.gz
.
File metadata
- Download URL: onepasswordconnectsdk-1.5.1.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8924c614ffed98f29faada03dba940dc0bc47851b1f5f4ef7e312e43c10ec25b |
|
MD5 | 1b21eefe1a56b63c21ea4b33cba97c22 |
|
BLAKE2b-256 | 0806980c10fa595fc900c465262b9d623ccffa3937e5740389ae08b65a6e8c80 |
File details
Details for the file onepasswordconnectsdk-1.5.1-py3-none-any.whl
.
File metadata
- Download URL: onepasswordconnectsdk-1.5.1-py3-none-any.whl
- Upload date:
- Size: 33.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8e033dbb5dcc5ff08fbdbbfe329655adce6ec44cfe54652474d7e31175de48e |
|
MD5 | 256c6a4403445322e16873f395394277 |
|
BLAKE2b-256 | 7ce38e28c77f23a84a62e57416887dd27da28eb23dfa9f245cc3fe72fd27308a |