{"id":33185511,"url":"https://github.com/AndydeCleyre/nestedtextto","last_synced_at":"2025-11-17T10:01:37.076Z","repository":{"id":60172127,"uuid":"539605342","full_name":"AndydeCleyre/nestedtextto","owner":"AndydeCleyre","description":"CLI to convert between NestedText and JSON, YAML, or TOML, with explicit type casting","archived":false,"fork":false,"pushed_at":"2025-11-14T08:57:25.000Z","size":2277,"stargazers_count":23,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-11-14T10:23:28.869Z","etag":null,"topics":["cli","json","nestedtext","pypi-package","python","toml","yaml","yamlpath"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndydeCleyre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-21T17:22:56.000Z","updated_at":"2025-11-14T08:57:29.000Z","dependencies_parsed_at":"2023-10-16T19:00:27.704Z","dependency_job_id":"c2cc3fa4-f379-4864-ba3c-b859bad398e0","html_url":"https://github.com/AndydeCleyre/nestedtextto","commit_stats":{"total_commits":400,"total_committers":2,"mean_commits":200.0,"dds":"0.40249999999999997","last_synced_commit":"b0524924f75c932cc2e12e5e78fda2c4eb1ec89d"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/AndydeCleyre/nestedtextto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndydeCleyre%2Fnestedtextto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndydeCleyre%2Fnestedtextto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndydeCleyre%2Fnestedtextto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndydeCleyre%2Fnestedtextto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndydeCleyre","download_url":"https://codeload.github.com/AndydeCleyre/nestedtextto/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndydeCleyre%2Fnestedtextto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284861038,"owners_count":27075155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-17T02:00:06.431Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","json","nestedtext","pypi-package","python","toml","yaml","yamlpath"],"created_at":"2025-11-16T05:00:20.093Z","updated_at":"2025-11-17T10:01:37.070Z","avatar_url":"https://github.com/AndydeCleyre.png","language":"Python","readme":"# NestedTextTo\n## CLI to convert between NestedText and JSON, YAML, HUML, or TOML, with explicit type casting\n\n![Python versions](https://img.shields.io/pypi/pyversions/nt2?logo=python)\n[![PyPI version](https://img.shields.io/pypi/v/nt2?logo=pypi\u0026label=PyPI\u0026color=yellowgreen)](https://pypi.org/project/nt2/)\n[![Publish to PyPI](https://img.shields.io/github/actions/workflow/status/andydecleyre/nestedtextto/pypi.yml?label=Publish%20to%20PyPI\u0026logo=github)](https://github.com/AndydeCleyre/nestedtextto/actions/workflows/pypi.yml)\n\n![Runs on Linux](https://img.shields.io/badge/Runs%20on-Linux-yellowgreen?logo=linux)\n![Runs on macOS](https://img.shields.io/badge/Runs%20on-macOS-red?logo=macos)\n![Runs on Windows](https://img.shields.io/badge/Runs%20on-Windows-blue?logo=windows)\n\n[![Tests badge](https://img.shields.io/github/actions/workflow/status/andydecleyre/nestedtextto/test.yml?branch=develop\u0026label=Tests\u0026logo=github)](https://github.com/AndydeCleyre/nestedtextto/actions/workflows/test.yml)\n[![codecov badge](https://codecov.io/github/AndydeCleyre/nestedtextto/branch/develop/graph/badge.svg?token=M30UZQVM4Q)](https://codecov.io/github/AndydeCleyre/nestedtextto)\n\n\n[![Format and lint](https://img.shields.io/github/actions/workflow/status/andydecleyre/nestedtextto/fmt.yml?branch=develop\u0026label=Format%20%26%20Lint\u0026logo=github)](https://github.com/AndydeCleyre/nestedtextto/actions/workflows/fmt.yml)\n[![Generate docs from templates](https://img.shields.io/github/actions/workflow/status/andydecleyre/nestedtextto/doc.yml?branch=develop\u0026label=Make%20Docs\u0026logo=github)](https://andydecleyre.github.io/nestedtextto/moduleIndex.html)\n[![Requirements badge](https://img.shields.io/github/actions/workflow/status/andydecleyre/nestedtextto/reqs.yml?branch=develop\u0026label=Bump%20Reqs\u0026logo=github)](https://github.com/AndydeCleyre/nestedtextto/actions/workflows/reqs.yml)\n\n\u003cimg src=\"https://github.com/AndydeCleyre/nestedtextto/blob/assets/logo.png?raw=true\" alt=\"logo\" width=\"160\" height=\"160\" /\u003e\n\nThis project was created in appreciation for the design of [NestedText](https://nestedtext.org/),\nthe readability of [yamlpath](https://github.com/wwkimball/yamlpath) queries,\nthe utility of [cattrs](https://cattrs.readthedocs.io/),\nand the joy of [plumbum](https://plumbum.readthedocs.io/)\nand [ward](https://ward.readthedocs.io/) --\nnone of which are this author's projects.\n\nThis project, NestedTextTo, provides command line tools\nfor convenient conversion between NestedText and other formats:\n\n\n\n- `nt2` with subcommands: `json`, `yaml`, `toml`, `huml`\n\n  - `nt2 {json,toml,yaml}` can also be invoked as a single command: `nt2json`, `nt2toml`, `nt2yaml`\n\n- `2nt` with subcommands: `json`, `yaml`, `toml`, `huml`\n\n  - `2nt {json,toml,yaml}` can also be invoked as a single command: `json2nt`, `toml2nt`, `yaml2nt`\n\n---\n\n\u003c!--TOC--\u003e\n\n- [What's NestedText?](#whats-nestedtext)\n- [How does this translate to formats with more value types?](#how-does-this-translate-to-formats-with-more-value-types)\n- [Installation](#installation)\n  - [Shell Completion](#shell-completion)\n- [Usage Docs](#usage-docs)\n  - [Limitations](#limitations)\n- [More Examples](#more-examples)\n  - [View JSON Lines logs in a more readable format](#view-json-lines-logs-in-a-more-readable-format)\n  - [View TOML as NestedText](#view-toml-as-nestedtext)\n  - [Convert NestedText to TOML, with and without casting](#convert-nestedtext-to-toml-with-and-without-casting)\n  - [Convert NestedText to TOML with casting via auto-schema](#convert-nestedtext-to-toml-with-casting-via-auto-schema)\n  - [Query TOML with JSON tools, with and without casting](#query-toml-with-json-tools-with-and-without-casting)\n- [Development Docs](#development-docs)\n\n\u003c!--TOC--\u003e\n\n---\n\n### What's NestedText?\n\nFrom the NestedText docs, with emphasis added:\n\n\u003e NestedText is a file format for holding structured data to be entered, edited, or viewed by people. It organizes the data into a nested collection of *dictionaries*, *lists*, and *strings* **without the need for quoting or escaping**. A unique feature of this file format is that it only supports *one scalar type:* **strings**.  While the decision to eschew integer, real, date, etc. types may seem counter intuitive, it leads to simpler data files and applications that are more robust.\n\n### How does this translate to formats with more value types?\n\nWhen converting from NestedText to formats supporting more value types,\nall plain values will be strings by default.\nBut you can provide options to cast any values as numbers, booleans, nulls, or dates/times,\nif the target format supports it, using the powerful and concise YAML Path query syntax.\n\n```console\n$ cat config.nt\n```\n```yaml\nlogging:\n  level: info\n  file: /var/log/app.log\n  rotate: yes\n  max_size: 100\n```\n```console\n$ nt2json config.nt --number logging.max_size --boolean logging.rotate\n```\n```json\n{\n  \"logging\": {\n    \"level\": \"info\",\n    \"file\": \"/var/log/app.log\",\n    \"rotate\": true,\n    \"max_size\": 100\n  }\n}\n```\n\nYou may instead store these type mappings in a NestedText \"schema\" file.\n\n```console\n$ cat config.types.nt\n```\n```yaml\nboolean:\n  - logging.rotate\nnumber:\n  - logging.max_size\n```\n\nThe following command will then also yield the above JSON:\n\n```console\n$ nt2json config.nt --schema config.types.nt\n```\n\nSuch a schema may be automatically generated from any of the typed formats:\n\n```console\n$ json2nt --to-schema config.json\n```\n\nOptions may be provided before or after the document,\nand content may be piped directly to the command instead of specifying a file.\n\nFor more YAML Path syntax information see\n[the YAML Path wiki](https://github.com/wwkimball/yamlpath/wiki/Search-Expressions).\n\nFor example, you could match all items which are *probably* intended as booleans,\nat any depth, with `--boolean '**[. =~ /(?i)^(yes|no|true|false)$/]'`.\n\n### Installation\n\nSupport for JSON and YAML are always included.\nIf you don't need support for more than those, you can omit the `[all]` bits below.\nOr you can use a comma-separated list of extra formats, like `[toml,huml]`.\n\nHere are some ways to install it:\n\n```console\n$ uv tool install 'nt2[all]'     # Install using uv (Python all-around manager)\n$ pipx install 'nt2[all]'        # Install using pipx (Python app manager)\n$ pipz install 'nt2[all]'        # Install using zpy (Python app and environment manager for Zsh)\n$ pip install --user 'nt2[all]'  # Install in your user's environment\n$ pip install 'nt2[all]'         # Install in current environment\n```\n\nI recommend using [uv](https://github.com/astral-sh/uv),\n[pipx](https://github.com/pypa/pipx),\nor `pipz` from [zpy](https://github.com/AndydeCleyre/zpy).\n\n#### Shell Completion\n\nFor Zsh completion, add this line to your `.zshrc`, any time after `compinit`:\n\n```zsh\ncompdef _gnu_generic nt2{json,{to,ya}ml} {json,{to,ya}ml}2nt\n```\n\n\n### Usage Docs\n\n\u003cdetails\u003e\n  \u003csummary\u003ent2\u003c/summary\u003e\n\n```\nnt2 0.3.0\n\nConvert NestedText to another format.\n\nExamples:\n    - nt2 json config.nt\n    - nt2 json config.nt --number font.size --boolean font.bold\n    - nt2 json config.nt --schema config.types.nt\n    - cat config.nt | nt2 json\n\nUsage:\n    nt2 [SWITCHES] [SUBCOMMAND [SWITCHES]] args...\n\nMeta-switches:\n    -h, --help         Prints this help message and quits\n    --help-all         Prints help messages of all sub-commands and quits\n    -v, --version      Prints the program's version and quits\n\nSub-commands:\n    completion         Print completion code for the given shell.\n    hjson              Read NestedText and output its content as Hjson.\n    huml               Read NestedText and output its content as HUML.\n    json               Read NestedText and output its content as JSON.\n    maml               Read NestedText and output its content as MAML.\n    toml               Read NestedText and output its content as TOML.\n    xml                Read NestedText and output its content as XML.\n    yaml               Read NestedText and output its content as YAML.\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e2nt\u003c/summary\u003e\n\n```\n2nt 0.3.0\n\nConvert another format to NestedText.\n\nExamples:\n    - 2nt config.json\n    - 2nt config.json --to-schema \u003econfig.types.nt\n    - cat config.json | 2nt json\n    - cat config.json | 2nt --from json\n\nUsage:\n    2nt [SWITCHES] [SUBCOMMAND [SWITCHES]] DATA_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    --help-all                      Prints help messages of all sub-commands and\n                                    quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --from, -f FROM_FORMAT:{maml, hjson, huml, toml, yml, yaml, json, jsonl, xml}\n                                    Format to convert from\n    --inline-width, -i WIDTH:[0..120] Maximum line width for inline dictionaries\n                                    and lists\n    --to-schema, -s                 Rather than convert the inputs, generate a\n                                    schema\n\nSub-commands:\n    completion                      Print completion code for the given shell.\n    hjson                           Read Hjson and output its content as\n                                    NestedText.\n    huml                            Read HUML and output its content as\n                                    NestedText.\n    json                            Read JSON and output its content as\n                                    NestedText.\n    maml                            Read MAML and output its content as\n                                    NestedText.\n    toml                            Read TOML and output its content as\n                                    NestedText.\n    xml                             Read XML and output its content as\n                                    NestedText.\n    yaml                            Read YAML and output its content as\n                                    NestedText.\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ent2 json\u003c/summary\u003e\n\n```\nnt2 json 0.3.0\n\nRead NestedText and output its content as JSON.\n\nBy default, generated JSON values will only contain strings, arrays, and maps,\nbut you can cast nodes matching YAML Paths to boolean, number or null.\n\nSwitches may be before or after file arguments.\n\nExamples:\n    - nt2 json config.nt\n    - nt2 json config.nt --number font.size --boolean font.bold\n    - nt2 json config.nt --schema config.types.nt\n    - cat config.nt | nt2 json\n\nIt can be invoked as either the subcommand `nt2 json` or the single command\n`nt2json`.\n\nUsage:\n    nt2 json [SWITCHES] NESTED_TEXT_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --boolean, -b YAMLPATH:str      Cast each node matching the given YAML Path\n                                    query as boolean; may be given multiple\n                                    times\n    --null, -n YAMLPATH:str         Cast each node matching the given YAML Path\n                                    query as null, if it is an empty string; may\n                                    be given multiple times\n    --number, --int, --float, -i, -f YAMLPATH:str\n                                    Cast each node matching the given YAML Path\n                                    query as a number; may be given multiple\n                                    times\n    --schema, -s NESTED_TEXT_FILE:ExistingFile\n                                    Cast nodes matching YAML Path queries\n                                    specified in a NestedText document. It must\n                                    be a map whose keys are names of supported\n                                    types (a subset of 'null', 'boolean',\n                                    'number', and 'date'). Each key's value is a\n                                    list of YAML Paths; may be given multiple\n                                    times\n\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ent2 yaml\u003c/summary\u003e\n\n```\nnt2 yaml 0.3.0\n\nRead NestedText and output its content as YAML.\n\nBy default, generated YAML values will only contain strings, arrays, and maps,\nbut you can cast nodes matching YAML Paths to boolean, number, null or date.\n\nSwitches may be before or after file arguments.\n\nExamples:\n    - nt2 yaml config.nt\n    - nt2 yaml config.nt --number font.size --boolean font.bold\n    - nt2 yaml config.nt --schema config.types.nt\n    - cat config.nt | nt2 yaml\n\nIt can be invoked as either the subcommand `nt2 yaml` or the single command\n`nt2yaml`.\n\nUsage:\n    nt2 yaml [SWITCHES] NESTED_TEXT_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --boolean, -b YAMLPATH:str      Cast each node matching the given YAML Path\n                                    query as boolean; may be given multiple\n                                    times\n    --date, -d YAMLPATH:str         Cast each node matching the given YAML Path\n                                    query as a date, assuming it's ISO 8601; may\n                                    be given multiple times\n    --null, -n YAMLPATH:str         Cast each node matching the given YAML Path\n                                    query as null, if it is an empty string; may\n                                    be given multiple times\n    --number, --int, --float, -i, -f YAMLPATH:str\n                                    Cast each node matching the given YAML Path\n                                    query as a number; may be given multiple\n                                    times\n    --schema, -s NESTED_TEXT_FILE:ExistingFile\n                                    Cast nodes matching YAML Path queries\n                                    specified in a NestedText document. It must\n                                    be a map whose keys are names of supported\n                                    types (a subset of 'null', 'boolean',\n                                    'number', and 'date'). Each key's value is a\n                                    list of YAML Paths; may be given multiple\n                                    times\n\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ent2 toml\u003c/summary\u003e\n\n```\nnt2 toml 0.3.0\n\nRead NestedText and output its content as TOML.\n\nBy default, generated TOML values will only contain strings, arrays, and maps,\nbut you can cast nodes matching YAML Paths to boolean, number or date.\n\nSwitches may be before or after file arguments.\n\nExamples:\n    - nt2 toml config.nt\n    - nt2 toml config.nt --number font.size --boolean font.bold\n    - nt2 toml config.nt --schema config.types.nt\n    - cat config.nt | nt2 toml\n\nIt can be invoked as either the subcommand `nt2 toml` or the single command\n`nt2toml`.\n\nUsage:\n    nt2 toml [SWITCHES] NESTED_TEXT_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --boolean, -b YAMLPATH:str      Cast each node matching the given YAML Path\n                                    query as boolean; may be given multiple\n                                    times\n    --date, -d YAMLPATH:str         Cast each node matching the given YAML Path\n                                    query as a date, assuming it's ISO 8601; may\n                                    be given multiple times\n    --number, --int, --float, -i, -f YAMLPATH:str\n                                    Cast each node matching the given YAML Path\n                                    query as a number; may be given multiple\n                                    times\n    --schema, -s NESTED_TEXT_FILE:ExistingFile\n                                    Cast nodes matching YAML Path queries\n                                    specified in a NestedText document. It must\n                                    be a map whose keys are names of supported\n                                    types (a subset of 'null', 'boolean',\n                                    'number', and 'date'). Each key's value is a\n                                    list of YAML Paths; may be given multiple\n                                    times\n\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ent2 huml\u003c/summary\u003e\n\n```\nnt2 huml 0.3.0\n\nRead NestedText and output its content as HUML.\n\nBy default, generated HUML values will only contain strings, arrays, and maps,\nbut you can cast nodes matching YAML Paths to boolean, number or null.\n\nSwitches may be before or after file arguments.\n\nExamples:\n    - nt2 huml config.nt\n    - nt2 huml config.nt --number font.size --boolean font.bold\n    - nt2 huml config.nt --schema config.types.nt\n    - cat config.nt | nt2 huml\n\nUsage:\n    nt2 huml [SWITCHES] NESTED_TEXT_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --boolean, -b YAMLPATH:str      Cast each node matching the given YAML Path\n                                    query as boolean; may be given multiple\n                                    times\n    --null, -n YAMLPATH:str         Cast each node matching the given YAML Path\n                                    query as null, if it is an empty string; may\n                                    be given multiple times\n    --number, --int, --float, -i, -f YAMLPATH:str\n                                    Cast each node matching the given YAML Path\n                                    query as a number; may be given multiple\n                                    times\n    --schema, -s NESTED_TEXT_FILE:ExistingFile\n                                    Cast nodes matching YAML Path queries\n                                    specified in a NestedText document. It must\n                                    be a map whose keys are names of supported\n                                    types (a subset of 'null', 'boolean',\n                                    'number', and 'date'). Each key's value is a\n                                    list of YAML Paths; may be given multiple\n                                    times\n\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e2nt json\u003c/summary\u003e\n\n```\n2nt json 0.3.0\n\nRead JSON and output its content as NestedText.\n\nExamples:\n    - 2nt json config.json\n    - 2nt json config.json --to-schema \u003econfig.types.nt\n    - cat config.json | 2nt json\n\nIt can be invoked as either the subcommand `2nt json` or the single command\n`json2nt`.\n\nUsage:\n    2nt json [SWITCHES] JSON_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --inline-width, -i WIDTH:[0..120] Maximum line width for inline dictionaries\n                                    and lists\n    --to-schema, -s                 Rather than convert the inputs, generate a\n                                    schema\n\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e2nt yaml\u003c/summary\u003e\n\n```\n2nt yaml 0.3.0\n\nRead YAML and output its content as NestedText.\n\nExamples:\n    - 2nt yaml config.yml\n    - 2nt yaml config.yml --to-schema \u003econfig.types.nt\n    - cat config.yml | 2nt yaml\n\nIt can be invoked as either the subcommand `2nt yaml` or the single command\n`yaml2nt`.\n\nUsage:\n    2nt yaml [SWITCHES] YAML_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --inline-width, -i WIDTH:[0..120] Maximum line width for inline dictionaries\n                                    and lists\n    --to-schema, -s                 Rather than convert the inputs, generate a\n                                    schema\n\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e2nt toml\u003c/summary\u003e\n\n```\n2nt toml 0.3.0\n\nRead TOML and output its content as NestedText.\n\nExamples:\n    - 2nt toml config.toml\n    - 2nt toml config.toml --to-schema \u003econfig.types.nt\n    - cat config.toml | 2nt toml\n\nIt can be invoked as either the subcommand `2nt toml` or the single command\n`toml2nt`.\n\nUsage:\n    2nt toml [SWITCHES] TOML_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --inline-width, -i WIDTH:[0..120] Maximum line width for inline dictionaries\n                                    and lists\n    --to-schema, -s                 Rather than convert the inputs, generate a\n                                    schema\n\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e2nt huml\u003c/summary\u003e\n\n```\n2nt huml 0.3.0\n\nRead HUML and output its content as NestedText.\n\nExamples:\n    - 2nt huml config.huml\n    - 2nt huml config.huml --to-schema \u003econfig.types.nt\n    - cat config.huml | 2nt huml\n\nUsage:\n    2nt huml [SWITCHES] HUML_FILE...\n\nMeta-switches:\n    -h, --help                      Prints this help message and quits\n    -v, --version                   Prints the program's version and quits\n\nSwitches:\n    --inline-width, -i WIDTH:[0..120] Maximum line width for inline dictionaries\n                                    and lists\n    --to-schema, -s                 Rather than convert the inputs, generate a\n                                    schema\n\n\n```\n\n\u003c/details\u003e\n\n#### Limitations\n\n##### Non-string Keys\n\nYAML officially supports non-string key types,\nlike maps, lists, and numbers.\nSupport for non-string keys varies from one YAML parser to the next,\nand is currently not handled by NestedTextTo.\n\nIf anyone is interested in using NestedTextTo with non-string key types,\nplease open an issue and I'll see what I can do!\n\n##### Duplicate Keys\n\nMost of the formats don't support duplicate keys,\nand they are not currently handled by NestedTextTo.\n\nPlease open an issue if this matters to you.\n\n### More Examples\n\n#### View JSON Lines logs in a more readable format\n\n```console\n$ cat log.jsonl\n```\n\u003cdetails\u003e\n  \u003csummary\u003eOutput\u003c/summary\u003e\n\n```json\n{\"chat_id\": 651321, \"event\": \"receiving code\", \"user_first_name\": \"Andy\", \"user_id\": 651321}\n{\"event\": \"guessed syntax\", \"ext\": null, \"probability\": 0.05201493203639984, \"probability_min\": 0.12, \"syntax\": \"Matlab\"}\n{\"chat_id\": 651321, \"event\": \"colorizing code\", \"syntax\": \"py3\", \"user_first_name\": \"Andy\", \"user_id\": 651321}\n{\"event\": \"Got deletion request\", \"reply_to_msg_user_id\": 651321, \"user_id\": 651321}\n{\"chat_id\": 651321, \"event\": \"failed to delete message (it's probably gone already)\", \"exception\": \"Traceback (most recent call last):\\n  File \\\"/home/andy/Code/colorcodebot/app/colorcodebot.py\\\", line 278, in delete_after_delay\\n    bot.delete_message(message.chat.id, message.message_id)\\n  File \\\"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/__init__.py\\\", line 1081, in delete_message\\n    return apihelper.delete_message(self.token, chat_id, message_id, timeout)\\n  File \\\"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/apihelper.py\\\", line 1299, in delete_message\\n    return _make_request(token, method_url, params=payload, method='post')\\n  File \\\"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/apihelper.py\\\", line 152, in _make_request\\n    json_result = _check_result(method_name, result)\\n  File \\\"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/apihelper.py\\\", line 179, in _check_result\\n    raise ApiTelegramException(method_name, result, result_json)\\ntelebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: message to delete not found\"}\n```\n\n\u003c/details\u003e\n\n```console\n$ json2nt log.jsonl\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eOutput\u003c/summary\u003e\n\n```yaml\n-\n  chat_id: 651321\n  event: receiving code\n  user_first_name: Andy\n  user_id: 651321\n-\n  event: guessed syntax\n  ext:\n  probability: 0.05201493203639984\n  probability_min: 0.12\n  syntax: Matlab\n-\n  chat_id: 651321\n  event: colorizing code\n  syntax: py3\n  user_first_name: Andy\n  user_id: 651321\n-\n  event: Got deletion request\n  reply_to_msg_user_id: 651321\n  user_id: 651321\n-\n  chat_id: 651321\n  event: failed to delete message (it's probably gone already)\n  exception:\n    \u003e Traceback (most recent call last):\n    \u003e   File \"/home/andy/Code/colorcodebot/app/colorcodebot.py\", line 278, in delete_after_delay\n    \u003e     bot.delete_message(message.chat.id, message.message_id)\n    \u003e   File \"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/__init__.py\", line 1081, in delete_message\n    \u003e     return apihelper.delete_message(self.token, chat_id, message_id, timeout)\n    \u003e   File \"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/apihelper.py\", line 1299, in delete_message\n    \u003e     return _make_request(token, method_url, params=payload, method='post')\n    \u003e   File \"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/apihelper.py\", line 152, in _make_request\n    \u003e     json_result = _check_result(method_name, result)\n    \u003e   File \"/home/andy/.local/share/venvs/84f7fb558856f9ccc2c54e3d122862b6/venv/lib/python3.10/site-packages/telebot/apihelper.py\", line 179, in _check_result\n    \u003e     raise ApiTelegramException(method_name, result, result_json)\n    \u003e telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: message to delete not found\n```\n\n\u003c/details\u003e\n\n#### View TOML as NestedText\n\n![View TOML as NestedText](https://user-images.githubusercontent.com/1787385/199562999-d702bfb5-859c-417d-b8a4-ffb0d36e7537.png)\n\n#### Convert NestedText to TOML, with and without casting\n\n![Convert NestedText to TOML, with and without casting](https://user-images.githubusercontent.com/1787385/199562703-db0fec70-bb18-431a-aa01-c4858b449c56.png)\n\n#### Convert NestedText to TOML with casting via auto-schema\n\n![Convert NestedText to TOML with casting via auto-schema](https://user-images.githubusercontent.com/1787385/199562909-a1060b9b-0446-4aba-81b1-5ff288c839ed.png)\n\n#### Query TOML with JSON tools, with and without casting\n\n![Query TOML with JSON tools, with and without casting](https://user-images.githubusercontent.com/1787385/199562454-b6267df2-aaa9-421b-a47d-93cb49641a30.png)\n\n### Development Docs\n\nFor local development, it's recommended to install and activate mise, then\n\n```console\n$ mise run install\n```\n\nFrom there, you may want to look at common task definitions:\n\n```console\n$ mise tasks\n```\n\nAnd you may wish to browse the structure and in-code documentation as rendered HTML,\nat [the GitHub Pages site](https://andydecleyre.github.io/nestedtextto/moduleIndex.html).\n","funding_links":[],"categories":["\u003ca name=\"conversion\"\u003e\u003c/a\u003eConversion"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndydeCleyre%2Fnestedtextto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAndydeCleyre%2Fnestedtextto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndydeCleyre%2Fnestedtextto/lists"}