I've made a few updates to my
It now has first-class support for many of 1Password "item" types, including:
Each of these object types has convenience properties for the default fields in their respective templates.
Also, all item types have a few convenience methods for accessing sections and their respective fields, which can otherwise be a bit messy. This helps with pulling custom section data out of item objects:
def field_value_by_section_title(self, section_title: str, field_label: str) def first_section_by_title(self, title) -> OPSection def sections_by_title(self, title) -> List[OPSection]
There's a script in the examples directory of pulling an SSH keypair out of a server object and writing the public & private key to disk:
I actually use this one a fair bit myself when I set up a new laptop. On an existing system, I create the keys and
ssh-copy-id them wherever they need to go. I then put them into 1Password using the
op command with a template. Then on the new laptop, part of my move-in automation uses
pyonepassword to pull the keys out of 1Password and drop them in
~/.ssh/ so I can start logging into servers right away.
It's still read-only, so adding/updating/deleting items isn't yet possible.
pip install pyonepassword or check out the source at:
I hope it's useful to someone!
ps I admit to not having caught up with the fancy new secrets automation stuff, so someone kindly let me know if that makes pyonepassword no longer relevant