Git Product home page Git Product logo

connect-sdk-python's Introduction

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 via BugCrowd.

For information about security practices, please visit the 1Password Bug Bounty Program.

connect-sdk-python's People

Contributors

volodymyrzotov avatar edif2008 avatar jpcoenen avatar hculea avatar jillianwilson avatar melwil avatar mjpieters avatar simonbarendse avatar dckcode avatar verkaufer avatar raphapassini avatar marton6 avatar itjamie avatar dependabot[bot] avatar williamhpark avatar davidtran001 avatar haddadjoe avatar justintether avatar tglucas avatar tdb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.