mastodon_finder
Mastodon account discovery, enrichment, and LLM-based scoring tool.
This project automates the workflow:
- Discover candidate accounts on Mastodon via keywords, hashtags, profile terms, and "follow what they follow" expansion.
- Enrich each account into a uniform dossier (bio, fields, recent original posts, stats, discovery reasons).
- Apply a stack of deterministic pre-LLM filters (language, activity, link-only, bots, etc.).
- Optionally hand each dossier to an LLM for rubric-based FOLLOW / MAYBE / SKIP decisions.
- Output a human-readable report to the terminal (rich) and optionally to CSV / Markdown.
Install (pipx)
This tool is intended to be used as a CLI. Prefer pipx so that dependencies stay isolated and you can update easily.
# If your package is published or in a local path, do something like:
pipx install mastodon-finder # or: pipx install .
If you are developing locally:
# from repo root
pipx install --editable .
That will expose the mastodon-finder (module: mastodon_finder) entrypoint on your PATH without polluting your global Python.
Quick Start
-
Create a config (once):
mastodon-finder initThis writes
finder.tomland suggests adding it to.gitignore. -
Authenticate to Mastodon (once per account):
mastodon-finder authThis interactive flow will:
- Ask for your instance URL (e.g.
mastodon.social). - Register an app called
mastodon_finderwithreadscope. - Open (print) an authorization URL.
- Ask you to paste back the authorization code.
- Write
MASTODON_BASE_URL=...andMASTODON_ACCESS_TOKEN=...into.env.
- Ask for your instance URL (e.g.
-
Run a discovery/eval pass:
mastodon-finder run --yes
--yesskips the interactive "are you sure" run-summary.
You can override most things from the CLI without editing the TOML.
CLI Overview
The main entrypoint is the package itself:
mastodon-finder [command]
Commands:
init— write a starterfinder.tomlwith reasonable defaults.auth— run interactive OAuth flow and append creds into.env.run(default) — perform discovery → enrichment → filter → (optional) LLM → report.
If you run without a subcommand, it defaults to run.
Pipeline
- Gets your current friend lists
- Finds possible friends by keyword, hashtag, "follows special interest account"
- Remove accounts with bad metrics (inactivity, no original content, etc)
- Ask LLM to grade each candidate on a rubric
- Display "FOLLOW", "MAYBE", "SKIP" report
Features
- Search by keyword, hashtag for post, for account bio
- Search by "followers of an account" as signal of interest, geograph, etc.
- Filters out already followed
- Caching for info about self, e.g. current friends
- Caching for other API calls, e.g. for resuming a failed run
- langdetect for posts
- Filter
- by minimum number of posts - is anyone one home
- post recency - is anyone home now
- original vs retweet - do they write their own content
- original vs all links - is this an RSS feed cross posted to mastodon?
- does the author ever reply to anyone?
- LLM filter
- By static rubric
- Is it the right language?
- Is it the right topic?
- Did it hit all the topics?
- Is there some other unforeseen problem?
- By static rubric
Example Runs
Run with alternative discovery terms:
mastodon-finder run \
--keywords python ai mastodon \
--hashtags fediverse \
--profile-keywords "django" "fastapi" \
--max-accounts 80 \
--max-statuses 120 \
--yes
Run without LLM, just pre-filters and report:
mastodon-finder run --no-llm --yes
Run focused on a single follow-target:
mastodon-finder run \
--follow-targets "@coolconnector@mastodon.social" \
--follow-target-limit 500 \
--yes
How it works: Discovery & Filtering Pipeline
-
Discovery (
discovery.discover_accounts)- Collects IDs and tags them with reasons.
- Important: follow-target expansion can return many accounts, so there is a per-target limit.
-
Enrichment (
enrich.build_dossiers)- Sorts candidates by number of discovery reasons (simple prioritization).
- Stops at
limits.max_accounts. - Produces a clean, LLM-ready, language-aware dossier list.
-
Pre-LLM Filters (
finder._pre_llm_filter)- Activity cutoff (posted within N days).
- Bot flag.
- Language match (or "none").
- Must-have replies.
- Link-only threshold.
- Minimum original posts.
- "Friend full up" (high following/follower + low follow-back ratio).
- Too chatty (posts/year cap).
- Reject bio keywords (e.g. to block crypto/NFT/etc.).
- Non-empty bio.
- Minimum account age.
- Special-case block for
bsky.brid.gyrelays. - Each discard increments a counter, reported at the end.
-
LLM Evaluation (optional)
- Only on the survivors.
- LLM rubric comes from
settings.llm.topicsand the fixed template. - Can be disabled with
--no-llm, in which case all pre-filtered accounts becomeMAYBE.
-
Output
- Rich terminal render with follow URLs normalized to your instance.
- Optional CSV/MD report for offline review.
Environment / Secrets
-
.envis the source of truth for:MASTODON_BASE_URLMASTODON_ACCESS_TOKENOPENROUTER_API_KEY+OPENROUTER_BASE_URL+OPENROUTER_MODEL(optional)OPENAI_API_KEY(optional)
auth will append the Mastodon entries for you. Keep .env out of version control.
Reporting & Exports
- Terminal shows decisions, discovery reasons, first reasoning line, and a follow link rooted at your Mastodon host.
- CSV export makes it easy to sort/filter in spreadsheets.
- Markdown export is human-friendly for PRs or sharing with teammates.
Prior Art
Bad profile search and bad search has been touted as an intentional privacy feature
Directories
Metadata
Release files for mastodon-finder 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mastodon_finder-0.2.0.tar.gz | 30.9 kB | With provenance | Details for mastodon_finder-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mastodon_finder-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for mastodon_finder-0.2.0-py3-none-any.whl |
Total release size: 66.8 kB
Release files / mastodon_finder-0.2.0.tar.gz
| Download URL | mastodon_finder-0.2.0.tar.gz |
|---|---|
| Size | 30.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
303074d2147f3090750dc70be52c4352811e29828656afc1b163d0138e732f0b
|
|
BLAKE2b-256 checksum How to use checksums |
218b70cd6ccabe5ca19f77be7407b35488ab121db6e45e4fef0fab010eb4e6d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2025.
Transparency logRelease files / mastodon_finder-0.2.0-py3-none-any.whl
| Download URL | mastodon_finder-0.2.0-py3-none-any.whl |
|---|---|
| Size | 35.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf29be586256389893dbb3307fb339a96812ac29e750e868b0d7d8e5f954b84b
|
|
BLAKE2b-256 checksum How to use checksums |
eea9b5b9ad41666188efea2dba8eac999c19dd78829a6f9c6e41e0fa773f8853
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2025.
Transparency logSecurity for mastodon-finder 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mastodon_finder-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.