Participate in discussions with other Treehouse members and learn. Because of the unique scenario where Homebrew shouldn't be installed with sudo, and it Stack Exchange Network Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to.
Latest versionReleased:
A python API to query a 1Password account using the 'op' command-line tool
Project description
Description
A Python API to sign into and query a 1Password account using the op
command.
Requirements
- Python >= 3.7
- 1Password command-line tool
- see 1Password command-line tool: Getting started
- Internet connectivity to 1Password.com
- The
op
command queries your online account, not your local vault
- The
Installation
Example usage
Note: It is recommended to perform initial sign-in manually on the command line before using pyonepassword
. Initial sign-in is supported but deprecated. Multi-factor-authenticaiton is not supported.
Subsequent sign-in and item retrieval
Below is an example demonstrating:
- Subsequent sign-in
- Specifying a default vault for queries
- Retrieving an item from 1Password by name or by UUID
- Overriding the default vault to retrieve a subsequent item from 1Password
Document retrieval
Below is an example demonstrating:
- Retrieving a document and its file name from 1Password, based on item name
- Retrieving a document & file name from 1Password, based on UUID
Signing out of 1Password
Below is an example demonstrating:
- Signing in, then signing out of 1Password
- Signing out and also forgetting a 1Password account
Note: Currently pyonepassword
's sign-out & forget support requires a signed-in session. It is not yet possible to forget an arbitrary account.
Getting Details for a User
Getting Details for a Group
Getting Details for a Vault
Notes
- This has been lightly tested, and only on my Mac. I don't know if it works on other systems.
- This has been tested with
op
version 1.7.0 - You need the
op
1Password command-line tool. On a Mac with homebrew, you can dobrew install 1password-cli
.
TODO
- Ability for forget arbitrary accounts, not just the one currently signed in
- API mapping on to all of
op
's various commands and subcommands - API to get complete or partial JSON for an item
- Unit testing
Release historyRelease notifications | RSS feed
1.8.3
1.8.2
1.8.1
1.8.0
1.7.1
1.7.0
1.1.0
0.9.1
0.9
0.1.0b3 pre-release
0.1.0b2 pre-release
0.1.0b1 pre-release
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size pyonepassword-1.8.3-py3-none-any.whl (15.9 kB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size pyonepassword-1.8.3.tar.gz (14.6 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for pyonepassword-1.8.3-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 6757536f54d510ef465557fd8241a5db1c2b1dfca19cc0a16d00266e17b40a72 |
MD5 | 06532929f4864f8429e827964f807c82 |
BLAKE2-256 | 626dd7a856b0a14657fc5b41d9691ae27f21879bf177b515f21c710112b927e0 |
1password Homebrew Software
Hashes for pyonepassword-1.8.3.tar.gz
1password Homebrew Free
Algorithm | Hash digest |
---|---|
SHA256 | 575dfb79a1f69b8eaac97e595514d7a1226e0e93075f4a305f5c5ac11f99c3b3 |
MD5 | 9ed11259a549c42e4ca480c6cf01734a |
BLAKE2-256 | 6e1dacb89d5851eb14d008beae2ece0c21fd078c1807d01353e715a44ff2ed04 |