Convert a Claude.ai export to SQLite
Project description
claude-to-sqlite
Convert a Claude.ai export to SQLite
Installation
Install this tool using pip
:
pip install claude-to-sqlite
Usage
Start by exporting your Claude data. You will be emailed a link to a zip file (though it may be missing the .zip
extension).
Run the command like this:
claude-to-sqlite claude-export.zip claude.db
Now claude.db
will be a SQLite containing the conversations
and messages
from your Claude export.
You can explore that using Datasette:
datasette claude.db
Database schema
Assuming the Claude export JSON has not changed since this tool was last released on 20th October 2024 the database tables should look like this:
CREATE TABLE [conversations] (
[uuid] TEXT PRIMARY KEY,
[name] TEXT,
[created_at] TEXT,
[updated_at] TEXT,
[account_id] TEXT
);
CREATE TABLE [messages] (
[uuid] TEXT PRIMARY KEY,
[text] TEXT,
[sender] TEXT,
[created_at] TEXT,
[updated_at] TEXT,
[attachments] TEXT,
[files] TEXT,
[conversation_id] TEXT REFERENCES [conversations]([uuid])
);
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd claude-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:
python -m 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 claude_to_sqlite-0.1.tar.gz
.
File metadata
- Download URL: claude_to_sqlite-0.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 927a64177750d1aed5dbf961a778abba54b2598d644d7dce7030c2401568e0e9 |
|
MD5 | c9eb840f59c44ca2b9e3c5633f996406 |
|
BLAKE2b-256 | 51ef2ba97e3e5d1dc363a5ef8cbaceab224f3ee046b564ee1a523ab8834f0c95 |
File details
Details for the file claude_to_sqlite-0.1-py3-none-any.whl
.
File metadata
- Download URL: claude_to_sqlite-0.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7682e5245df7b196c7590a55e7fbf1ac0a7bd55c01e7d675aecd7614786ff061 |
|
MD5 | 4224fad434dd49467368443e60ba0f80 |
|
BLAKE2b-256 | dd7892a115458448e3a745e9393bf790499744b0b61edd0ebb098905b5de351c |