Skip to content

Commit

Permalink
Merge pull request #36 from NodeJSmith/feat/clean_up_auth
Browse files Browse the repository at this point in the history
clean up auth and init
  • Loading branch information
NodeJSmith authored Jul 19, 2024
2 parents c2ca78e + 1184ad5 commit 17853a2
Show file tree
Hide file tree
Showing 18 changed files with 530 additions and 301 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.3.0"
current_version = "0.4.0"

parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.(?P<dev>dev)\\d+\\+[-_a-zA-Z0-9]+)?"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pip install otf-api

## Overview

To use the API, you need to create an instance of the `Api` class, providing your email address and password. This will authenticate you with the API and allow you to make requests. When the `Api` object is created it automatically grabs your member details and home studio, to simplify the process of making requests.
To use the API, you need to create an instance of the `Otf` class, providing your email address and password. 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.


See the [examples](./examples) for more information on how to use the API.
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

To use the API, you need to create an instance of the `Api` class, providing your email address and password. This will authenticate you with the API and allow you to make requests. When the `Api` object is created it automatically grabs your member details and home studio, to simplify the process of making requests.
To use the API, you need to create an instance of the `Otf` class, providing your email address and password. 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.

### Data

Expand Down
4 changes: 2 additions & 2 deletions examples/challenge_tracker_examples.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import asyncio
import os

from otf_api import Api
from otf_api import Otf
from otf_api.models.responses import ChallengeType, EquipmentType

USERNAME = os.getenv("OTF_EMAIL")
PASSWORD = os.getenv("OTF_PASSWORD")


async def main():
otf = await Api.create(USERNAME, PASSWORD)
otf = Otf(USERNAME, PASSWORD)

# challenge tracker content is an overview of the challenges OTF runs
# and your participation in them
Expand Down
4 changes: 2 additions & 2 deletions examples/class_bookings_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from collections import Counter

from otf_api import Api
from otf_api import Otf
from otf_api.models.responses.bookings import BookingStatus
from otf_api.models.responses.classes import ClassType

Expand All @@ -11,7 +11,7 @@


async def main():
otf = await Api.create(USERNAME, PASSWORD)
otf = otf = Otf(USERNAME, PASSWORD)

resp = await otf.get_member_purchases()
print(resp.model_dump_json(indent=4))
Expand Down
4 changes: 2 additions & 2 deletions examples/studio_examples.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import asyncio
import os

from otf_api import Api
from otf_api import Otf

USERNAME = os.getenv("OTF_EMAIL")
PASSWORD = os.getenv("OTF_PASSWORD")


async def main():
otf = await Api.create(USERNAME, PASSWORD)
otf = otf = Otf(USERNAME, PASSWORD)

# if you need to figure out what studios are in an area, you can call `search_studios_by_geo`
# which takes latitude, longitude, distance, page_index, and page_size as arguments
Expand Down
4 changes: 2 additions & 2 deletions examples/workout_examples.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import asyncio
import os

from otf_api import Api
from otf_api import Otf

USERNAME = os.getenv("OTF_EMAIL")
PASSWORD = os.getenv("OTF_PASSWORD")


async def main():
otf = await Api.create(USERNAME, PASSWORD)
otf = otf = Otf(USERNAME, PASSWORD)

resp = await otf.get_member_lifetime_stats()
print(resp.model_dump_json(indent=4))
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 21 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "otf-api"
version = "0.3.0"
version = "0.4.0"
description = "Python OrangeTheory Fitness API Client"
authors = ["Jessica Smith <[email protected]>"]
license = "MIT"
Expand All @@ -23,36 +23,37 @@ classifiers = [
[tool.poetry.dependencies]
python = "^3.10"
aiohttp = "3.9.5"
loguru = "0.7.2"
pydantic = "2.7.3"
pycognito = "2024.5.1"
typer = { version = "^0.12.3", extras = ["cli"] }
pendulum = { version = "^3.0.0", extras = ["cli"] }


readchar = { version = "^4.1.0", extras = ["cli"] }
humanize = "^4.9.0"
python-box = "^7.2.0"
inflection = "0.5.*"
loguru = "0.7.2"
pendulum = "^3.0.0"
pint = "0.24.*"
pycognito = "2024.5.1"
pydantic = "2.7.3"
python-box = "^7.2.0"
readchar = "^4.1.0"
typer = "^0.12.3"

[tool.poetry.group.dev.dependencies]
aioresponses = "0.7.6"
black = "^24.4.2"
build = "1.2.1"
bump-my-version = "^0.23.0"
httpx = "^0.27.0"
mypy = "1.10.0"
pre-commit = "3.7.1"
pytest = "8.2.2"
pytest-loguru = "0.4.0"
pytest-asyncio = "0.23.7"
aioresponses = "0.7.6"
tox = "4.15.1"
pytest-cov = "5.0.0"
build = "1.2.1"
pytest-loguru = "0.4.0"
ruff = "0.4.9"
pre-commit = "3.7.1"
mypy = "1.10.0"
tox = "4.15.1"
twine = "5.1.0"
black = "^24.4.2"
httpx = "^0.27.0"
bump-my-version = "^0.23.0"


[tool.poetry.group.docs.dependencies]
griffe-fieldz = "0.1.2"
mike = "2.1.1"
mkdocs = "1.6.0"
mkdocs-autorefs = "1.0.1"
mkdocs-gen-files = "0.5.0"
Expand All @@ -64,10 +65,8 @@ mkdocs-material-extensions = "1.3.1"
mkdocs-section-index = "0.3.9"
mkdocstrings = "0.25.1"
mkdocstrings-python = "1.10.3"
griffe-fieldz = "0.1.2"
mike = "2.1.1"
setuptools = "^70.0.0"
pkginfo = "^1.11.1"
setuptools = "^70.0.0"
virtualenv = "^20.26.2"


Expand Down
8 changes: 4 additions & 4 deletions src/otf_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

from loguru import logger

from .api import Api
from .models.auth import User
from .api import Otf
from .auth import OtfUser

__version__ = "0.3.0"
__version__ = "0.4.0"


__all__ = ["Api", "User"]
__all__ = ["Otf", "OtfUser"]

logger.remove()
logger.add(sink=sys.stdout, level=os.getenv("OTF_LOG_LEVEL", "INFO"))
Loading

0 comments on commit 17853a2

Please sign in to comment.