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.
- 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
Install from PyPI:
pip install beeminder_clientThe 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" # OptionalTo get your API key:
- Log into Beeminder
- Go to https://www.beeminder.com/api/v1/auth_token.json
Start the terminal interface:
beeminder-cli- 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
- Select a goal using arrow keys
- Press
cto create new datapoint - Enter value when prompted
- Optionally add a comment
- Press Enter to submit
from src.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"
)The project is structured into three main components:
- 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
- Pydantic models for type safety and validation
- Represents Beeminder entities (Goals, Datapoints, etc.)
- Handles data parsing and serialization
- Provides clear structure for API responses
- 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
- 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.
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.
MIT
- Built using the Beeminder API
- Inspired by the need for a better command-line interface for Beeminder