Skip to content

Commit

Permalink
Merge pull request #57 from NodeJSmith/feature/improve_models
Browse files Browse the repository at this point in the history
Feature/improve models
  • Loading branch information
NodeJSmith authored Oct 14, 2024
2 parents 6345ed7 + 185b04b commit 28b51a4
Show file tree
Hide file tree
Showing 46 changed files with 788 additions and 1,619 deletions.
5 changes: 3 additions & 2 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[tool.bumpversion]
current_version = "0.6.4"
current_version = "0.7.0"

parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<dev_l>dev)(?P<dev>0|[1-9]\\d*))?"

serialize = ["{major}.{minor}.{patch}-{dev_l}{dev}", "{major}.{minor}.{patch}"]
commit = false
commit = true
commit_message = "Bump version: {current_version} → {new_version}"
tag = true
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,3 @@ jobs:

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

# create-release:
# name: Create a release
# environment:
# name: release
# url: https://pypi.org/p/otf-api
# needs: [publish-pypi-dists]
# runs-on: ubuntu-latest
# permissions:
# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

# steps:
# - name: Release
# uses: softprops/action-gh-release@v2
# with:
# generate_release_notes: true
# files: "./dist"
# make_latest: true
163 changes: 0 additions & 163 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install tox ruff
- name: Run tests
run: tox -e ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion examples/challenge_tracker_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

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

USERNAME = os.getenv("OTF_EMAIL")
PASSWORD = os.getenv("OTF_PASSWORD")
Expand Down
15 changes: 6 additions & 9 deletions examples/class_bookings_examples.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import asyncio
import os
from datetime import datetime

from otf_api import Otf
from otf_api.models.responses.bookings import BookingStatus
from otf_api.models.responses.classes import DoW
from otf_api.models.classes import DoW

USERNAME = os.getenv("OTF_EMAIL")
PASSWORD = os.getenv("OTF_PASSWORD")
Expand All @@ -12,10 +12,7 @@
async def main():
otf = otf = Otf(USERNAME, PASSWORD)

resp = await otf.get_member_purchases()
print(resp.model_dump_json(indent=4))

resp = await otf.get_bookings(start_date="2024-06-19", status=BookingStatus.LateCancelled)
resp = await otf.get_bookings(start_date=datetime.today().date())
print(resp.model_dump_json(indent=4))

studios = await otf.search_studios_by_geo(40.7831, 73.9712, distance=100)
Expand All @@ -26,7 +23,7 @@ async def main():
# You can pass a list of studio_uuids or, if you want to get classes from your home studio, leave it empty
# this also takes a start date, end date, and limit - these are not sent to the API, they are used in the
# client to filter the results
classes = await otf.get_classes(studio_uuids, day_of_week=[DoW.tuesday, DoW.thursday, DoW.saturday])
classes = await otf.get_classes(studio_uuids, day_of_week=[DoW.TUESDAY, DoW.THURSDAY, DoW.SATURDAY])

print(classes.classes[0].model_dump_json(indent=4))

Expand Down Expand Up @@ -61,8 +58,8 @@ async def main():

bookings = await otf.get_bookings()

print("Next Upcoming Class:")
print(bookings.bookings[0].model_dump_json(indent=4))
print("Latest Upcoming Class:")
print(bookings.bookings[-1].model_dump_json(indent=4))

"""
{
Expand Down
Loading

0 comments on commit 28b51a4

Please sign in to comment.