You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importosimportsysimportgetpassimportonepassword.keychain# Our password functiondefget_password(msg=False):
# Get the passwordp=getpass.getpass(prompt='1Password: ', stream=sys.stderr)
p=Falseifnotlen(p) elsepreturnpk=onepassword.keychain.AKeychain(
path=os.path.expanduser("~/Dropbox/1Password.agilekeychain"))
k.unlock(get_password())
printk.decrypt(keyid=k.levels['SL5'], string="My Item")
When the string "My Item" is a 1Password "Account", it doesn't print anything. When the item is a 1password "Login" item, it prints out binary data. Have I set it up incorrectly?
The text was updated successfully, but these errors were encountered:
(I realize this is an almost year old issue, but I figured lost wandering souls could make use of my findings)
It is not completely obvious how onepasswordpy should be used without digging into the source code (something that one could improve upon in the README, perhaps?).
Here's a basic script that allows me to retrieve my 1password items using onepasswordpy. Of course you'll want to change the path on line 6 to your own setup (don't forget to switch AKeychain for CKeychain if your data resides in iCloud).
Additionally, on line 18, I'm using SL5. This should be fine for most cases, but if the script doesn't work with your keychain, that might be something to investigate.
If you're looking for more than what the very basic script offers, decrypted_data should hold most of what a typical user would be looking for.
Thanks again @Roguelazer for your work on this project; looking forward to adding some contributions in the future :)
I have this code:
When the string "My Item" is a 1Password "Account", it doesn't print anything. When the item is a 1password "Login" item, it prints out binary data. Have I set it up incorrectly?
The text was updated successfully, but these errors were encountered: