skillfed

jc

Converts the output of popular command-line tools and file-types to JSON.

jc v1.25.7 603.8K downloads/30d#5,809 on PyPI8,663
Permissive license MIT Active released

What it is and what it does

jc is a command-line JSON converter that transforms the output of popular CLI tools, file-types, and common strings into structured JSON. It works both as a CLI filter (piping command output through jc) and as a Python library, returning dictionaries or lists of dictionaries instead of raw JSON strings. The package includes parsers for many standard Unix tools and supports both strict schema conversion (with type inference and semantic context) and raw pre-processed output modes.

Typical use cases include shell scripting with jq for further processing, parsing command output in Ansible, Saltstack, and Nornir automation frameworks, and building data pipelines that need structured input from unstructured CLI output. It has three runtime dependencies (ruamel.yaml, xmltodict, Pygments) and requires Python 3.6 or later.

Use it for:

  • Pipe dig, nslookup, or other network command output through jc and jq to extract specific fields programmatically.
  • Parse system command output in Ansible playbooks using the community.general jc filter plugin.
  • Convert file-type outputs (e.g., CSV, XML, YAML) to JSON for downstream processing in scripts.
  • Build monitoring and alerting systems that ingest CLI tool output and transform it into queryable JSON.
  • Automate infrastructure orchestration in Saltstack or Nornir by parsing command results as structured data.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts output from popular CLI tools, file-types, and strings into structured JSON for easier parsing in scripts and automation.

Yes. jc is actively maintained, has no known vulnerabilities, low install friction, and solves a genuine problem in CLI data processing. The permissive MIT license and broad parser coverage make it a practical choice for automation, scripting, and infrastructure-as-code workflows. Install if you regularly need to extract structured data from command-line tool output.

Install

jc on PyPI

pip

pip install jc

uv

uv add jc

poetry

poetry add jc

Installing jc

Before you install

Low install friction with a pure Python wheel and three straightforward runtime dependencies. Actively maintained with a recent release and strong community engagement (8663 GitHub stars).

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.

Quickstart

pip install jc

import jc
import subprocess

cmd_output = subprocess.check_output(['dig', 'example.com'], text=True)
data = jc.parse('dig', cmd_output)
print(data[0]['answer'])

Requires Python 3.6 or later; the target CLI tool (e.g., dig) must be installed and available on the system.

Verify before relying

  • Complete list of supported parsers and their coverage—the excerpt shows only a partial table.
  • Performance characteristics when parsing large command outputs or streaming data.
  • Compatibility details with specific versions of ruamel.yaml, xmltodict, or Pygments.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 3 — ruamel.yaml, xmltodict, Pygments
Maintenance actively maintained — 57 days since the last release
Last repo commit
First released
Downloads 603,777/month — #5,809 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: jc-1.25.7-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Utilities

Tags

cli output to jsonparse command output jsonconvert tool output jsoncommand line json parserstructured data from cliansible output parsingbash json conversion
cli-parsingjson-conversionautomation

More Utilities packages