Skip to main content

chatgpt-to-sqlite

PyPI Changelog License

Import ChatGPT conversations into a SQLite database

Installation

The easiest way to use this tool is to install it using uv:

uvx chatgpt-to-sqlite conversations.json chat.db

Or, you can install it as a tool:

uv tool install chatgpt-to-sqlite

Usage

Pre-Requisite:

Open ChatGPT and navigate to your account settings.

Click "Data Controls and then "Export" under "Export data".

For help, run:

chatgpt-to-sqlite --help

You can also use:

chatgpt_to_sqlite --help

Export ChatGPT data into a SQLite Data:

chatgpt-to-sqlite path/to/chatGPT_conversations.json chat.db

Database Schema:

CREATE TABLE [conversations] (
    [chat_id] TEXT PRIMARY KEY,
    [title] TEXT,
    [create_time] TEXT,
    [update_time] TEXT
);
CREATE TABLE "messages" (
    [message_id] TEXT PRIMARY KEY,
    [sender] TEXT,
    [create_time] TEXT,
    [status] TEXT,
    [weight] FLOAT,
    [text] TEXT,
    [model] TEXT,
    [chat_id] TEXT REFERENCES [conversations]([chat_id])
);

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd chatgpt-to-sqlite
uv sync --dev

To run the tests:

pytest

Metadata

Release files for chatgpt-to-sqlite 1.0.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 chatgpt-to-sqlite 1.0.0
File Size Uploaded
chatgpt_to_sqlite-1.0.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chatgpt-to-sqlite 1.0.0
File Interpreter ABI Platform
chatgpt_to_sqlite-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / chatgpt_to_sqlite-1.0.0.tar.gz

Download URL chatgpt_to_sqlite-1.0.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7656b4c7c8c7398c7c8fc3718ad8eb98b6f15029e426ebf43a8a997fdc76cdac
BLAKE2b-256 checksum
How to use checksums
2fb97587350aff9da35636dc872e62e3d8ec863660f76ef90695384e8747c487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release files / chatgpt_to_sqlite-1.0.0-py3-none-any.whl

Download URL chatgpt_to_sqlite-1.0.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec68672b9bced8d3d3bcd36810a103967229f543d80ba66714740297c19c9d83
BLAKE2b-256 checksum
How to use checksums
1988ea14b7b3927d5478049317ce54d751f4d0711d1b6974ea423957c4c55f4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

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