jc
Converts the output of popular command-line tools and file-types to JSON.
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 jcuv
uv add jcpoetry
poetry add jcInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
jsoncommentParses JSON with comments, multiline strings,…
permissive · top 15,000 on PyPI
terminaltablesRenders formatted ASCII tables in terminal…
permissive · top 5,000 on PyPI
xmltojsonConverts XML documents to JSON format via a…
permissive · top 15,000 on PyPI
jinja2-cliA command-line interface for Jinja2 templating…
permissive · top 5,000 on PyPI
terminaltables3Renders formatted tables in terminal output…
permissive · top 15,000 on PyPI
pingparsingExecutes and parses ping command output,…
permissive · top 15,000 on PyPI
dirtyjsonParses JSON-like data from files containing…
permissive · top 5,000 on PyPI
mo-sql-parsingParses SQL queries into JSON-serializable parse…
copyleft · top 15,000 on PyPI
ansible-builderAnsible Builder automates the creation of…
permissive · top 15,000 on PyPI
eml-parserParses EML (email) files and extracts…
agpl · top 15,000 on PyPI