API¶
- class pypass.PasswordStore(path='/home/docs/.password-store', git_dir=None)¶
This is a Password Store
Parameters: - path – The path of the password-store. By default, ‘$home/.password-store’.
- git_dir – The git directory of the password store. By default, it looks for a .git directory in the password store.
- static generate_password(digits=True, symbols=True, length=15)¶
Returns a random password
Parameters: - digits – Should the password have digits? Defaults to True
- symbols – Should the password have symbols? Defaults to True
- length – Length of the password. Defaults to 15
- get_decypted_password(path, entry=None)¶
Returns the content of the decrypted password file
Parameters: - path – The path of the password to be decrypted. Example: ‘email.com’
- entry – The entry to retreive. (EntryType enum)
- get_passwords_list()¶
Returns a list of the passwords in the store
Returns: Example: [‘Email/bob.net’, ‘example.com’]
- git_init(git_dir=None)¶
Transform the existing password store into a git repository
Parameters: git_dir – Where to create the git directory. By default, it will be created at the root of the password store in a .git folder.
- static init(gpg_id, path, clone_url=None)¶
Creates a password store to the given path
Parameters: - gpg_id – Default gpg key identification used for encryption and decryption. Example: ‘3CCC3A3A’
- path – Where to create the password store. By default, this is $home/.password-store
- clone_url – If specified, the clone_url parameter will be used to import a password store from a git repository. Example: ssh://myserver.net:/home/bob/.password-store
Returns: PasswordStore object
- insert_password(path, password)¶
Encrypts the password at the given path
Parameters: - path – Where to insert the password. Ex: ‘passwordstore.org’
- password – The password to insert, can be multi-line