Skip to content

Instantly share code, notes, and snippets.

@pandada8
Created June 13, 2017 01:03
Show Gist options
  • Save pandada8/c3c0704b2bca558aced00bfe5d230d64 to your computer and use it in GitHub Desktop.
Save pandada8/c3c0704b2bca558aced00bfe5d230d64 to your computer and use it in GitHub Desktop.
dump pass
import subprocess
import glob
import json
import os
p = {}
os.chdir(os.path.expanduser("~/.password-store"))
for f in glob.glob("**/*.gpg", recursive=True):
name = os.path.splitext(f)[0]
print(name)
e = subprocess.check_output(["pass", name])
p[name] = e
with open("export.json", "w") as fp:
json.dump(p, fp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment