Skip to content

Repository files navigation

Saturday Python SDK

PyPILicense: MIT

Official Python SDK for the Saturday Nutrition Intelligence API.

Personalized fuel, hydration, and electrolyte prescriptions for endurance athletes.

Install

pip install saturday

Quick Start

fromsaturdayimportSaturdayclient=Saturday(api_key="sk_live_...")
# Calculate a nutrition prescriptionprescription=client.nutrition.calculate(
activity_type="bike",
duration_min=180,
athlete_weight_kg=75,
thermal_stress_level=7,
is_race=True,
)
# Safety metadata is ALWAYS included — athlete safety is never paywalledprint(prescription["safety"]["warnings"])
print(f"Carbs: {prescription['carb_g_per_hr']} g/hr")
print(f"Sodium: {prescription['sodium_mg_per_hr']} mg/hr")
print(f"Fluid: {prescription['fluid_ml_per_hr']} mL/hr")

Features

  • Fully typed with py.typed marker (PEP 561)
  • Automatic retry with exponential backoff (429s and 5xx)
  • Typed errors (AuthenticationError, RateLimitError, ValidationError, NotFoundError)
  • API key and OAuth2 Bearer token authentication
  • Context manager support for clean connection handling
  • Safety types prominently surfaced (not_instructions documented)

Authentication

# API key (server-to-server)client=Saturday(api_key="sk_live_...")
# OAuth2 Bearer token (athlete-delegated access)client=Saturday(api_key="sk_live_...", bearer_token="eyJ...")
# Context manager for automatic cleanupwithSaturday(api_key="sk_live_...") asclient:
rx=client.nutrition.calculate(activity_type="run", duration_min=60)

Error Handling

fromsaturdayimportSaturday, RateLimitError, ValidationError, NotFoundErrorclient=Saturday(api_key="sk_live_...")
try:
rx=client.nutrition.calculate(activity_type="swim", duration_min=60)
exceptValidationErrorase:
print(f"Invalid request: {e} (param: {e.param})")
exceptRateLimitErrorase:
print(f"Rate limited. Retry after {e.retry_after}s")
exceptNotFoundError:
print("Resource not found")

Resources

ResourceDescription
client.nutritionCalculate prescriptions, batch calculate
client.athletesAthlete CRUD, settings, batch create, GDPR export
client.activitiesActivity CRUD, prescription calculation, feedback
client.productsProduct search, barcode lookup, curated list
client.aiAI coaching conversations
client.webhooksWebhook registration and management
client.organizationsTeam/org management with members
client.gearAthlete gear inventory
client.knowledgeSports nutrition knowledge base search

Documentation

Full API documentation: docs.saturday.fit

Requirements

  • Python 3.9+
  • httpx 0.25+

License

MIT

About

Official Python SDK for the Saturday Nutrition Intelligence API

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages