Skip to main content

A CLI tool for converting YAML to JSON.

Project description

y2j

A command line tool for translating YAML streams to JSON.

Installation

pip install y2j

Usage

y2j accepts YAML data and writes the equivalent JSON to STDOUT. The YAML may be read from a named file, or from STDIN.

Options

  • -c, --compressed: Print with no superfluous whitespace.
  • -p, --pretty: Pretty-print the JSON output

The following examples are based on the contents of example.yml:

---
  y2j:
    - Is easy to use
    - Is neat

Reading from a file

$ y2j -p example.yml

{
  "y2j": [
    "Is easy to use",
    "Is neat"
  ]
}

Reading from STDIN

$ cat example.yml | y2j -p

{
  "y2j": [
    "Is easy to use",
    "Is neat"
  ]
}

Project details


Download files

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

Files for y2j, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size y2j-0.0.3-py3-none-any.whl (3.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size y2j-0.0.3.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page