Skip to main content

Python 3-based commandline converter YAML ↔ JSON ↔ PLIST

Project description

yaplon

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

Installation

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

Usage

yaplon j2p|j2y|p2j|p2y|y2j|y2p -i input -o output [options]

Commands:

j2p  -i JSON  -o PLIST [-b] (make binary PLIST)
j2y  -i JSON  -o YAML  [-m] (minify)
p2j  -i PLIST -o JSON  [-m] (minify) [-b] (keep binary)
p2y  -i PLIST -o YAML  [-m] (minify)
y2j  -i YAML  -o JSON  [-m] (minify) [-b] (keep binary)
y2p  -i YAML  -o PLIST [-b] (make binary PLIST)

Also installs direct CLI tools: json22plist, json22yaml, plist22json, plist22yaml, yaml22json, yaml22plist that correspond to the commands. 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.1.0: added -s for sorting data
  • 1.0.8: initial public release

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaplon-1.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

yaplon-1.1.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file yaplon-1.1.0.tar.gz.

File metadata

  • Download URL: yaplon-1.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for yaplon-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0653d3f7427215871c19aeb28e2c6458ad8457586b84f5d5a5df237d63fc0a39
MD5 076f667c192c7b44cc3b97a2987ff891
BLAKE2b-256 2d83456e7b08a35e56d12c310605e57821edf3d14e908e256c3a1e97c7ef7531

See more details on using hashes here.

Provenance

File details

Details for the file yaplon-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: yaplon-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for yaplon-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6afc6e505e0e1c3237a3c4acc17847b6d7193e1bbb3a21b39bf4a77c7bc00deb
MD5 c5053712f24dd69213929abad657b68d
BLAKE2b-256 f7ca63ff515bee7e5a70d8e2e96b3d1a16abf55c51d029663ddaf050d7af7ba0

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page