Skip to content

A script to effortlessly extract your entire ChatGPT data export from JSON files to nicely-formatted markdown files.

License

Notifications You must be signed in to change notification settings

machina-ratio/chatgpt-history-export-to-md

 
 

Repository files navigation

Your entire ChatGPT data in beautiful Markdown 📜

Convert your ChatGPT history into well-formatted Markdown files. Additionally, visualize your data with word clouds 🔡☁️, view your prompt history graphs 📈, and access all your custom instructions 🤖 in a single location.

GitHub last commit GitHub issues

Features

  • YAML Headers: Optional and included by default.
  • Track message versions: prompt/response edits included.
  • Code Interpreter: Environment code blocks and execution results.
  • Data Visualizations: Word clouds, graphs, and more.
  • Custom Instructions: All your custom instructions in one JSON file.

See examples here.

Getting Started

Ensure you have Python and Git installed. If not:

1. Export Your ChatGPT Data 🗂

  • Sign in at chat.openai.com.
  • Navigate: Profile Name (bottom left) -> Settings -> Data controls -> Export -> Confirm export.
  • Await email from OpenAI and download the .zip file.

2. Copy the Tool to Your Computer 📥

  • Open a program called "terminal" or "command prompt".

  • Type (and hit enter after each line):

git clone https://github.com/mohamed-chs/chatgpt-history-export-to-md.git
cd chatgpt-history-export-to-md

This will copy this GitHub repository on your computer, and navigate to the root directory.

3. Set Up the Environment 🛠️

Type (and hit enter):

python setup.py

This will create a virtual environment and install the necessary python libraries.

Activate the virtual environment

On Linux or MacOS:

source .venv/bin/activate

On Windows:

Using Command Prompt (cmd.exe):

.venv\Scripts\activate.bat

Using PowerShell:

.venv\Scripts\Activate.ps1

If you encounter an error about script execution in PowerShell, try running:

powershell -ExecutionPolicy ByPass -File .venv\Scripts\Activate.ps1

4. Run the Script 🏃‍♂️

With the environment set up, you can now run the script. In the terminal or command prompt, execute:

python main.py

Now, follow the instructions on screen and choose your desired options, the script will handle the rest.

5. Check the Output 🎉

And that's it! After running the script, head over to the output folder to see your nice word clouds, graphs, and neatly formatted Markdown files. Enjoy !

Tweet Your Discoveries:

Tweet

How to add new conversations ➕

See How to use the JS script for instructions on how to download new conversations.

Share Your Feedback! 💌

I hope you find this tool useful. I'm continuously looking to improve on this, but I need your help for that.

Whether you're a tech wizard or you're new to all this (especially if you're new to all this), I'd love to hear about your journey with the tool. Found a quirk? Have a suggestion? Or just want to send some good vibes? I'm all ears!

Here's how you can share your thoughts:

  1. GitHub Issues: For more specific feedback or if you've stumbled upon a bug, please open an issue. This helps me track and address them effectively.

  2. GitHub Discussions: If you just want to share your general experience, have a suggestion, or maybe a cool idea for a new feature, jump into the discussions page. It's a more casual space where we can chat.

And if you've had a great experience, consider giving the project a star ⭐. It keeps me motivated and helps others discover it!

Thank you for being awesome! 🌟

Contributions 🆘

Feel free to fork this repository and make your enhancements or improvements. ALL contributions are welcome !

See contributing guide

Related post

Notes

This is just a small thing I coded to help me see my convos in beautiful markdown, in Obsidian (my go-to note-taking app).

I wasn't a fan of the clunky, and sometimes paid, browser extensions.

I'm working on automating it to add new conversations and updating old ones. Had some luck with a JavaScript bookmarklet, still ironing it out tho. Shouldn't take long.

See TODO for more info on what I'm working on. Feel free to contribute :)

for an older version with no external dependencies (no virtual environment needed), see https://github.com/mohamed-chs/chatgpt-history-export-to-md/tree/fe13a701fe8653c9f946b1e12979ce3bfe7104b8.

About

A script to effortlessly extract your entire ChatGPT data export from JSON files to nicely-formatted markdown files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 77.5%
  • Jupyter Notebook 12.1%
  • JavaScript 10.4%