https://github.com/alexredplanet/json-selector
Simple UI for selecting a subset of fields from a set of json files and producing a single json file as result.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.4%) to scientific vocabulary
Repository
Simple UI for selecting a subset of fields from a set of json files and producing a single json file as result.
Basic Info
- Host: GitHub
- Owner: alexredplanet
- Language: HTML
- Default Branch: main
- Size: 14.6 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
JSON Field Selector
A simple web application that allows users to upload JSON files and select specific fields to extract from each file. The application analyzes the JSON structure and provides an intuitive interface for field selection.
Features
- Upload Multiple JSON Files: Drag and drop or click to upload multiple JSON files
- Automatic Field Detection: Analyzes all uploaded files to detect available fields
- Interactive Field Selection: Choose which fields to keep with checkboxes
- Nested Field Support: Handles nested objects and arrays with dot notation
- Export Results: Downloads filtered data as a text file
- Docker Ready: Packaged as a Docker container for easy deployment
Quick Start
Using Docker (Recommended)
Build and run with Docker Compose:
bash docker-compose up --buildOr build and run manually:
bash docker build -t json-selector . docker run -p 5000:5000 json-selectorAccess the application: Open your browser and go to
http://localhost:5000
Local Development
Install dependencies:
bash pip install -r requirements.txtRun the application:
bash python app.pyAccess the application: Open your browser and go to
http://localhost:5000
How to Use
Upload JSON Files:
- Click the upload area or drag and drop your JSON files
- The application will analyze all files and extract available fields
Select Fields:
- Review the list of detected fields
- Use checkboxes to select which fields you want to keep
- Use "Select All" or "Deselect All" for convenience
Generate Results:
- Click "Generate Filtered Results"
- The application will process all files and download a text file
- Each file's filtered data will be included in the output
Field Path Format
The application uses dot notation for nested fields:
- name - Top-level field
- user.email - Nested object field
- items[0].title - Array element field
Output Format
The generated text file contains: ``` // File: example1.json { "selectedfield1": "value1", "selectedfield2": "value2" }
// File: example2.json { "selectedfield1": "value3", "selectedfield2": "value4" } ```
Docker Deployment
Environment Variables
FLASK_ENV: Set toproductionfor production deploymentFLASK_APP: Application entry point (default:app.py)
Ports
- The application runs on port 5000 inside the container
- Map to any external port:
-p 8080:5000
Volumes
- Mount
./uploadsto persist uploaded files between container restarts - Example:
-v $(pwd)/uploads:/app/uploads
Technical Details
- Framework: Flask (Python)
- Frontend: Vanilla JavaScript with modern CSS
- File Handling: Supports JSON files up to 16MB
- Field Detection: Recursive analysis of JSON structure
- Export Format: Plain text with JSON objects
Security Notes
- Files are temporarily stored in the
uploadsdirectory - Previous uploads are cleared when new files are uploaded
- No persistent storage of user data
- File size limited to 16MB per upload
Browser Compatibility
- Modern browsers with JavaScript enabled
- Drag and drop file upload support
- Responsive design for mobile and desktop
Owner
- Login: alexredplanet
- Kind: user
- Repositories: 1
- Profile: https://github.com/alexredplanet
GitHub Events
Total
- Push event: 3
- Create event: 1
Last Year
- Push event: 3
- Create event: 1
Dependencies
- python 3.11-slim build
- Flask ==2.3.3
- Werkzeug ==2.3.7