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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file bbtq-3.0.1.tar.gz.

File metadata

  • Download URL: bbtq-3.0.1.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.9.13 Darwin/21.5.0

File hashes

Hashes for bbtq-3.0.1.tar.gz
Algorithm Hash digest
SHA256 c4326be8176a7fa6b83bb5126beb78d44cedefd2bae45cfb574edbbb185f843b
MD5 4b9307ff93bb9f0deae7e893347a4222
BLAKE2b-256 d6ebc5f170d765e363d30896d0f2d614f7df3855b6d2301f0ee8963b57d84671

See more details on using hashes here.

File details

Details for the file bbtq-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: bbtq-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.9.13 Darwin/21.5.0

File hashes

Hashes for bbtq-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da0120d06a2f6165a7c6fad3e34087addf561a5461cc62d50516f69c430dee4e
MD5 721bca6f3b02020c0ec3b730edcb6517
BLAKE2b-256 5f60239ed9cb185ebdc88da0e88f39649eb270800c85a87c2e960af360800339

See more details on using hashes here.

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