Created
May 17, 2024 13:32
-
-
Save arturtamborski/9582a367959a7914b869c1a8dff0e3c6 to your computer and use it in GitHub Desktop.
benedict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
from benedict import benedict | |
import json | |
out = benedict(keypath_separator='/') | |
for file in pathlib.Path('gopass').rglob('*.gpg'): | |
path = str(file).removeprefix('gopass/').removesuffix('.gpg') | |
out[path] = {} | |
print( | |
json.dumps(out, indent=4, sort_keys=True) | |
.replace('"', '') | |
.replace(',', '') | |
.replace('"', '') | |
.replace(':', ' =') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment