Import ChatGPT conversations into a SQLite database
Project description
chatgpt-to-sqlite
Import ChatGPT conversations into a SQLite database
Installation
Install this tool using pip
:
pip 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:
python -m chatgpt_to_sqlite --help
Export ChatGPT data into a SQLite Data:
chatgpt-to-sqlite path/to/chatGPT_conversations.json chatgpt.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
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
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
File details
Details for the file chatgpt-to-sqlite-0.1.0.tar.gz
.
File metadata
- Download URL: chatgpt-to-sqlite-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edb9e3ebe8a8f13f32206b74939f14cc2c1ac69686e5e74b47a7c6e08d3905da |
|
MD5 | f08c3f64931b42ce82198064ec9d27b5 |
|
BLAKE2b-256 | 8b9183435a44a980c0a3935686f31e0976a2290b826cace08bd34d041fc7b972 |
File details
Details for the file chatgpt_to_sqlite-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: chatgpt_to_sqlite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc11c8b72633bf68eedd79990ab4942f3753e1fb30b48e35e4c6271b9fbd2a58 |
|
MD5 | abc24053d6525c3f15492ee2eb97f1ef |
|
BLAKE2b-256 | 873c4da5197da1f76a5813563af02d7914872d067a066c911a4344cf7949971e |