GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - 1Password/connect-sdk-python: Python SDK for 1Password Connect

BranchesTags
Open more actions menu

Latest commit

 

History

257 Commits
257 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
example
example
 
 
scripts
scripts
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.md
LICENSE.md
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
USAGE.md
USAGE.md
 
 
poetry.lock
poetry.lock
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

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.

This project is licensed under MIT. Use of the 1Password APIs and services accessed through these tools is governed by the 1Password API Terms of Service.

🪄 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

  • 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 by sending an email to [email protected].

About

Python SDK for 1Password Connect

www.1password.dev/connect/

Topics

1password1password-connectconnect-sdkpythonsecrets-management

Resources

Readme
MIT license
Activity
Custom properties

Stars

233 stars

Watchers

18 watching

Forks

43 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.