Skip to main content

Grep GPG-encrypted YAML password safe.

Project description

pw is a Python tool to search in a GPG-encrypted password database.

Usage: pw [OPTIONS] [USER@][KEY]

  Search for USER and KEY in GPG-encrypted password database.

Options:
  --copy / --no-copy      copy password to clipboard
  -E, --echo / --no-echo  print password to console
  --open / --no-open      open link in browser
  --strict / --no-strict  fail unless precisely a single result has been found
  --database-path PATH    path to password database
  --edit                  launch editor to edit password database
  -v, --version           print version information and exit
  --help                  Show this message and exit.

Installation

To install pw, simply run:

$ pip install pw

Password Database, File Format, and Editing

By default, the password database is located at ~/.passwords.yaml.asc and automatically decrypted by using GnuPG if the file extension is .asc or .gpg. It uses a straighforward YAML format as in the following example, which is hopefully self-explanatory:

Mail:
  Google:
    - U: first-user@gmail.com
      P: "*****"
      L: https://mail.google.com/
    - U: second-user@gmail.com
      P: "*****"
      N: "John's account"
SSH:
  My Private Server:
    U: root
    P: "*****"
    N: "With great power comes great responsibility."
  (An Old Entry That Is Ignored):
    U: foo
    P: bar

Mobile:
  PIN: 12345   # shortcut notation (only provide password)

To edit the database, use pw --edit. This requires that the environment variable PW_GPG_RECIPIENT is set to the key with which the database should be encrypted and invokes the editor specified in the PW_EDITOR environment variable (make sure to use blocking mode, e.g., subl --wait).

Warning: This feature requires that the password database is temporarily stored in plain text in the file system, data leaks may arise. To some extend, this can be mitigated by using, e.g., tmpfs and by providing the editor with the adequate options that ensure that no backup copies, swap files, etc. are created.

Project details


Release history Release notifications

History Node

0.9.0

History Node

0.8.1

History Node

0.8

History Node

0.7

This version
History Node

0.6

History Node

0.5.1

History Node

0.5.1-dev

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pw-0.6-py2.py3-none-any.whl (8.0 kB) Copy SHA256 hash SHA256 Wheel 2.7 Jun 15, 2014
pw-0.6.tar.gz (6.7 kB) Copy SHA256 hash SHA256 Source None Jun 15, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page