Skip to main content

Utilities for working with toml files

Project description

jetblack-tomlutils

Some utilities for working with toml files.

Usage

Install with pip:

$ pip install jetblack-tomlutils

toml2json

To convert toml to JSON:

usage:
    tom2json [<input> [<output]]

    input/output: either a path or '-' for stdin/stdout

examples:
    $ toml2json < pyproject.toml > pyproject.json
    $ toml2json pyproject.toml > pyproject.json
    $ toml2json pyproject.toml - > pyproject.json
    $ toml2json pyproject.toml pyproject.json
    $ cat pyproject.toml | toml2json
    $ cat pyproject.toml | toml2json -

json2toml

To convert JSON to toml:

usage:
    json2toml [<input> [<output]]

    input/output: either a path or '-' for stdin/stdout

examples:
    $ json2toml < pyproject.json
    $ json2toml pyproject.json
    $ cat pyproject.toml | json2toml
    $ cat pyproject.toml | json2toml -

jsonget

To query JSON

You can query JSON using a JSON Pointer

usage:
    jsonget <json-pointer> [<input> [<output>]]

    json-pointer: a valid JSON Pointer path
    input/output: either a path or '-' for stdin/stdout

examples:
    $ toml2json pyproject.toml | jsonget /tool/poetry/version

jsonset

To update JSON

You can update JSON using a JSON Pointer and a value

usage:
    jsonset <json-pointer> <json-value> [<input> [<output>]]

    json-pointer: a valid JSON Pointer path
    json-value: a value that can be parsed as JSON.
    input/output: either a path or '-' for stdin/stdout


examples:
    $ toml2json pyproject.toml | jsonset /tool/poetry/version '"1.2.3"'

Acknowledgements

This project is a trivial wrapper around the following projects:

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

jetblack-tomlutils-1.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jetblack_tomlutils-1.0.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file jetblack-tomlutils-1.0.0.tar.gz.

File metadata

  • Download URL: jetblack-tomlutils-1.0.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/4.10.0-33-generic

File hashes

Hashes for jetblack-tomlutils-1.0.0.tar.gz
Algorithm Hash digest
SHA256 50f5a3654d2d2337008e25d3f88e78ff440e7e2b1610274f90da1387cf5a804c
MD5 9aeedfa4a77a839e58941ac5ed1ce71e
BLAKE2b-256 926ba360f2b8878437590f2c13da6bcdbc2aaf13c381bcf5f00b70098e277216

See more details on using hashes here.

File details

Details for the file jetblack_tomlutils-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: jetblack_tomlutils-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/4.10.0-33-generic

File hashes

Hashes for jetblack_tomlutils-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e5b091634dd793c52608f9e0206cd1d2c42f01b9ec45ec84db06bce9524d04a
MD5 21f663b12e4026e31b2b351db28e6871
BLAKE2b-256 930816d9de87c385958ec274cbcf35ee1d7c9b9dfeb6d84577461f2fcfa286f3

See more details on using hashes here.

Supported by

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