localtools-cli-output-to-json 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ dist/
2
+ /*.exe
3
+ node_modules/
4
+ test-results/
5
+ playwright-report/
6
+ __pycache__/
7
+ *.egg-info/
8
+ .venv/
9
+ tests/.fixtures/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chaitanya Prabuddha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.5
2
+ Name: localtools-cli-output-to-json
3
+ Version: 1.0.0
4
+ Summary: Turn command output (df, ps, dig, ip, netstat, Cisco/Juniper/Arista show commands, ...) into JSON, offline (localtools, jc + TextFSM/ntc-templates)
5
+ Project-URL: Source, https://github.com/chayprabs/localtools
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.12
9
+ Requires-Dist: jc==1.26.0
10
+ Requires-Dist: multipart==2.0.1
11
+ Requires-Dist: ntc-templates==9.3.0
12
+ Requires-Dist: pygments==2.21.0
13
+ Requires-Dist: ruamel-yaml==0.19.1
14
+ Requires-Dist: textfsm==2.1.0
15
+ Requires-Dist: xmltodict==1.0.4
16
+ Description-Content-Type: text/markdown
17
+
18
+ # CLI Output to JSON
19
+
20
+ Paste or upload command output and extract structured data with **jc 1.26.0** and **TextFSM 2.1.0 / ntc-templates 9.3.0**. Includes searchable parsers, command/header suggestions, bundled parser documentation and JSON, compact JSON, JSON Lines or CSV downloads. Runs offline; never executes the supplied command or connects to devices.
21
+
22
+ Install (no administrator):
23
+
24
+ ```powershell
25
+ irm https://raw.githubusercontent.com/chayprabs/localtools/main/cli-output-to-json/install.ps1 | iex
26
+ ```
27
+
28
+ ```sh
29
+ curl -fsSL https://raw.githubusercontent.com/chayprabs/localtools/main/cli-output-to-json/install.sh | bash
30
+ # Or Python 3.12+ on any OS:
31
+ pipx install localtools-cli-output-to-json
32
+ ```
33
+
34
+ Portable ZIPs: [Windows, macOS and Linux releases](https://github.com/chayprabs/localtools/releases/tag/cli-output-to-json-v1.0.0).
35
+
36
+ Run `localtools-cli-output-to-json` for the UI at <http://127.0.0.1:47119>. Paste text or choose one UTF-8 file, search/select a parser and Convert. Network template IDs start with `ntc/`. Suggestions use the command index (including platform) or familiar headers, and require your selection; they are not validation or probability scores. Parser documentation is available in the UI.
37
+
38
+ ```sh
39
+ localtools-cli-output-to-json parsers cisco_ios
40
+ localtools-cli-output-to-json parsers --docs df
41
+ localtools-cli-output-to-json suggest output.txt --command 'show ip interface brief' --platform cisco_ios
42
+ localtools-cli-output-to-json parse output.txt --parser df --format json -o output.json
43
+ localtools-cli-output-to-json parse router.txt --parser ntc/cisco_ios_show_ip_interface_brief --format csv
44
+ df -h | localtools-cli-output-to-json parse --parser df
45
+ ```
46
+
47
+ CLI reads a file or stdin (`-`); `--strip-prompt` explicitly removes a recognized first-line shell/device prompt. No prompt or ANSI removal occurs by default. CLI output files are written atomically; notes go to stderr. JSON preserves integer digits and Unicode; the UI displays output text without converting integer values to JavaScript numbers. JSONL emits one array member per line (a non-array is one record). CSV unions record keys and encodes nested values as JSON; absent/null fields become empty cells. CSV is data, so spreadsheet users should import fields as text to avoid formula evaluation.
48
+
49
+ API: `GET /api/parsers`, `GET /api/docs?parser=df`, `POST /api/suggest`, `POST /api/parse` (JSON envelope with `output` as a string, notes and record count), or `POST /api/convert` (download response). POST accepts JSON fields or multipart fields; upload under `file` **or** paste under `input`. Fields: `parser`, `format` (default `json`), `command`, `platform`, `strip_prompt` (`true` or `false`). Example:
50
+
51
+ ```sh
52
+ curl http://127.0.0.1:47119/api/convert -F parser=df -F file=@output.txt -o output.json
53
+ ```
54
+
55
+ Limits: 4 MiB UTF-8 input, 100,000 lines, 65,536 characters per line, 16 MiB rendered output, 15-second parser deadline and two simultaneous parser jobs. JSON request envelope up to 24 MiB accommodates escaped 4 MiB text. Preview shows at most 131,072 characters; Copy/Download retain the entire result. Input violations return 413, parser/format failures 422, malformed requests 400 and overload 503. Independent supervisor processes stop regex-bound parsers on timeout, client disconnect or server exit; each worker has a 768 MiB address-space/Windows-job memory budget. Parent-owned temporary folders are removed after jobs; only exact tool folders older than one hour, containing no links, are swept on next startup after a hard kill.
56
+
57
+ Engine choice: [jc](https://github.com/kellyjonbrazil/jc) has mature OS-command parsers; [NTC templates](https://ntc-templates.readthedocs.io/en/latest/user/lib_getting_started/) adds indexed platform/command-specific network parsing. Pure Python wheels include the templates and work in all four portable CPython ZIPs. Parser/template output matches these pinned engines, including their limitations. Naive date/time conversions use the machine's timezone, as jc does.
58
+
59
+ Cuts and cautions: extraction is not a lossless transcription or command validator. Parsers can ignore lines, lose duplicate keys or infer types according to their upstream rules; warnings are surfaced, and zero extraction is explicitly flagged. Device firmware/output variants may need a different template. Only the 969 **indexed** NTC parser entries are exposed (multi-template index entries use TextFSM's key merge); custom templates, unindexed templates, remote execution, binary inputs/DER certificates and automatic parser selection are unsupported. jc text parsers can accept PEM/XML/plist, but this UI accepts UTF-8 text only. Suggestions cover registered command names and a small set of familiar headers; unknown/ambiguous inputs require manual selection. ANSI, pager prompts and unrelated surrounding output should be removed before parsing. Non-finite numbers cannot be exported as JSON.
60
+
61
+ Update/uninstall: `localtools-cli-output-to-json update` / `localtools-cli-output-to-json uninstall`; pipx installs use `pipx upgrade` / `pipx uninstall localtools-cli-output-to-json`.
62
+
63
+ MIT license. See `THIRD_PARTY_NOTICES.md` and included dependency/runtime licenses.
@@ -0,0 +1,46 @@
1
+ # CLI Output to JSON
2
+
3
+ Paste or upload command output and extract structured data with **jc 1.26.0** and **TextFSM 2.1.0 / ntc-templates 9.3.0**. Includes searchable parsers, command/header suggestions, bundled parser documentation and JSON, compact JSON, JSON Lines or CSV downloads. Runs offline; never executes the supplied command or connects to devices.
4
+
5
+ Install (no administrator):
6
+
7
+ ```powershell
8
+ irm https://raw.githubusercontent.com/chayprabs/localtools/main/cli-output-to-json/install.ps1 | iex
9
+ ```
10
+
11
+ ```sh
12
+ curl -fsSL https://raw.githubusercontent.com/chayprabs/localtools/main/cli-output-to-json/install.sh | bash
13
+ # Or Python 3.12+ on any OS:
14
+ pipx install localtools-cli-output-to-json
15
+ ```
16
+
17
+ Portable ZIPs: [Windows, macOS and Linux releases](https://github.com/chayprabs/localtools/releases/tag/cli-output-to-json-v1.0.0).
18
+
19
+ Run `localtools-cli-output-to-json` for the UI at <http://127.0.0.1:47119>. Paste text or choose one UTF-8 file, search/select a parser and Convert. Network template IDs start with `ntc/`. Suggestions use the command index (including platform) or familiar headers, and require your selection; they are not validation or probability scores. Parser documentation is available in the UI.
20
+
21
+ ```sh
22
+ localtools-cli-output-to-json parsers cisco_ios
23
+ localtools-cli-output-to-json parsers --docs df
24
+ localtools-cli-output-to-json suggest output.txt --command 'show ip interface brief' --platform cisco_ios
25
+ localtools-cli-output-to-json parse output.txt --parser df --format json -o output.json
26
+ localtools-cli-output-to-json parse router.txt --parser ntc/cisco_ios_show_ip_interface_brief --format csv
27
+ df -h | localtools-cli-output-to-json parse --parser df
28
+ ```
29
+
30
+ CLI reads a file or stdin (`-`); `--strip-prompt` explicitly removes a recognized first-line shell/device prompt. No prompt or ANSI removal occurs by default. CLI output files are written atomically; notes go to stderr. JSON preserves integer digits and Unicode; the UI displays output text without converting integer values to JavaScript numbers. JSONL emits one array member per line (a non-array is one record). CSV unions record keys and encodes nested values as JSON; absent/null fields become empty cells. CSV is data, so spreadsheet users should import fields as text to avoid formula evaluation.
31
+
32
+ API: `GET /api/parsers`, `GET /api/docs?parser=df`, `POST /api/suggest`, `POST /api/parse` (JSON envelope with `output` as a string, notes and record count), or `POST /api/convert` (download response). POST accepts JSON fields or multipart fields; upload under `file` **or** paste under `input`. Fields: `parser`, `format` (default `json`), `command`, `platform`, `strip_prompt` (`true` or `false`). Example:
33
+
34
+ ```sh
35
+ curl http://127.0.0.1:47119/api/convert -F parser=df -F file=@output.txt -o output.json
36
+ ```
37
+
38
+ Limits: 4 MiB UTF-8 input, 100,000 lines, 65,536 characters per line, 16 MiB rendered output, 15-second parser deadline and two simultaneous parser jobs. JSON request envelope up to 24 MiB accommodates escaped 4 MiB text. Preview shows at most 131,072 characters; Copy/Download retain the entire result. Input violations return 413, parser/format failures 422, malformed requests 400 and overload 503. Independent supervisor processes stop regex-bound parsers on timeout, client disconnect or server exit; each worker has a 768 MiB address-space/Windows-job memory budget. Parent-owned temporary folders are removed after jobs; only exact tool folders older than one hour, containing no links, are swept on next startup after a hard kill.
39
+
40
+ Engine choice: [jc](https://github.com/kellyjonbrazil/jc) has mature OS-command parsers; [NTC templates](https://ntc-templates.readthedocs.io/en/latest/user/lib_getting_started/) adds indexed platform/command-specific network parsing. Pure Python wheels include the templates and work in all four portable CPython ZIPs. Parser/template output matches these pinned engines, including their limitations. Naive date/time conversions use the machine's timezone, as jc does.
41
+
42
+ Cuts and cautions: extraction is not a lossless transcription or command validator. Parsers can ignore lines, lose duplicate keys or infer types according to their upstream rules; warnings are surfaced, and zero extraction is explicitly flagged. Device firmware/output variants may need a different template. Only the 969 **indexed** NTC parser entries are exposed (multi-template index entries use TextFSM's key merge); custom templates, unindexed templates, remote execution, binary inputs/DER certificates and automatic parser selection are unsupported. jc text parsers can accept PEM/XML/plist, but this UI accepts UTF-8 text only. Suggestions cover registered command names and a small set of familiar headers; unknown/ambiguous inputs require manual selection. ANSI, pager prompts and unrelated surrounding output should be removed before parsing. Non-finite numbers cannot be exported as JSON.
43
+
44
+ Update/uninstall: `localtools-cli-output-to-json update` / `localtools-cli-output-to-json uninstall`; pipx installs use `pipx upgrade` / `pipx uninstall localtools-cli-output-to-json`.
45
+
46
+ MIT license. See `THIRD_PARTY_NOTICES.md` and included dependency/runtime licenses.