读取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如何反射地迭代数组字段?   java NamedQuery错误“具有给定标识符的多行:1”   java无法使用单独类中的计时器更新TextView   兼容性什么时候可以很快使用新的Java功能?   java二叉树路径和   java矩形的性能   java我想从同一个子表在主表中添加两个外键   java如何获取基于特定日期的所有数据?   java javafx、OO编程规则和写入变量类型的选择   java使用带枚举的switch语句   java异步任务生成运行时异常   java为什么JLabel不显示下划线字符?   java如何解析具有可变参数号的函数?   带有按钮的java JavaFX自定义列表单元格:未调用处理程序   java Modelmapper无法映射整个模型?   传递给持久化的java分离实体,包含LatLng列表