Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scarvy/chatgpt-to-sqlite
Import ChatGPT conversations into a SQLite database
https://github.com/scarvy/chatgpt-to-sqlite
chatgpt dogsheep openai sqlite
Last synced: 3 months ago
JSON representation
Import ChatGPT conversations into a SQLite database
- Host: GitHub
- URL: https://github.com/scarvy/chatgpt-to-sqlite
- Owner: Scarvy
- License: apache-2.0
- Created: 2024-02-12T21:01:38.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-20T00:17:30.000Z (about 1 year ago)
- Last Synced: 2024-09-23T06:37:24.515Z (5 months ago)
- Topics: chatgpt, dogsheep, openai, sqlite
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chatgpt-to-sqlite
[](https://pypi.org/project/chatgpt-to-sqlite/)
[](https://github.com/Scarvy/chatgpt-to-sqlite/releases)
[](https://github.com/Scarvy/chatgpt-to-sqlite/actions/workflows/test.yml)
[](https://github.com/Scarvy/chatgpt-to-sqlite/blob/master/LICENSE)Import ChatGPT conversations into a SQLite database
## Installation
Install this tool using `pip`:
pip install chatgpt-to-sqlite
## Usage
**Pre-Requisite:**
Open [ChatGPT](https://chat.openai.com/) 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/activateNow install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest