Save data from Bluesky to a SQLite database https://github.com/myles/bluesky-to-sqlite
  • Python 97.9%
  • Makefile 2.1%
Find a file
2026-05-28 16:34:37 -04:00
.github/workflows chore(ci): 🔧 using min and max python version 2026-05-26 13:42:41 -04:00
src/bluesky_to_sqlite feat(likes): adds support for archiving likes 2026-05-28 16:27:59 -04:00
tests feat(likes): adds support for archiving likes 2026-05-28 16:27:59 -04:00
.gitignore feat: saving follows and followers to the database 2026-05-25 14:28:07 -04:00
.python-version feat: 🎉 First commit of the bluesky-to-sqlite project! 2026-05-25 13:25:01 -04:00
LICENSE feat: 🎉 First commit of the bluesky-to-sqlite project! 2026-05-25 13:25:01 -04:00
Makefile chore: adds some tests 2026-05-26 13:23:59 -04:00
pyproject.toml feat(likes): adds support for archiving likes 2026-05-28 16:27:59 -04:00
README.md chore(likes): 📝 adds some docs about the like command 2026-05-28 16:34:37 -04:00
uv.lock feat(likes): adds support for archiving likes 2026-05-28 16:27:59 -04:00

bluesky-to-sqlite

Save data from your Bluesky account to a SQLite database.

Part of the Dogsheep family of *-to-sqlite tools, built on sqlite-utils.

Warning

This tool is in early development and has a limited feature set. Use at your own risk. The database schema is subject to change without warning.

Usage

Install the package

Right now, this package isn't published to PyPI, so you'll need to install it directly from GitHub. You can do this with pip or pipx.

Install with pip:

pip install git+https://github.com/myles/bluesky-to-sqlite.git

or with pipx:

pipx install git+https://github.com/myles/bluesky-to-sqlite.git

Authenticate with Bluesky

Before you can pull any data, you need to authenticate with your PDS (Personal Data Server). You'll provide your PDS URL, your username, and an app password — not your account password.

Run:

$ bluesky-to-sqlite auth
Please enter your Bluesky authentication credentials.
PDS URL (e.g. https://bsky.social) [https://bsky.social]: https://pds.witchcraft.systems
Username (email or handle): myles.garden
To generate an app password, go to https://bsky.app/settings/app-passwords and create a new app password. Use that password here.
App password (https://bsky.app/settings/app-passwords):
Authenticating with Bluesky...
Authentication successful!
Authentication credentials saved to auth.json

This writes your credentials to auth.json in the current directory. If that file already exists, you'll be asked whether to overwrite it.

The data commands below read auth.json from the current directory, so run them from the same place — or see --help to point at a different path.

Save data to SQLite

There are a few different commands for pulling data out of your Bluesky account. Each takes a path to the SQLite database to write to, which will be created if it doesn't already exist:

bluesky-to-sqlite <command> bluesky.db

Posts you liked

Save the posts you have liked:

bluesky-to-sqlite likes bluesky.db

Accounts you are following

Save the accounts you follow into a following table:

bluesky-to-sqlite follows bluesky.db

Accounts that are following you

Save the accounts that follow you into a followers table:

bluesky-to-sqlite followers bluesky.db