A collection of Jupyter notebooks for viewing and parsing JSON and JSONL files, with a focus on extracting and analyzing code snippets and vulnerability data.
- JSON Viewer: Parse and view JSON files with code extraction capabilities
- JSONL Viewer: Parse and view JSON Lines files with batch processing
- Code Extraction: Automatically detect and extract code snippets from JSON data
- Statistics: Get detailed statistics about JSON/JSONL structure
- Search & Filter: Search for specific keys and filter records
A comprehensive notebook for viewing and parsing JSON files.
Features:
- Load and parse JSON files
- Display formatted JSON data
- Extract code snippets from JSON
- Get JSON structure statistics
- Search for specific keys
- Handle nested structures
A notebook designed for JSON Lines (JSONL) format files.
Features:
- Load and parse JSONL files (one JSON object per line)
- Display individual records
- Extract code from multiple records
- Get statistics across all records
- Filter records by key or value
- Convert JSONL to JSON format
pip install jupyter notebook- Start Jupyter Notebook:
jupyter notebook-
Open either
json_viewer.ipynborjsonl_viewer.ipynb -
Update the file path in the example usage cells:
# For JSON files
json_file_path = 'your_file.json'
# For JSONL files
jsonl_file_path = 'your_file.jsonl'- Run the cells to view and analyze your data
The repository includes sample files for testing:
sample_vulnerability.json: Example JSON file with vulnerability data and code snippetssample_vulnerabilities.jsonl: Example JSONL file with multiple vulnerability records
Both notebooks can automatically extract code snippets from JSON data by searching for common code-related keys:
codesnippetsourcebodycontenttextscriptprogram
The extracted code is displayed with its location path in the JSON structure.
- Security Analysis: View vulnerability reports with code snippets
- Data Exploration: Explore JSON/JSONL datasets interactively
- Code Review: Extract and review code snippets from JSON data
- Data Processing: Parse and filter large JSONL files
- Format Conversion: Convert between JSON and JSONL formats
This project is licensed under the MIT License - see the LICENSE file for details.