Skip to content

Commit 06313c2

Browse files
committed
Initial commit: JSON to CSV Converter (Multi-File)
- PyQt6-based native macOS application - Multi-file batch processing with schema analysis - Multiple field merging strategies - GitHub Actions workflow for multi-architecture builds - Comprehensive documentation and sample data
0 parents  commit 06313c2

36 files changed

Lines changed: 11557 additions & 0 deletions

.claude/settings.local.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(python3:*)",
5+
"Bash(chmod:*)",
6+
"Bash(./build_cli.sh:*)",
7+
"Bash(./build_multifile.sh:*)"
8+
],
9+
"deny": []
10+
}
11+
}

.github/workflows/build.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Build JSON to CSV Converter
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
tags:
7+
- 'v*'
8+
pull_request:
9+
branches: [ main, master ]
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-macos:
14+
strategy:
15+
matrix:
16+
include:
17+
- os: macos-13 # Intel
18+
arch: x86_64
19+
name: intel
20+
- os: macos-latest # Apple Silicon
21+
arch: arm64
22+
name: apple-silicon
23+
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.11'
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install pyinstaller PyQt6
38+
39+
- name: Build application
40+
run: |
41+
pyinstaller --name "JSON to CSV Converter" \
42+
--windowed \
43+
--onedir \
44+
--noconfirm \
45+
--clean \
46+
--osx-bundle-identifier "com.simplifi.jsontocsv" \
47+
json_to_csv_multifile_pyqt.py
48+
49+
- name: Create DMG
50+
run: |
51+
# Create a DMG for easier distribution
52+
mkdir -p dmg_contents
53+
cp -R "dist/JSON to CSV Converter.app" dmg_contents/
54+
55+
# Create Applications symlink
56+
ln -s /Applications dmg_contents/Applications
57+
58+
# Create DMG
59+
hdiutil create -volname "JSON to CSV Converter" \
60+
-srcfolder dmg_contents \
61+
-ov -format UDZO \
62+
"JSON-to-CSV-Converter-${{ matrix.name }}.dmg"
63+
64+
- name: Upload artifact
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: JSON-to-CSV-Converter-${{ matrix.name }}
68+
path: JSON-to-CSV-Converter-${{ matrix.name }}.dmg
69+
if-no-files-found: error
70+
71+
- name: Upload app bundle artifact
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: JSON-to-CSV-Converter-app-${{ matrix.name }}
75+
path: dist/JSON to CSV Converter.app
76+
if-no-files-found: error
77+
78+
create-release:
79+
needs: build-macos
80+
runs-on: ubuntu-latest
81+
if: startsWith(github.ref, 'refs/tags/')
82+
83+
steps:
84+
- name: Download all artifacts
85+
uses: actions/download-artifact@v4
86+
87+
- name: Create Release
88+
uses: softprops/action-gh-release@v1
89+
with:
90+
files: |
91+
JSON-to-CSV-Converter-intel/JSON-to-CSV-Converter-intel.dmg
92+
JSON-to-CSV-Converter-apple-silicon/JSON-to-CSV-Converter-apple-silicon.dmg
93+
body: |
94+
## JSON to CSV Converter
95+
96+
### Downloads
97+
- **Intel Macs**: `JSON-to-CSV-Converter-intel.dmg`
98+
- **Apple Silicon Macs** (M1/M2/M3): `JSON-to-CSV-Converter-apple-silicon.dmg`
99+
100+
### How to check your Mac type
101+
1. Click the Apple menu > About This Mac
102+
2. Look for "Chip" or "Processor"
103+
- Intel processor = Download Intel version
104+
- Apple M1/M2/M3 = Download Apple Silicon version
105+
106+
### Installation
107+
1. Download the appropriate DMG file
108+
2. Double-click to mount it
109+
3. Drag the app to your Applications folder
110+
4. First time running: Right-click and select "Open" to bypass Gatekeeper
111+
draft: false
112+
prerelease: false

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Build artifacts
2+
build/
3+
dist/
4+
*.egg-info/
5+
*.spec
6+
7+
# Python
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
*.so
12+
.Python
13+
14+
# Virtual environments
15+
.venv/
16+
venv/
17+
env/
18+
ENV/
19+
.venv_intel/
20+
venv_intel/
21+
22+
# IDE
23+
.vscode/
24+
.idea/
25+
*.swp
26+
*.swo
27+
*~
28+
29+
# macOS
30+
.DS_Store
31+
.AppleDouble
32+
.LSOverride
33+
Icon?
34+
35+
# Data files (keep repository clean)
36+
*.csv
37+
!samples/*.csv
38+
*.zip
39+
export-*
40+
user-export-*
41+
test_data_*
42+
43+
# Keep sample files in the repo
44+
!samples/*.json
45+
!samples/*.csv
46+
47+
# Logs
48+
*.log
49+
50+
# Temporary files
51+
*.tmp
52+
*.temp
53+
54+
# PyInstaller specific
55+
*.manifest
56+
*.spec

README.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# JSON to CSV Converter (Multi-File)
2+
3+
A powerful native macOS application for converting JSON files to CSV format with advanced schema analysis and field merging capabilities.
4+
5+
![Build Status](https://github.com/simplifi/json-converter/workflows/Build%20JSON%20to%20CSV%20Converter/badge.svg)
6+
7+
## Features
8+
9+
- 🚀 **Batch Processing**: Convert multiple JSON files at once
10+
- 🧠 **Smart Schema Analysis**: Automatically analyzes and compares schemas across files
11+
- 🔀 **Multiple Merge Strategies**:
12+
- Smart Auto: Fields present in 70%+ of files
13+
- All Available: Union of all fields across files
14+
- Common Only: Fields present in ALL files
15+
- Most Complete File: Use the file with most fields as template
16+
- Keep Separate: Individual CSV files with their own schemas
17+
- 📊 **Nested Field Support**: Handles complex nested JSON structures
18+
- 🖥️ **Native macOS Interface**: Built with PyQt6 for a smooth, native experience
19+
- 📝 **Real-time Status Logging**: Track conversion progress with detailed logs
20+
21+
## Download
22+
23+
Download the latest release for your Mac type from the [Releases](https://github.com/simplifi/json-converter/releases) page:
24+
25+
- **Intel Macs**: `JSON-to-CSV-Converter-intel.dmg`
26+
- **Apple Silicon Macs** (M1/M2/M3): `JSON-to-CSV-Converter-apple-silicon.dmg`
27+
28+
### How to check your Mac type
29+
1. Click the Apple menu > About This Mac
30+
2. Look for "Chip" or "Processor"
31+
- Intel processor = Download Intel version
32+
- Apple M1/M2/M3 = Download Apple Silicon version
33+
34+
## Installation
35+
36+
1. Download the appropriate DMG file for your Mac
37+
2. Double-click the DMG to mount it
38+
3. Drag "JSON to CSV Converter" to your Applications folder
39+
4. First time running: Right-click the app and select "Open" to bypass Gatekeeper
40+
41+
## Usage
42+
43+
1. **Select JSON Files**: Click "Browse for JSON Files" to select one or more JSON files
44+
2. **Schema Analysis**: The app automatically analyzes the structure of your files
45+
3. **Choose Strategy**: Select how you want to handle different schemas across files
46+
4. **Convert**: Click "Convert All Files" and choose an output directory
47+
48+
### Field Selection Strategies
49+
50+
- **Smart Auto**: Includes fields that appear in at least 70% of your files
51+
- **All Available**: Includes every field found across all files (union)
52+
- **Common Only**: Only includes fields that exist in every single file
53+
- **Most Complete File**: Uses the schema from the file with the most fields
54+
- **Keep Files Separate**: Creates individual CSV files, each with its own schema
55+
56+
## Building from Source
57+
58+
### Requirements
59+
60+
- macOS 10.13 or later
61+
- Python 3.8 or later
62+
- PyQt6
63+
64+
### Quick Build
65+
66+
```bash
67+
# Clone the repository
68+
git clone https://github.com/simplifi/json-converter.git
69+
cd json-converter
70+
71+
# Run the build script
72+
./build_app.sh
73+
```
74+
75+
The built application will be in `dist/JSON to CSV Converter.app`
76+
77+
### Building for Different Architectures
78+
79+
See [README_BUILD.md](README_BUILD.md) for detailed instructions on building for both Intel and Apple Silicon Macs.
80+
81+
## Development
82+
83+
### Setting up the development environment
84+
85+
```bash
86+
# Create virtual environment
87+
python3 -m venv .venv
88+
source .venv/bin/activate
89+
90+
# Install dependencies
91+
pip install -r requirements.txt
92+
93+
# Run the application
94+
python json_to_csv_multifile_pyqt.py
95+
```
96+
97+
### Project Structure
98+
99+
```
100+
json-converter/
101+
├── json_to_csv_multifile_pyqt.py # Main application
102+
├── generate_sample_data.py # Generate test data
103+
├── build_app.sh # Build script
104+
├── requirements.txt # Python dependencies
105+
└── samples/ # Sample JSON files
106+
```
107+
108+
## Sample Data
109+
110+
Generate sample data for testing:
111+
112+
```bash
113+
python generate_sample_data.py
114+
```
115+
116+
This creates various JSON files with different schemas and sizes in the `samples/` directory.
117+
118+
## Contributing
119+
120+
1. Fork the repository
121+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
122+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
123+
4. Push to the branch (`git push origin feature/amazing-feature`)
124+
5. Open a Pull Request
125+
126+
## License
127+
128+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
129+
130+
## Acknowledgments
131+
132+
- Built with [PyQt6](https://www.riverbankcomputing.com/software/pyqt/)
133+
- Packaged with [PyInstaller](https://www.pyinstaller.org/)
134+
135+
## Support
136+
137+
For issues, questions, or contributions, please visit the [GitHub repository](https://github.com/simplifi/json-converter).

0 commit comments

Comments
 (0)