- Python >= 2.7
- Have a 1Password database
- Install Python dependencies (pycryptodome)
Download the sample data (see below) and execute opvault-cli
$ opvault-cli test/onepassword_data YouTube
1Password master password:
Password: <password>
This example fetches the password for the item named 'MyApp':
from opvault.onepass import OnePass
from opvault import exceptions
from opvault import designation_types
master_password = 'MyLittleSecret'
vault = OnePass()
vault.unlock(master_password=master_password)
vault.load_items()
title = 'MyApp'
matched_items = vault.get_item(title)
for overview, details in matched_items:
password = [field['value'] for field in details['fields']
if field['designation'] == designation_types.DesignationTypes.PASSWORD][0]
print(password)
Install from pip repository
$ pip install opvault
Run from source directory:
$ python setup.py install
AgileBits provides sample data which can be useful when building apps. To install the sample data execute:
$ mkdir -p test
$ cd test
$ curl https://cache.agilebits.com/security-kb/freddy-2013-12-04.tar.gz | tar xfz -