Import ChatGPT conversations into a SQLite database
Project description
chatgpt-to-sqlite
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chatgpt_to_sqlite-1.0.0.tar.gz.
File metadata
- Download URL: chatgpt_to_sqlite-1.0.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7656b4c7c8c7398c7c8fc3718ad8eb98b6f15029e426ebf43a8a997fdc76cdac
|
|
| MD5 |
3fa27b01da03d13f37d0575d01fb1206
|
|
| BLAKE2b-256 |
2fb97587350aff9da35636dc872e62e3d8ec863660f76ef90695384e8747c487
|
File details
Details for the file chatgpt_to_sqlite-1.0.0-py3-none-any.whl.
File metadata
- Download URL: chatgpt_to_sqlite-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec68672b9bced8d3d3bcd36810a103967229f543d80ba66714740297c19c9d83
|
|
| MD5 |
8aeb3d2ad53601c7b751ded973c30bb0
|
|
| BLAKE2b-256 |
1988ea14b7b3927d5478049317ce54d751f4d0711d1b6974ea423957c4c55f4e
|