Skip to main content

Barebones TOML query.

Project description

bbtq

Barebones TOML query. Like jq, but for TOML instead of JSON.

PyPI Test Status Code Coverage

installation

# via pypi
pip3 install bbtq

# directly from repo
pip3 install git+https://github.com/aerickson/bbtq.git@master

usage

# a search of '.' shows the entire document
$ tq bbtq/tests/test.toml .
title = "TOML Example"

[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00

[database]
server = "192.168.1.1"
ports = [ 8001, 8001, 8002,]
connection_max = 5000
enabled = true

# retrieve items
$ tq bbtq/tests/test.toml .title
TOML Example
$ tq bbtq/tests/test.toml .database.ports
[8001, 8001, 8002]

# retreive an array element
$ tq bbtq/tests/test.toml ".database.ports[2]"
8002

# can also be used via pipe
$ cat bbtq/tests/test.toml | ./bin/tq - .

known limitations

why

  • I couldn't get yq's experimental support for TOML working.
  • I wanted a python implementation, all others seem to use go.

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

bbtq-3.0.1.tar.gz (16.9 kB view hashes)

Uploaded Source

Built Distribution

bbtq-3.0.1-py3-none-any.whl (18.1 kB view hashes)

Uploaded Python 3

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