Save data from Mastodon to a SQLite database
  • Python 96.4%
  • Makefile 3.6%
Find a file
2025-06-30 14:06:00 -04:00
.github/workflows 💚 Fix the CI build by upgrading the actions/cache (#28) 2025-06-30 14:06:00 -04:00
mastodon_to_sqlite 📃 #12 — We should only bring down the statuses that don't exist in the SQLite database (#24) 2024-05-28 18:45:31 -04:00
tests 📃 #12 — We should only bring down the statuses that don't exist in the SQLite database (#24) 2024-05-28 18:45:31 -04:00
.gitignore ♻️ Working on improving the code (#4) 2023-03-12 01:35:50 -05:00
LICENSE 📄 Create LICENSE 2023-04-11 18:52:42 -04:00
Makefile Added datasette for testing. 2024-02-05 21:57:47 -05:00
metadata.json Added datasette for testing. 2024-02-05 21:57:47 -05:00
poetry.lock Added datasette for testing. 2024-02-05 21:57:47 -05:00
pyproject.toml 🔖 Releasing version 0.2.1 2024-02-05 21:59:53 -05:00
README.md 📝 Improved authentication documentation (#9) 2023-04-11 17:50:06 -04:00

mastodon-to-sqlite

Save data from Mastodon to a SQLite database.

Install

foo@bar:~$ pip install mastodon-to-sqlite

Authentication

First you will need to create an application on your Mastodon server. You can find that on your Mastodon serer.

foo@bar:~$ mastodon-to-sqlite auth
Mastodon domain: mastodon.social

Create a new application here: https://mastodon.social/settings/applications/new
Then navigate to newly created application and paste in the following:

Your access token: xxx

This will write an auth.json file to your current directory containing your access token and Mastodon domain. Use -a other-file.json to save those credentials to a different location.

That -a option is supported by all other commands.

You can verify your authentication by running mastodon-to-sqlite verify-auth.

Retrieving Mastodon followers

The followers command will retrieve all the details about your Mastodon followers.

foo@bar:~$ mastodon-to-sqlite followers mastodon.db

Retrieving Mastodon followings

The followings command will retrieve all the details about your Mastodon followings.

foo@bar:~$ mastodon-to-sqlite followings mastodon.db

Retrieving Mastodon statuses

The statuses command will retrieve all the details about your Mastodon statuses.

foo@bar:~$ mastodon-to-sqlite statuses mastodon.db

Retrieving Mastodon bookmarks

The bookmarks command will retrieve all the details about your Mastodon bookmarks.

foo@bar:~$ mastodon-to-sqlite bookmarks mastodon.db

Retrieving Mastodon favourites

The favourites command will retrieve all the details about your Mastodon favourites.

foo@bar:~$ mastodon-to-sqlite favourites mastodon.db