Skip to main content

A fun and easy-to-use command-line application that converts GPT chat sessions into beautifully formatted Markdown files.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chattermark-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

chattermark-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file chattermark-0.1.0.tar.gz.

File metadata

  • Download URL: chattermark-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for chattermark-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b407606e693dbbfec5c5ab8feb8103d244e80fd0e7e7a48213b290b19bbf3a6c
MD5 d813fdb67989b7f2ae699b94de9569a4
BLAKE2b-256 e8ea6de5fa6d3f9112d11674b8e23fc4f4a5e05ab87b847fd541e7f706740971

See more details on using hashes here.

File details

Details for the file chattermark-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chattermark-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for chattermark-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e38895816bed8aa272a58d668a881fa2205b52a571966a5f0639951963e5498c
MD5 a9741832d89375f1a07f4be2f23797bc
BLAKE2b-256 80799bdd9e80ad40a413f5b15270d116d186565ef1c1998ab87d1a5e7991bfa5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page