Giter VIP home page Giter VIP logo

tojson's Introduction

Usage

% tojson --help
Usage: tojson [FILES]...

  Converts YAML and TOML documents to concatenated JSON stream.

  Each input document is converted into standalone JSON document.
  Input YAML files can be composed of multiple documents. Only
  standard YAML tags are recognized (yaml.safe_load_all() function is
  used). Converted JSON documents are printed to standard output and
  separated by newline character. JSON document on input is copied to
  output verbatim.

  Input documents can be fed via standard input and/or positional
  arguments. Format of input documents specified before any format
  option (see below) is guessed from their filename extension
  (matching is case-insensitive, both `yaml` and `yml` imply YAML).
  You need to specify format for filenames with non-standard extension
  or for standard input specified either explicitly by "-" argument or
  implicitly by supplying no positional arguments.

  Hosted at https://github.com/woky/tojson. Licensed under GPLv3.

  This tool was created mainly for further processing of JSON
  documents by jq (https://stedolan.github.io/jq/).

Options:
    -h, --help              Show this message and exit.

  Following options change format of all positional arguments that
  follows until another format option, or of standard input if no
  positional arguments are specified.

    -y, --yaml              Force YAML format
    -t, --toml              Force TOML format
    -j, --json              Force JSON format (verbatim copy)

Examples:
  Turn YAML documents on standard input into JSON stream:
    tojson -y

  Turn foo.yaml file and bar.toml on standard input into JSON stream:
    tojson foo.yaml -t - <bar.toml

Installation

Example with stow:

PREFIX=$HOME/stow/tojson
git clone https://github.com/woky/tojson && cd tojson
pip3 install --user .
./setup.py install --root=$PREFIX --prefix=''

Other Formats

HOCON

HCL

tojson's People

Contributors

woky avatar

Stargazers

Bob Blanchett avatar Doru Carastan avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.