跳转到主要内容

LLSD和JSON之间的CLI转换

项目描述

llsd2json

codecov

LLSD和JSON之间的CLI转换。

示例

$ echo '<llsd><map><key>name</key><string>Ruth</string></map></llsd>' | llsd2json | jq -r .name
Ruth

安装和使用

使用pip或pipx安装llsd2json

pipx install llsd2json

llsd2json

usage: llsd2json [-h] [--format {auto,xml,binary,notation}] [input]

Convert LLSD to JSON

positional arguments:
  input                 LLSD string (default: stdin)

options:
  -h, --help            show this help message and exit
  --format {auto,xml,binary,notation}, -f {auto,xml,binary,notation}
                        LLSD format

json2llsd

usage: json2llsd [-h] [--format {xml,binary,notation}] [input]

Convert JSON to LLSD

positional arguments:
  input                 JSON string (default: stdin)

options:
  -h, --help            show this help message and exit
  --format {xml,binary,notation}, -f {xml,binary,notation}
                        LLSD format

注意

LLSD和JSON之间的转换不是完全双向的。JSON不支持LLSD的几种数据类型,例如datebinaryuri,并且没有特定的数字类型。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

llsd2json-1.0.0.tar.gz (7.9 kB 查看散列)

上传时间: 源代码

构建分发

llsd2json-1.0.0-py3-none-any.whl (4.3 kB 查看散列)

上传时间: Python 3