Python OrangeTheory Fitness API Client
Project description
Simple API client for interacting with the OrangeTheory Fitness APIs.
Review the documentation.
This library allows access to the OrangeTheory API to retrieve workouts and performance data, class schedules, studio information, and bookings.
Installation
pip install otf-api
Overview
To use the API, you need to create an instance of the Otf class. This will authenticate you with the API and allow you to make requests. When the Otf object is created it automatically grabs your member details and home studio, to simplify the process of making requests.
You can either pass an OtfUser object to the OtfClass or you can pass nothing and allow it to prompt you for your username and password.
You can also export environment variables OTF_EMAIL and OTF_PASSWORD to get these from the environment.
from otf_api import Otf, OtfUser
otf = Otf()
# OR
otf = Otf(user=OtfUser(<email_address>,<password>))
OpenAPI Schema
This library generates OpenAPI 3.0.3 schema files from its Pydantic models, providing a machine-readable representation of the API structure and data models. These schemas are automatically generated during the build process and are available as build artifacts.
What's Generated
The OpenAPI schema includes:
- All public Pydantic models from the
otf_api.modelsmodule - Complete type definitions with field descriptions and constraints
- Nested model references and relationships
- Both YAML (
openapi.yaml) and JSON (openapi.json) formats
Why It's Generated
The OpenAPI schema serves as a contract for other language implementations and tools:
- TypeScript Implementation: Used by mphuff/otf-api-ts to generate type-safe TypeScript clients
- API Documentation: Provides machine-readable API documentation
- Code Generation: Enables automatic code generation for other programming languages
- Integration Tools: Supports IDE integrations and API testing tools
Generating the Schema
To generate the OpenAPI schema locally:
# Install dependencies
uv sync
# Generate schema
uv run python scripts/generate_openapi.py
The schema files will be created in the schema/ directory:
schema/openapi.yaml- YAML format (recommended for readability)schema/openapi.json- JSON format (recommended for tooling)
Schema Structure
The generated schema follows OpenAPI 3.0.3 specification with:
- Info: API metadata and version information
- Components/Schemas: All Pydantic models as reusable schema definitions
- Field Names: Uses snake_case field names to match Python usage
- Type References: Properly resolved nested model references
The schema represents the complete structure of public API objects documented in the user documentation, making it easy to build compatible clients in other languages.
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 otf_api-0.19.0.tar.gz.
File metadata
- Download URL: otf_api-0.19.0.tar.gz
- Upload date:
- Size: 91.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a5ea2ea30ef4c72cae43c3ff15b9692a782f944f5852c439d09053eaaf12d2e
|
|
| MD5 |
04fef4d656b03d37cacf881136495abf
|
|
| BLAKE2b-256 |
1b1ef0aa2b9be5563e7a195abb5f2a0ca9ee5ecbc1b9ac7133afb7937d637cc9
|
Provenance
The following attestation bundles were made for otf_api-0.19.0.tar.gz:
Publisher:
python_package.yml on NodeJSmith/otf-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
otf_api-0.19.0.tar.gz -
Subject digest:
4a5ea2ea30ef4c72cae43c3ff15b9692a782f944f5852c439d09053eaaf12d2e - Sigstore transparency entry: 1500967515
- Sigstore integration time:
-
Permalink:
NodeJSmith/otf-api@56f79978300cbdec4c595c41c97fd6a36ba955e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NodeJSmith
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_package.yml@56f79978300cbdec4c595c41c97fd6a36ba955e8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file otf_api-0.19.0-py3-none-any.whl.
File metadata
- Download URL: otf_api-0.19.0-py3-none-any.whl
- Upload date:
- Size: 113.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2bdde28c9b1162ed770df8f8b4960aae4eb6013ae1067bd36ad1b106c01ff05
|
|
| MD5 |
c03ad677e801e0833dd7c99d2611893e
|
|
| BLAKE2b-256 |
e0935d6f693fd890b4dc8437aa12368d33aea084fc4b92d314fb31a6a0a0f71a
|
Provenance
The following attestation bundles were made for otf_api-0.19.0-py3-none-any.whl:
Publisher:
python_package.yml on NodeJSmith/otf-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
otf_api-0.19.0-py3-none-any.whl -
Subject digest:
d2bdde28c9b1162ed770df8f8b4960aae4eb6013ae1067bd36ad1b106c01ff05 - Sigstore transparency entry: 1500967548
- Sigstore integration time:
-
Permalink:
NodeJSmith/otf-api@56f79978300cbdec4c595c41c97fd6a36ba955e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/NodeJSmith
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_package.yml@56f79978300cbdec4c595c41c97fd6a36ba955e8 -
Trigger Event:
workflow_dispatch
-
Statement type: