读取gpg加密的yaml文件

gypp的Python项目详细描述


gypp为访问gpg加密的yaml文件中的条目提供了方便的方法。

yaml文件的结构如下:

# Comments start with a "#"
DESCRIPTION: |
  This is a human readable description of this file.

RECIPIENTS:
  - list of
  - recipients of
  - the encrypted file

some_key:
  user: name of account (required)
  password: the password or phrase (required)
  name: human readable name of entry (optional)
  note: |
    optional note. The pipe char indicates that
    line breaks will be preserved, but the
    preceding space on each line will not.
  other: Other properties may be added as needed.

another_key:
  user: some user
  password: password with a quote " in it
  name: another test entry
  note: |
    Same old stuff

安装

pip install -U gypp

使用

列出可用条目:

$ gypp my_passwords.gpg

Source: junk.txt
Description: This is a human readable description of this file.

Keys available:
  some_key          : human readable name of entry (optional)
  another_key       : another test entry

在命令行上显示特定条目:

$ gypp -s -k some_key my_passwords.gpg

user     : name of account (required)
password :
name     : human readable name of entry (optional)
note
  optional note. The pipe char indicates that
  line breaks will be preserved, but the
  preceding space on each line will not.

other    : Other properties may be added as needed.

在剪贴板上输入密码:

$ gypp -k some_key my_passwords.gpg

版本1.1中的新功能:gypp将从配置文件中读取源列表 默认情况下位于$HOME/.config/gypp/gypp.yaml。配置文件是一个yaml 文件结构如下:

sources:
  source_name_1: path/to/encrypted/file
  source_name_2: path/to/another/encryped/file

gypp然后可以使用sources下的键运行,以指定要读取的gpg文件。例如:

$ gypp source_name_2

开发

存储库:https://github.com/datadavev/gypp

开发安装:

$ git clone https://github.com/datadavev/gypp.git
$ cd gypp
$ pip install -U -e .

部署到pypi:

$ python setup.py sdist
$ twine upload dist/*

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用双一元运算符vs函数<Double,Double>   由于存在巨大的休眠,超出了java GC开销限制   java更改Tomcat中Apache文件上载的临时目录   当PDF位于本地驱动器时,javascript无法在IE中显示PDF   java hibernate如何加载瞬态对象?   java如何判断包属于哪个模块?   创建Word文档时java文件已损坏   java如何将Eclipse中的每个开放项目导出为自己的JAR?   java将带有getter和setter的变量添加到现有类中   java高效地发送多封电子邮件   java读/写。具有特殊字符的txt文件   java如何在导出到jar时包含opencv本机库   java Xstream在未完成时停止写入文件   if语句Java:无法检查布尔值是否为null   文本Java:读取txt文件并将其保存在字符串数组中,但不带反斜杠(空格)?   java如何使用正则表达式替换字符串的一部分   通过Java远程运行Powershell脚本   filenames带有xml文件空指针异常的Java文件uri