Skip to main content

Convert a Claude.ai export to SQLite

Project description

claude-to-sqlite

PyPI Changelog Tests License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_to_sqlite-0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

claude_to_sqlite-0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for claude_to_sqlite-0.1.tar.gz
Algorithm Hash digest
SHA256 927a64177750d1aed5dbf961a778abba54b2598d644d7dce7030c2401568e0e9
MD5 c9eb840f59c44ca2b9e3c5633f996406
BLAKE2b-256 51ef2ba97e3e5d1dc363a5ef8cbaceab224f3ee046b564ee1a523ab8834f0c95

See more details on using hashes here.

File details

Details for the file claude_to_sqlite-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_to_sqlite-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7682e5245df7b196c7590a55e7fbf1ac0a7bd55c01e7d675aecd7614786ff061
MD5 4224fad434dd49467368443e60ba0f80
BLAKE2b-256 dd7892a115458448e3a745e9393bf790499744b0b61edd0ebb098905b5de351c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page