Skip to main content

ChatterMark 💬📝✨

Chattermark is a CLI tool that converts GPT chat sessions to a Markdown format, making it easier for you to read, share, or archive your chat sessions. It parses JSON data extracted from a GPT chat session and generates a neat and well-formatted Markdown file.

Installation

pip install chattermark

Usage

chattermark input.json output.md

Input

Your input should be a JSON file containing a chat session with a GPT model. The JSON structure should match the GPTChatSession Pydantic model in the code.

Output

Chattermark will generate a Markdown file with a chronological and easy-to-read representation of the chat session. The output will show user and assistant messages, along with timestamps.

Example

Suppose you have the following JSON data in a file called input.json:

{
    "title": "dev(python/chattermark): convert chat GPT sessions to markdown",
    "create_time": 1681444192.748429,
    "update_time": 1681446704.0,
    "mapping": {
        ...
    }
}

Run Chattermark:

chattermark input.json output.md

The generated output.md will look like this:

**2023-04-13 15:30:52 - User:**

Please define a pydantic model for a json representation of a chat GPT session as extracted from a Chrome browser session using the developer tools.

_**2023-04-13 15:31:53 - Assistant:**_

> To create a Pydantic model for a JSON representation of a chat GPT session extracted from a Chrome browser session using the developer tools, you'll first need to identify the data structure and fields in the JSON. ...

---

...

Converting Markdown to Other Formats

Chattermark generates a Markdown output, which is a versatile and widely supported format. However, you might want to convert the Markdown output to other formats like Word documents, HTML, or PDF. To do this, you can use a tool called Pandoc.

  1. Install Pandoc following the official installation guide.

  2. Run Pandoc to convert the Markdown file to your desired format. For example:

    • To convert the Markdown file to an HTML file:

      pandoc output.md -o output.html
      
    • To convert the Markdown file to a Word document:

      pandoc output.md -o output.docx
      
    • To convert the Markdown file to a PDF file:

      pandoc output.md -o output.pdf
      

Check the Pandoc User's Guide for more information on available output formats and options.

License

ChatterMark is released under the MIT License.

Credits

ChatterMark was created by an enthusiastic team of an AI and a developer developers who believe that fun and productivity can go hand in hand! We hope you enjoy using ChatterMark as much as we enjoyed creating it.

Metadata

Release files for chattermark 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chattermark 0.1.0
File Size Uploaded
chattermark-0.1.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chattermark 0.1.0
File Interpreter ABI Platform
chattermark-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / chattermark-0.1.0.tar.gz

Download URL chattermark-0.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b407606e693dbbfec5c5ab8feb8103d244e80fd0e7e7a48213b290b19bbf3a6c
BLAKE2b-256 checksum
How to use checksums
e8ea6de5fa6d3f9112d11674b8e23fc4f4a5e05ab87b847fd541e7f706740971
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / chattermark-0.1.0-py3-none-any.whl

Download URL chattermark-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e38895816bed8aa272a58d668a881fa2205b52a571966a5f0639951963e5498c
BLAKE2b-256 checksum
How to use checksums
80799bdd9e80ad40a413f5b15270d116d186565ef1c1998ab87d1a5e7991bfa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page