A library to query data about a Bird Buddy smart bird feeder
Project description
pybirdbuddy
pybirdbuddy is an asynchronous Python client for the undocumented GraphQL
API behind the Bird Buddy smart bird feeder. Sign in with a Bird Buddy account
to read your feeders and their state, browse your collections and media, and
finish the "postcard" sightings the feeder captures.
It is an unofficial client for an undocumented API that can change without notice, and is not affiliated with or endorsed by Bird Buddy.
Installation
pip install pybirdbuddy
Python 3.10–3.14 is supported.
Usage
import asyncio
import pprint
from birdbuddy.client import BirdBuddy
bb = BirdBuddy("user@email.com", "Pa$$w0rd")
# Using coroutines with async/await:
async def async_test():
await bb.refresh()
pprint.pprint(bb.feeders)
# Without async/await, including from a top-level module:
result = asyncio.run(bb.refresh())
pprint.pprint(result)
pprint.pprint(bb.feeders)
Note: only password login is supported currently. Google and other SSOs are not supported. If you've already set up your Bird Buddy with SSO, one option could be to register a new account with a password, and then redeem an invite code to your Bird Buddy under the new account. Some fields will be missing (such as firmware versions and off-grid status).
The feeders property will be an array of feeders with the following fields:
fragment ListFeederFields on FeederForPrivate {
battery {
charging # Boolean
percentage # Int (93)
state # String (enum: "HIGH")
}
food {
state # String (enum: "LOW")
}
id # String (UUID)
name # String
signal {
state # String (enum: "HIGH")
value # Int (rssi: -41)
}
state # String (enum: "READY_TO_STREAM")
temperature {
value # Int
}
}
Translations
API responses can return translated strings by setting the client's
language_code property. Language codes are parsed using
langcodes.
from birdbuddy.client import BirdBuddy
async def main():
bb = BirdBuddy("user@email.com", "Pa$$w0rd")
bb.language_code = "de"
collections = await bb.refresh_collections()
birds = [c.species.name for c in collections.values()]
print(birds)
Development
Install pyenv and the pinned interpreter, then use the Makefile — every target runs inside the project venv automatically:
pyenv install 3.10.20 # matches .python-version
make deps # create the venv and install the [dev] extra
make test # ruff + ruff format --check + markdownlint + pyright + pytest
make check # alias for `make test`
make format # auto-fix ruff issues and reformat
make schema # refresh schema.json from the live API
Alternatively, install the tooling into an existing environment with
pip install -e '.[dev]'.
Releasing
The package is published to PyPI. To cut a release:
- Bump
versioninpyproject.toml(if needed). make build— build the sdist and wheel intodist/.make publish— rebuild, runtwine check, then upload to PyPI.
make publish uses Twine, which reads credentials from ~/.pypirc or the
TWINE_USERNAME / TWINE_PASSWORD environment variables; use __token__ as
the username and a PyPI API token (the value includes its pypi- prefix) as
the password.
License
Released under the MIT No Attribution license (MIT-0).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybirdbuddy-0.0.21.tar.gz.
File metadata
- Download URL: pybirdbuddy-0.0.21.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19e6a1f3991059d75b6df1af6a59f590691108ff93b2aaaa39c6e1ecf94a4e89
|
|
| MD5 |
d571eeb61624d834205a633a76358a7f
|
|
| BLAKE2b-256 |
a88652bb9341a16b03e99678780daf0d55662b9e294018259178eac5c9b85624
|
File details
Details for the file pybirdbuddy-0.0.21-py3-none-any.whl.
File metadata
- Download URL: pybirdbuddy-0.0.21-py3-none-any.whl
- Upload date:
- Size: 29.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c07a4d81a68f4bb3e1e73a534c8631f6442b2654adeab643561b91d9e6ac0abf
|
|
| MD5 |
9bcdc0c3642a5eb3fb0a13eb14cd1de7
|
|
| BLAKE2b-256 |
f09227d23ff975f12f76738f3e0aebf7a17ef0728d6d00f83c88222f37490eed
|