dotpick
Token-minimal field projection over JSON, YAML, TOML and NDJSON. Select fields by dotpath and emit the smallest valid slice. The anti-jq for agents and scripts: pure projection and format conversion, with no expression language to get wrong.
Why
jq and yq dump whole payloads, speak cryptic error messages, and jq
cannot even read YAML or TOML. When you only need three fields out of a 50 KB
response, you pay for the other 49 KB. dotpick takes a simple list of
dotpaths and returns just those fields, in the format you ask for.
# 50 KB of pod JSON in, one name per line out
kubectl get pods -o json | dotpick '.items[].metadata.name' -o raw
Install
cargo install dotpick
Quickstart
# Smallest sub-document of two fields (structure preserved)
echo '{"metadata":{"name":"web","ns":"prod"},"spec":{"replicas":3}}' \
| dotpick '.metadata.name,.spec.replicas'
# => {"metadata":{"name":"web"},"spec":{"replicas":3}}
# Just the value, unquoted
dotpick .spec.replicas deploy.yaml -o raw
# => 3
# Flatten to leaf names
dotpick '.metadata.name,.spec.replicas' deploy.yaml --flat
# => {"name":"web","replicas":3}
# Stream array elements as NDJSON
cat pods.json | dotpick '.items[]' -o ndjson
# => {"name":"a"}
# {"name":"b"}
# Convert formats with the root path
dotpick . config.toml -o yaml
dotpick <paths> [file] is shorthand for dotpick project <paths> [file].
Dotpath grammar
| Syntax | Meaning |
|---|---|
.key |
object key (bareword [A-Za-z0-9_-]+) |
["any.key"] |
quoted key, for keys with dots, spaces or brackets |
[0] |
array index (non-negative) |
[] |
iterate every element of an array |
. |
the whole document (useful for format conversion) |
.a.b[0].c[].d |
chain segments freely |
.a.b,.c[].d |
comma-separate multiple paths |
Output shapes
- structured (default): the smallest sub-document that keeps the original nesting.
--flat: an object keyed by each path's final name.-o raw: bare scalar values, one per line (great for shell capture).-o ndjson: one compact JSON value per selected match;[]controls granularity (.items[]streams elements,.items[].namestreams names).
Object keys are emitted in sorted order for stable, diff-friendly output.
Formats
Input format is auto-detected (or taken from the file extension, or forced with
--from json|yaml|toml|ndjson). Output is selected with -o/--output
(auto, json, yaml, toml, ndjson, raw); auto is JSON, or NDJSON
when the input is NDJSON. --to is an alias for --output. Use --pretty for
indented JSON.
Missing fields
By default a missing path is an error with a "nearest existing key" hint:
echo '{"spec":{"replic":3}}' | dotpick .spec.replicas
# stderr: {"error":{"kind":"path_not_found","message":"path .spec.replicas not found; nearest existing: replic", ...}}
Pass --allow-missing to skip absent paths instead.
Exit codes
| Code | Meaning |
|---|---|
0 |
success |
1 |
no match (a selected path is absent, or a wrong-typed segment) |
2 |
parse, serialize, or IO failure |
3 |
usage error (bad arguments, bad dotpath, name collision, raw on non-scalar) |
For agents (clispec)
dotpick follows The CLI Spec: data on stdout, structured
error envelopes on the last line of stderr, and a schema subcommand whose
output validates against clispec.dev/schema/v0.3.json (checked by the test
suite). Every command is marked read-only (mutating: false).
dotpick schema # machine-readable contract: commands, args, error kinds, exit codes
dotpick is a stateless filter, so the list-oriented principles (pagination,
resource conflicts) do not apply; its paths argument is itself the field
selector.
License
MIT
Metadata
Release files for dotpick 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dotpick-0.1.2.tar.gz | 40.8 kB | Without provenance | Details for dotpick-0.1.2.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| dotpick-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for dotpick-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| dotpick-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details for dotpick-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| dotpick-0.1.2-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for dotpick-0.1.2-py3-none-macosx_11_0_arm64.whl |
| dotpick-0.1.2-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details for dotpick-0.1.2-py3-none-macosx_10_12_x86_64.whl |
Total release size: 2.8 MB
Release files / dotpick-0.1.2.tar.gz
| Download URL | dotpick-0.1.2.tar.gz |
|---|---|
| Size | 40.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11b82ff0ab1798b709ce97bccef18bfadba275805db27a792fe563e5ee9fd8ef
|
|
BLAKE2b-256 checksum How to use checksums |
2d8cb12cf92c05814085e3852c5e72ed50d5075dfbccdd0e65d52eca80b6487b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dotpick-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | dotpick-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 722.3 kB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
9c68578c1be010231962e926e2e270920c92d17e07181a1fac98137c7c9a0e5d
|
|
BLAKE2b-256 checksum How to use checksums |
d51eeeec0a42dca32a535cbdc82fda731ee23007dcd4c2d450aaffc754ce0bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dotpick-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | dotpick-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 669.5 kB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
a9313b3f80515b9be718e857a247a7e8620a3a652af9e2dfd4038e32c0e7ae87
|
|
BLAKE2b-256 checksum How to use checksums |
00924daa048a6b761f964266911877f0979ff378f613509eeed287c00ac8791b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dotpick-0.1.2-py3-none-macosx_11_0_arm64.whl
| Download URL | dotpick-0.1.2-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 654.5 kB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4815ee1241b6fc6406a42538801bbac04b9095026dcb76c0a16128311dc06997
|
|
BLAKE2b-256 checksum How to use checksums |
acb89cf256122c50199dd73c99111a4f5831c26f3961480ae2fbfe6775f9b3b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dotpick-0.1.2-py3-none-macosx_10_12_x86_64.whl
| Download URL | dotpick-0.1.2-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 704.0 kB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
70faad283dd8de634c609b0b04043dbb1605abade0a247f36573d247205ff017
|
|
BLAKE2b-256 checksum How to use checksums |
94d63c312bf2917de213f769456553788b1fcac2b56c117eaa2cd2a33ed66d5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for dotpick 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.