A python wrapper for onepassword cli version 2
Project description
OnePassword CLI v2 python wrapper
Quick n dirty python wrapper for the 1password cli version 2.
Setup
- Install the
op
cli by following these instructions. - Make sure you have
op
in your PATH and that it is not version 1
$ op --version
2.12.0
- Have your 1password username, password, and signin url handy
pip install onepassword2
-- or, for a local install --
make local install
Usage
CLI
The op
cli tool has a lot of options for managing multiple accounts, profiles, etc. Sessions opened with the cli terminate after 10 minutes, requirinng the user to re-authenticate interactively. This is good security. However, if you need long running, non-interactive usage, this is a hindrance. This python module comes with a handy CLI to automagify the signin process.
export OP_ACCOUNT='user@example.com'
export OP_PASSWORD="your password"
export OP_HOSTNAME="yourhost.1password.com"
eval $(op-signin)
...
$ op vault list
ID NAME
naaizerttzertzefzyhjroeqrq Private
In python scripts
username = "user@example.com"
password = "your password"
hostname = "yourhost.1password.com"
o = OP2( username, password, hostname)
o.signin()
for v in o.vaults():
print(v)
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
onepassword2-0.7.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for onepassword2-0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2520bf4e0a8df136ad33733a9db9bbde1517f5754ba02254329106ad6600f55 |
|
MD5 | 35ab6db0070b9052c5f2659671287ebb |
|
BLAKE2b-256 | c547b213c89a12caddf7d070b3d3e64144f448875a6dbb00db4dd8c0ce9ddc8b |