Lightweight JSON Data Intelligence Processing & Visualization Engine
轻量级JSON数据智能处理与可视化引擎
JSONMind is a powerful yet lightweight CLI tool designed for developers who work with JSON data daily. It provides a comprehensive suite of features for JSON validation, transformation, querying, and visualization — all with zero dependencies and a single Python file.
- 🚀 Zero Dependencies: Uses only Python standard library
- 📦 Single File: Just one
.pyfile, easy to integrate anywhere - ⚡ Lightning Fast: Optimized for performance with large JSON files
- 🎯 Developer-Friendly: Intuitive CLI with helpful error messages
- 🌐 Cross-Platform: Works on Windows, macOS, and Linux
| Feature | Description | Command |
|---|---|---|
| ✅ Validation | Validate JSON syntax with detailed error reporting | jsonmind validate file.json |
| 📊 Statistics | Comprehensive analysis of JSON structure | jsonmind stats file.json |
| 🔍 Query | JSONPath-like query support | jsonmind query file.json '$.users[*].name' |
| 🔄 Flatten | Convert nested JSON to flat structure | jsonmind flatten file.json |
| 🌳 Tree View | ASCII tree visualization | jsonmind tree file.json |
| 📄 CSV Export | Convert JSON arrays to CSV | jsonmind csv file.json -o out.csv |
| 🌐 HTML Export | Generate HTML tables from JSON | jsonmind html file.json -o out.html |
| 📋 XML Export | Convert JSON to XML format | jsonmind xml file.json -o out.xml |
| 🔍 Diff | Compare two JSON files | jsonmind diff file1.json file2.json |
| 🎨 Format | Pretty print with customizable indentation | jsonmind format file.json |
# Download the single file
curl -O https://raw.githubusercontent.com/gitstq/JSONMind/main/jsonmind.py
# Make it executable
chmod +x jsonmind.py
# Run directly
python3 jsonmind.py --helpgit clone https://github.com/gitstq/JSONMind.git
cd JSONMind
python3 jsonmind.py --helppip install jsonmind- Python 3.7 or higher
- Zero external dependencies
# Basic validation
python3 jsonmind.py validate data.json
# Verbose mode with statistics
python3 jsonmind.py validate data.json -vpython3 jsonmind.py stats data.json
# JSON output format
python3 jsonmind.py stats data.json -f jsonSample Output:
📊 JSON Statistics
==================================================
📦 Total Size: 1,251 bytes
🔑 Total Keys: 54
📁 Objects: 14
📋 Arrays: 6
📝 Strings: 37
🔢 Numbers: 15
📏 Max Depth: 4
# Query specific path
python3 jsonmind.py query data.json '$.users[0].name'
# Wildcard query
python3 jsonmind.py query data.json '$.users[*].email'
# Recursive search
python3 jsonmind.py query data.json '$..price'python3 jsonmind.py tree data.json
# Limit depth
python3 jsonmind.py tree data.json -d 3Sample Output:
└── company
│ ├── TechCorp International (str)
└── employees
│ ├── [0]
│ │ ├── id
│ │ │ ├── 1 (int)
│ │ ├── name
│ │ │ ├── Alice Johnson (str)
# JSON to CSV
python3 jsonmind.py csv data.json -o output.csv
# JSON to HTML table
python3 jsonmind.py html data.json -o output.html -t "My Data"
# JSON to XML
python3 jsonmind.py xml data.json -o output.xmlpython3 jsonmind.py diff file1.json file2.json
# JSON output format
python3 jsonmind.py diff file1.json file2.json -f jsonJSONMind was built with the following principles:
- Simplicity: No complex configuration, just works out of the box
- Performance: Handles large JSON files efficiently
- Portability: Single file, no dependencies, runs anywhere
- Extensibility: Clean architecture for easy feature additions
# Install PyInstaller
pip install pyinstaller
# Create executable
pyinstaller --onefile jsonmind.py
# Executable will be in dist/jsonmind# Install Nuitka
pip install nuitka
# Compile to binary
python -m nuitka --standalone --onefile jsonmind.pyWe welcome contributions! Please see our Contributing Guide for details.
# Clone the repo
git clone https://github.com/gitstq/JSONMind.git
cd JSONMind
# Run tests
python3 test_jsonmind.pyThis project is licensed under the MIT License - see the LICENSE file for details.
JSONMind 是一款强大而轻量级的CLI工具,专为日常处理JSON数据的开发者设计。它提供了一套完整的功能,用于JSON验证、转换、查询和可视化 —— 零依赖,仅需单个Python文件。
- 🚀 零依赖: 仅使用Python标准库
- 📦 单文件: 只有一个
.py文件,易于集成到任何地方 - ⚡ 极速: 针对大型JSON文件进行了性能优化
- 🎯 开发者友好: 直观的CLI界面,提供有用的错误提示
- 🌐 跨平台: 支持Windows、macOS和Linux
| 特性 | 描述 | 命令 |
|---|---|---|
| ✅ 验证 | 验证JSON语法并提供详细错误报告 | jsonmind validate file.json |
| 📊 统计 | 全面分析JSON结构 | jsonmind stats file.json |
| 🔍 查询 | 支持JSONPath风格查询 | jsonmind query file.json '$.users[*].name' |
| 🔄 扁平化 | 将嵌套JSON转换为扁平结构 | jsonmind flatten file.json |
| 🌳 树形视图 | ASCII树形可视化 | jsonmind tree file.json |
| 📄 CSV导出 | 将JSON数组转换为CSV | jsonmind csv file.json -o out.csv |
| 🌐 HTML导出 | 从JSON生成HTML表格 | jsonmind html file.json -o out.html |
| 📋 XML导出 | 将JSON转换为XML格式 | jsonmind xml file.json -o out.xml |
| 🔍 差异对比 | 比较两个JSON文件 | jsonmind diff file1.json file2.json |
| 🎨 格式化 | 美化打印,支持自定义缩进 | jsonmind format file.json |
# 下载单文件
curl -O https://raw.githubusercontent.com/gitstq/JSONMind/main/jsonmind.py
# 添加执行权限
chmod +x jsonmind.py
# 直接运行
python3 jsonmind.py --helpgit clone https://github.com/gitstq/JSONMind.git
cd JSONMind
python3 jsonmind.py --helppip install jsonmind- Python 3.7 或更高版本
- 零外部依赖
# 基础验证
python3 jsonmind.py validate data.json
# 详细模式(含统计信息)
python3 jsonmind.py validate data.json -vpython3 jsonmind.py stats data.json
# JSON格式输出
python3 jsonmind.py stats data.json -f json示例输出:
📊 JSON统计信息
==================================================
📦 总大小: 1,251 字节
🔑 总键数: 54
📁 对象数: 14
📋 数组数: 6
📝 字符串: 37
🔢 数字: 15
📏 最大深度: 4
# 查询特定路径
python3 jsonmind.py query data.json '$.users[0].name'
# 通配符查询
python3 jsonmind.py query data.json '$.users[*].email'
# 递归搜索
python3 jsonmind.py query data.json '$..price'python3 jsonmind.py tree data.json
# 限制深度
python3 jsonmind.py tree data.json -d 3# JSON转CSV
python3 jsonmind.py csv data.json -o output.csv
# JSON转HTML表格
python3 jsonmind.py html data.json -o output.html -t "我的数据"
# JSON转XML
python3 jsonmind.py xml data.json -o output.xmlpython3 jsonmind.py diff file1.json file2.json
# JSON格式输出
python3 jsonmind.py diff file1.json file2.json -f jsonJSONMind遵循以下设计原则:
- 简洁性: 无需复杂配置,开箱即用
- 性能: 高效处理大型JSON文件
- 可移植性: 单文件,无依赖,随处运行
- 可扩展性: 清晰的架构,便于添加新功能
# 安装PyInstaller
pip install pyinstaller
# 创建可执行文件
pyinstaller --onefile jsonmind.py
# 可执行文件位于 dist/jsonmind我们欢迎贡献!请查看我们的贡献指南了解详情。
# 克隆仓库
git clone https://github.com/gitstq/JSONMind.git
cd JSONMind
# 运行测试
python3 test_jsonmind.py本项目采用MIT协议开源 - 详见LICENSE文件。
JSONMind 是一款強大且輕量級的CLI工具,專為日常處理JSON資料的開發者設計。它提供了一套完整的功能,用於JSON驗證、轉換、查詢和視覺化 —— 零依賴,僅需單個Python檔案。
- 🚀 零依賴: 僅使用Python標準庫
- 📦 單檔案: 只有一個
.py檔案,易於整合到任何地方 - ⚡ 極速: 針對大型JSON檔案進行效能最佳化
- 🎯 開發者友善: 直觀的CLI介面,提供有用的錯誤提示
- 🌐 跨平台: 支援Windows、macOS和Linux
| 特性 | 描述 | 指令 |
|---|---|---|
| ✅ 驗證 | 驗證JSON語法並提供詳細錯誤報告 | jsonmind validate file.json |
| 📊 統計 | 全面分析JSON結構 | jsonmind stats file.json |
| 🔍 查詢 | 支援JSONPath風格查詢 | jsonmind query file.json '$.users[*].name' |
| 🔄 扁平化 | 將巢狀JSON轉換為扁平結構 | jsonmind flatten file.json |
| 🌳 樹形檢視 | ASCII樹形視覺化 | jsonmind tree file.json |
| 📄 CSV匯出 | 將JSON陣列轉換為CSV | jsonmind csv file.json -o out.csv |
| 🌐 HTML匯出 | 從JSON生成HTML表格 | jsonmind html file.json -o out.html |
| 📋 XML匯出 | 將JSON轉換為XML格式 | jsonmind xml file.json -o out.xml |
| 🔍 差異比對 | 比較兩個JSON檔案 | jsonmind diff file1.json file2.json |
| 🎨 格式化 | 美化列印,支援自訂縮排 | jsonmind format file.json |
# 下載單檔案
curl -O https://raw.githubusercontent.com/gitstq/JSONMind/main/jsonmind.py
# 新增執行權限
chmod +x jsonmind.py
# 直接執行
python3 jsonmind.py --helpgit clone https://github.com/gitstq/JSONMind.git
cd JSONMind
python3 jsonmind.py --helppip install jsonmind- Python 3.7 或更高版本
- 零外部依賴
# 基礎驗證
python3 jsonmind.py validate data.json
# 詳細模式(含統計資訊)
python3 jsonmind.py validate data.json -vpython3 jsonmind.py stats data.json
# JSON格式輸出
python3 jsonmind.py stats data.json -f json範例輸出:
📊 JSON統計資訊
==================================================
📦 總大小: 1,251 位元組
🔑 總鍵數: 54
📁 物件數: 14
📋 陣列數: 6
📝 字串: 37
🔢 數字: 15
📏 最大深度: 4
# 查詢特定路徑
python3 jsonmind.py query data.json '$.users[0].name'
# 萬用字元查詢
python3 jsonmind.py query data.json '$.users[*].email'
# 遞迴搜尋
python3 jsonmind.py query data.json '$..price'python3 jsonmind.py tree data.json
# 限制深度
python3 jsonmind.py tree data.json -d 3# JSON轉CSV
python3 jsonmind.py csv data.json -o output.csv
# JSON轉HTML表格
python3 jsonmind.py html data.json -o output.html -t "我的資料"
# JSON轉XML
python3 jsonmind.py xml data.json -o output.xmlpython3 jsonmind.py diff file1.json file2.json
# JSON格式輸出
python3 jsonmind.py diff file1.json file2.json -f jsonJSONMind遵循以下設計原則:
- 簡潔性: 無需複雜配置,開箱即用
- 效能: 高效處理大型JSON檔案
- 可攜性: 單檔案,無依賴,隨處執行
- 可擴充性: 清晰的架構,便於新增新功能
# 安裝PyInstaller
pip install pyinstaller
# 建立可執行檔
pyinstaller --onefile jsonmind.py
# 可執行檔位於 dist/jsonmind我們歡迎貢獻!請查看我們的貢獻指南了解詳情。
# 克隆倉庫
git clone https://github.com/gitstq/JSONMind.git
cd JSONMind
# 執行測試
python3 test_jsonmind.py本專案採用MIT協議開源 - 詳見LICENSE檔案。
Made with ❤️ by the JSONMind Team
⭐ Star us on GitHub if you find this project helpful!