Skip to main content

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.models module
  • 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otf_api-0.20.0.tar.gz (93.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otf_api-0.20.0-py3-none-any.whl (117.3 kB view details)

Uploaded Python 3

File details

Details for the file otf_api-0.20.0.tar.gz.

File metadata

  • Download URL: otf_api-0.20.0.tar.gz
  • Upload date:
  • Size: 93.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for otf_api-0.20.0.tar.gz
Algorithm Hash digest
SHA256 df342a57dca1eba9f7374e1d204cbe2172cc17da9a9f370f5ceb4b9368ac3bc6
MD5 8e5e5e31cd22bae8eb9142f36d01186e
BLAKE2b-256 d36966929cff97c30c41356ea5751cff905fd2f4570790829c42e14c495743c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for otf_api-0.20.0.tar.gz:

Publisher: python_package.yml on NodeJSmith/otf-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file otf_api-0.20.0-py3-none-any.whl.

File metadata

  • Download URL: otf_api-0.20.0-py3-none-any.whl
  • Upload date:
  • Size: 117.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for otf_api-0.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd36246c4ab182fad7700e09c2b3228dcd3f33fe62b0affd9ec07c6c51a9a727
MD5 95d61070a8b0dd1fd8b8a993170d6397
BLAKE2b-256 459927fc49f27e95e7f4aceaaac412eab453424448a97e969924ddf24ab1830a

See more details on using hashes here.

Provenance

The following attestation bundles were made for otf_api-0.20.0-py3-none-any.whl:

Publisher: python_package.yml on NodeJSmith/otf-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.21.1

2 files

0.21.0

2 files

This release

0.20.0 This release

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.4

2 files

0.15.3

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.3

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.1

2 files

0.12.0

2 files

0.11.1

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page