A comprehensive toolkit for processing, organizing, and converting ChatGPT conversation JSON exports into multiple readable formats.
- Multiple Splitting Modes: Split conversations by month, week, title, or hierarchical date-title combinations
- Flexible Output Formats: JSON, readable text, and book-formatted files
- Exclusion Support: Skip specific months from processing
- Batch Processing: Handle entire directory structures automatically
- Master Book Creation: Combine all conversations into a single chronological book
- Clean Organization: Hierarchical directory structures for easy navigation
JsonSplitter/
βββ README.md # This file
βββ requirements.txt # Python dependencies
βββ split_conversations.py # Main conversation splitter
βββ convert_conversations.py # JSON to text converter
βββ convert_to_book_format.py # Text to book format converter
βββ create_master_book.py # Master book creator
βββ conversations.json # Your input file (add this)
βββ output/ # Monthly split files
βββ output_by_title/ # Individual conversations by title
βββ output_by_date_title/ # Hierarchical date-title organization
βββ output_with_exclusions/ # Monthly with excluded months
βββ output_text/ # Monthly conversations as text
βββ output_by_title_text/ # Individual conversations as text
βββ output_by_date_title_text/ # Hierarchical text format
βββ output_by_date_title_book/ # Book-readable format
βββ chatgpt_conversations_master_book.txt # Complete master book
- Clone the repository:
git clone https://github.com/yourusername/JsonSplitter.git
cd JsonSplitter- Install Python dependencies:
pip install -r requirements.txt- Add your conversations file:
- Export your ChatGPT conversations as
conversations.json - Place it in the project root directory
- Export your ChatGPT conversations as
# Split by month (default)
python3 split_conversations.py conversations.json output
# Split by week
python3 split_conversations.py conversations.json output --mode week
# Split by individual conversation titles
python3 split_conversations.py conversations.json output_by_title --mode title
# Split hierarchically by date then title
python3 split_conversations.py conversations.json output_by_date_title --mode date_title# Split by month but exclude specific months
python3 split_conversations.py conversations.json output_with_exclusions --out-months 2023-04 2023-05
# Hierarchical split with exclusions
python3 split_conversations.py conversations.json output_by_date_title_excluded --mode date_title --out-months 2023-04 2023-05# Convert JSON files to detailed text format
python3 convert_conversations.py output output_text
python3 convert_conversations.py output_by_title output_by_title_text
python3 convert_conversations.py output_by_date_title output_by_date_title_text
# Convert to book-readable format
python3 convert_to_book_format.py output_by_date_title_text output_by_date_title_book# Combine all conversations into a single chronological book
python3 create_master_book.py output_by_date_title_book chatgpt_conversations_master_book.txt- Monthly:
conversations_2024-01.json- All conversations from January 2024 - Weekly:
conversations_2024-W15.json- All conversations from week 15 of 2024 - Title:
conversations_Specific_Topic.json- Individual conversations by title - Date-Title:
2024-01/conversations_Specific_Topic.json- Hierarchical organization
Detailed format with timestamps, roles, and metadata:
# Conversation Title
Created: 2024-01-15 10:30:00 UTC
Updated: 2024-01-15 10:45:00 UTC
============================================================
## User Prompt
**Time:** 2024-01-15 10:30:00 UTC
**Content:** Your question here...
## Assistant Response
**Time:** 2024-01-15 10:30:15 UTC
**Model:** gpt-4o
**Content:** Assistant's response here...
Clean, readable format perfect for casual reading:
============================================================
CONVERSATION TITLE
============================================================
[2024-01-15 10:30:00 UTC]
You: Your question here...
[2024-01-15 10:30:15 UTC]
Assistant: Assistant's response here...
----------------------------------------
--mode: Choose splitting mode (month,week,title,date_title)--prefix: Custom filename prefix (default: "conversations")--out-months: Exclude specific months (format: YYYY-MM)
- Processes entire directory structures automatically
- Maintains original directory hierarchy
- Handles multiple conversations per file
- Creates clean, book-readable format
- Removes technical metadata
- Perfect for casual reading
- Combines all conversations chronologically
- Creates monthly chapters
- Single file for easy reading
- Personal Archive: Organize your ChatGPT conversations systematically
- Content Analysis: Process conversations for research or analysis
- Documentation: Create readable records of important discussions
- Book Creation: Turn conversations into a readable book format
- Backup: Maintain organized backups of your conversation history
The scripts work with the standard ChatGPT JSON export format containing:
- Conversation metadata (title, create_time, update_time)
- Message mapping structure with parent-child relationships
- Message content with roles (user, assistant, system, tool)
- Timestamp information
- Invalid Characters: Automatically replaced with underscores
- Length Limits: Titles truncated to 100 characters for filesystem compatibility
- Date Formats: ISO standard (YYYY-MM for months, YYYY-Www for weeks)
- Memory Efficient: Processes files individually, suitable for large datasets
- Batch Processing: Handles entire directory structures automatically
- Error Handling: Graceful handling of malformed data with detailed logging
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add feature description' - Push to the branch:
git push origin feature-name - Submit a pull request
# Process your conversations completely
python3 split_conversations.py conversations.json output_all --mode date_title
python3 convert_conversations.py output_all output_all_text
python3 convert_to_book_format.py output_all_text output_all_book
python3 create_master_book.py output_all_book my_conversations_book.txt# Create monthly summaries excluding old conversations
python3 split_conversations.py conversations.json recent --out-months 2023-04 2023-05 2023-06
python3 convert_conversations.py recent recent_text
python3 convert_to_book_format.py recent_text recent_bookThis project is licensed under the MIT License - see the LICENSE file for details.
- Designed for ChatGPT users who want to organize their conversation history
- Inspired by the need for better conversation management tools
- Built with Python for cross-platform compatibility
If you encounter any issues or have questions:
- Check the examples above
- Ensure your
conversations.jsonfile is in the correct format - Verify Python dependencies are installed
- Create an issue on GitHub with detailed information about your problem
Happy organizing! π