Posts a random adoptable pet from the Boston MSPCA to different social media feeds.
It should be easily extendable to other shelters and social media feeds for various locations.
This Project runs on github actions and runs periodically.
On macOS or Linux, use the standalone installer:
curl -LsSf https://astral.sh/uv/install.sh | shAlternatively, if you use Homebrew:
brew install uvOn Windows, run this in PowerShell:
winget install --id=astral-sh.uv -eOpen a new terminal after installation and verify that uv is available:
uv --versionSee the official uv installation guide for other installation methods.
From the repository root, install the locked development environment:
make installIf Make is unavailable (for example, in Windows PowerShell), run:
uv sync --locked --dev
git config core.hooksPath .githooksThe --dev flag explicitly includes development tools such as Ruff, Pyright, and pytest.
Run Git directly: it does not need the Python environment managed by uv run.
The pre-commit hook calls make format, which runs Ruff through uv run.
uv manages .venv and uses Python 3.14 from .python-version. No environment activation is needed.
The Make targets use --locked to reject stale lockfiles.
Add runtime dependencies with uv add PACKAGE and development tools with
uv add --dev PACKAGE. Commit both pyproject.toml and uv.lock after dependency
changes. Use uv lock after editing dependency declarations manually.
make lint: run Ruff lint checks, check formatting, and run Pyright.make format: sort imports and format Python files with Ruff.make test: run the pytest suite. The live API test is skipped unlessCUTEPETSBOSTON_RESCUEGROUPS_API_KEYis set.
Pyright starts in basic mode. Ruff and Pyright exclude vendored code.
Required:
CUTEPETSBOSTON_RESCUEGROUPS_API_KEY
Optional for Instagram posting:
INSTAGRAM_BUSINESS_ACCOUNT_ID(orINSTAGRAM_TEST_BUSINESS_ACCOUNT_ID)INSTAGRAM_PAGE_ACCESS_TOKEN(orINSTAGRAM_TEST_PAGE_ACCESS_TOKEN)
Optional for Bluesky posting:
BLUESKY_HANDLE(orBLUESKY_TEST_HANDLE)BLUESKY_PASSWORD(orBLUESKY_TEST_PASSWORD)
Optional for Mastodon posting:
MASTODON_TOKEN(map this to the appropriate production or test-account secret in the runtime environment)MASTODON_API_BASE_URL(defaults tohttps://mastodon.social)
Optional platform selection:
POSTER_PLATFORMSto limit posting to specific platforms, for examplemastodonorbluesky,mastodon
main.py: orchestrates fetching pets and publishing posts.abstractions.py: shared interfaces and data models.source_*.py: pet source implementations (ingest from APIs).poster_*.py: social media poster implementations.manually_test_post.py: CLI for manual posting with sample data.
uv run --locked python main.py --debugsources --debugposters
To run only the Mastodon poster locally or in GitHub Actions:
POSTER_PLATFORMS=mastodon uv run --locked python main.py
This project was originally started by Becky Boone and Drew during their fellowship at Code for America in 2014.
- CutePetsDenver