Skip to main content

yaplon

Convert between JSON, YAML and PLIST (binary and XML) in the commandline. Can be used in piping. Written in Python 3.9 (not 2.7 compatible).

Installation

pip3 install --user --upgrade yaplon
pip3 install --user --upgrade git+https://github.com/twardoch/yaplon

Usage

yaplon [c|j|p|x|y]2[j|p|x|y] -i input -o output [options]

Commands:

c2j  -i CSV -o JSON [-d DIALECT] [-k KEY] [-m] (minify)
c2p  -i CSV -o PLIST [-d DIALECT] [-k KEY] [-m] (minify)
c2x  -i CSV -o XML [-d DIALECT] [-k KEY] [-m] (minify) [-S] (simple XML)
c2y  -i CSV -o YAML [-d DIALECT] [-k KEY] [-m] (minify)
j2p  -i JSON -o PLIST [-b] (make binary PLIST)
j2x  -i JSON -o XML [-m] (minify) [-S] (simple XML)
j2y  -i JSON -o YAML [-m] (minify YAML)
p2j  -i PLIST -o JSON [-m] (minify) [-b] (keep binary)
p2x  -i PLIST -o XML [-m] (minify) [-S] (simple XML)
p2y  -i PLIST -o YAML [-m] (minify YAML)
x2j  -i XML -o JSON [-m] (minify) [-b] (keep binary)
x2p  -i XML -o PLIST [-b] (make binary PLIST)
x2y  -i XML -o YAML [-m] (minify YAML)
y2j  -i YAML -o JSON [-m] (minify) [-b] (keep binary)
y2p  -i YAML -o PLIST [-b] (make binary PLIST)
y2x  -i YAML -o XML [-m] (minify) [-S] (simple XML)

Also installs direct CLI tools that correspond to the commands:

  • csv22json, csv22plist, csv22xml, csv22yaml,
  • json22plist, json22xml, json22yaml,
  • plist22json, plist22xml, plist22yaml,
  • xml22json, xml22plist, xml22yaml,
  • yaml22json, yaml22plist, yaml22xml

Note that they have 22 rather than 2 in the filenames, so they don’t conflict with other similar (often single-purpose) tools that you may have.

Examples

JSON to YAML

File to file via the dedicated CLI tool:

$ json22yaml -i input.json -o output.yaml

Using pipe redirects, via the yaplon tool with j2y command:

$ yaplon j2y < input.json > output.yaml

Read file, output minified to stdout, via the Python 3 module

$ python3 -m yaplon j2y -m -i input.json

PLIST to JSON

Read PLIST file, output minified JSON file, via the dedicated CLI tool.

$ plist22json -m -i input.plist > output.json

Read plist file, output minified JSON to stdout, via the yaplon tool with p2j command.

$ yaplon p2j -m -i input.plist

Changelog

  • 1.5.7: switched to Unicode output in JSON, refactoring
  • 1.5.3: added CSV reading and limited XML read/write
  • 1.2.7: removed obsolete plistlib.Data reference
  • 1.2.3: bugfix
  • 1.2.1: added support for orderedattrdict.AttrDict
  • 1.1.0: added -s for sorting data
  • 1.0.8: initial public release

Links

Release files for yaplon 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yaplon 1.6.0
File Size Uploaded
yaplon-1.6.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yaplon 1.6.0
File Interpreter ABI Platform
yaplon-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size:30.0 kB

Release files / yaplon-1.6.0.tar.gz

Download URL yaplon-1.6.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
62abdf79de66480138df1daf25b0bb1f682aa6f86963190bf1684df7fd9c2b86
BLAKE2b-256 checksum
How to use checksums
04b9db03a9fb96fe413d3350e60fd5e44309efbb1daed4973923bf341e322062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release files / yaplon-1.6.0-py3-none-any.whl

Download URL yaplon-1.6.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
484f9cf1bd3f212f00dd9c03f69b65929fa0a6dd1afca210d57fba00d1bb7f07
BLAKE2b-256 checksum
How to use checksums
4c1bae40459d6be1cd43f25de95eae4168de906094757fb2ff41780212ec8f86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page