Beeminder Client
A powerful Python client library and terminal interface for Beeminder. This package provides both a programmatic API client for building Beeminder applications and a feature-rich terminal interface for managing your Beeminder goals directly from the command line.
Features
- Complete API Coverage: Full implementation of the Beeminder API with type hints
- Interactive Terminal Interface: Curses-based UI for managing goals and datapoints
- Type-Safe: Built with Pydantic models for reliable data handling
- Easy to Use: Simple interface for both programmatic and terminal usage
Installation
Install from PyPI:
pip install beeminder_client
Configuration
The client requires a Beeminder API key and optionally your username. These can be set via environment variables:
export BEEMINDER_API_KEY="your-api-key-here"
export BEEMINDER_USERNAME="your-username" # Optional
To get your API key:
- Log into Beeminder
- Go to https://www.beeminder.com/api/v1/auth_token.json
Using the Terminal Interface
Start the terminal interface:
beeminder-cli
Terminal Controls
- Navigation:
↑/↓: Navigate through goalsi: View detailed information for selected goalb: Go back to goal list from detail viewr: Refresh goal datac: Create new datapoint for selected goalw: Open goal in web browserq: Quit application
Adding Datapoints
- Select a goal using arrow keys
- Press
cto create new datapoint - Enter value when prompted
- Optionally add a comment
- Press Enter to submit
Using the API Client
from beeminder_client.beeminder import BeeminderAPI
# Initialize client
client = BeeminderAPI(api_key="your-api-key", default_user="username")
# Get all goals
goals = client.get_all_goals()
# Get specific goal with datapoints
goal = client.get_goal("goal-slug", datapoints=True)
# Create datapoint
client.create_datapoint(
goal_slug="goal-slug",
value=1.0,
comment="Added via API"
)
Program Design
The project is structured into three main components:
1. API Client (beeminder.py)
- Handles all HTTP communication with Beeminder's API
- Provides type-safe methods for all API endpoints
- Uses requests for HTTP operations
- Implements error handling and response validation
2. Data Models (models.py)
- Pydantic models for type safety and validation
- Represents Beeminder entities (Goals, Datapoints, etc.)
- Handles data parsing and serialization
- Provides clear structure for API responses
3. Terminal Interface (beeminder_cli.py)
- Built with Python's curses library
- Implements Model-View pattern:
BeeminderCLI: Main controller classInputWindow: Helper class for user input
- Features:
- Two-panel interface (list and detail views)
- Efficient navigation and data entry
- Real-time updates and feedback
- Browser integration
Architecture Decisions
- Type Safety: Using Pydantic models ensures reliable data handling and provides excellent IDE support.
- Separation of Concerns: Clear separation between API client, data models, and UI.
- Error Handling: Comprehensive error handling in both API and UI layers.
- User Experience: Terminal interface designed for efficiency and ease of use.
- Extensibility: Easy to extend with new features or integrate into other applications.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
MIT
Acknowledgments
- Built using the Beeminder API
- Inspired by the need for a better command-line interface for Beeminder
Metadata
Release files for beeminder-client 0.1.5
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 |
|---|---|---|---|---|
| beeminder_client-0.1.5.tar.gz | 13.5 kB | Without provenance | Details for beeminder_client-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| beeminder_client-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for beeminder_client-0.1.5-py3-none-any.whl |
Total release size: 26.2 kB
Release files / beeminder_client-0.1.5.tar.gz
| Download URL | beeminder_client-0.1.5.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4a38fef8483429e79cf0e3024be824d20c08b080d782f59415b97fc2d405aa3
|
|
BLAKE2b-256 checksum How to use checksums |
188664940e3ee9c056fb7e28c2559f263634632665d98fb9f40f87ef94733ff2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / beeminder_client-0.1.5-py3-none-any.whl
| Download URL | beeminder_client-0.1.5-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7508b4dd0486672254c3f8e500b90cb7e11d068ad94a97219a6da85876add835
|
|
BLAKE2b-256 checksum How to use checksums |
8ac4dc7cb719f3c820bd1aad00b6c30692e40feef37f40ef2e43bd5825fb68d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Security for beeminder-client 0.1.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.