diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 1362044..2c65d67 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -2,7 +2,7 @@ language: "en-US" early_access: true reviews: - profile: "pythonic" + profile: "assertive" request_changes_workflow: true high_level_summary: true poem: false @@ -11,11 +11,7 @@ reviews: auto_review: enabled: true drafts: false - auto_fix: - enabled: true - include_imports: true - include_type_hints: true - include_security_fixes: true + path_filters: - "!tests/**/cassettes/**" path_instructions: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6296a24..06f9aba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,8 +61,17 @@ jobs: # pdm run coverage xml # continue-on-error: true + - name: Check for coverage report + id: coverage_check + run: | + if [ -f coverage.xml ]; then + echo "coverage_generated=true" >> "$GITHUB_OUTPUT" + else + echo "coverage_generated=false" >> "$GITHUB_OUTPUT" + fi + - name: Upload coverage artifact - if: matrix.python-version == '3.11' + if: matrix.python-version == '3.11' && steps.coverage_check.outputs.coverage_generated == 'true' uses: actions/upload-artifact@v4 with: name: coverage-xml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8ab43b..170667f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,11 +18,12 @@ repos: - tomli exclude: 'cassettes/' -- repo: https://github.com/psf/black - rev: 24.8.0 - hooks: - - id: black - language_version: python3 +# Removed black - using ruff-format instead to avoid formatting conflicts +# - repo: https://github.com/psf/black +# rev: 24.8.0 +# hooks: +# - id: black +# language_version: python3 - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.6.4 @@ -35,7 +36,7 @@ repos: hooks: - id: mypy name: mypy type checking - entry: .venv/bin/pdm run mypy garminconnect tests + entry: pdm run mypy garminconnect tests types: [python] language: system pass_filenames: false diff --git a/README.md b/README.md index 9caa09e..2e8c825 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ pdm install --group :all ``` **Run Tests:** + ```bash pdm run test # Run all tests pdm run testcov # Run tests with coverage report @@ -232,6 +233,7 @@ pdm run test For package maintainers: **Setup PyPI credentials:** + ```bash pip install twine # Edit with your preferred editor, or create via here-doc: @@ -241,6 +243,7 @@ pip install twine # password = # EOF ``` + ```ini [pypi] username = __token__ @@ -256,11 +259,13 @@ export TWINE_PASSWORD="" ``` **Publish new version:** + ```bash pdm run publish # Build and publish to PyPI ``` **Alternative publishing steps:** + ```bash pdm run build # Build package only pdm publish # Publish pre-built package diff --git a/demo.py b/demo.py index 5a8a3f2..c6f02f0 100755 --- a/demo.py +++ b/demo.py @@ -70,9 +70,7 @@ def __init__(self): # Activity settings self.activitytype = "" # Possible values: cycling, running, swimming, multi_sport, fitness_equipment, hiking, walking, other - self.activityfile = ( - "test_data/sample_activity.gpx" # Supported file types: .fit .gpx .tcx - ) + self.activityfile = "test_data/*.gpx" # Supported file types: .fit .gpx .tcx self.workoutfile = "test_data/sample_workout.json" # Sample workout JSON file # Export settings @@ -1288,37 +1286,42 @@ def get_solar_data(api: Garmin) -> None: def upload_activity_file(api: Garmin) -> None: """Upload activity data from file.""" + import glob + try: - # Default activity file from config - print(f"📤 Uploading activity from file: {config.activityfile}") + # List all .gpx files in test_data + gpx_files = glob.glob(config.activityfile) + if not gpx_files: + print("❌ No .gpx files found in test_data directory.") + print("ℹ️ Please add GPX files to test_data before uploading.") + return - # Check if file exists - import os + print("Select a GPX file to upload:") + for idx, fname in enumerate(gpx_files, 1): + print(f" {idx}. {fname}") - if not os.path.exists(config.activityfile): - print(f"❌ File not found: {config.activityfile}") - print( - "ℹ️ Please place your activity file (.fit, .gpx, or .tcx) under the 'test_data' directory or update config.activityfile" - ) - print("ℹ️ Supported formats: FIT, GPX, TCX") - return + while True: + try: + choice = int(input(f"Enter number (1-{len(gpx_files)}): ")) + if 1 <= choice <= len(gpx_files): + selected_file = gpx_files[choice - 1] + break + else: + print("Invalid selection. Try again.") + except ValueError: + print("Please enter a valid number.") - # Upload the activity - result = api.upload_activity(config.activityfile) + print(f"📤 Uploading activity from file: {selected_file}") - if result: - print("✅ Activity uploaded successfully!") - call_and_display( - api.upload_activity, - config.activityfile, - method_name="upload_activity", - api_call_desc=f"api.upload_activity({config.activityfile})", - ) - else: - print(f"❌ Failed to upload activity from {config.activityfile}") + call_and_display( + api.upload_activity, + selected_file, + method_name="upload_activity", + api_call_desc=f"api.upload_activity({selected_file})", + ) except FileNotFoundError: - print(f"❌ File not found: {config.activityfile}") + print(f"❌ File not found: {selected_file}") print("ℹ️ Please ensure the activity file exists in the current directory") except requests.exceptions.HTTPError as e: if e.response.status_code == 409: @@ -1363,7 +1366,6 @@ def upload_activity_file(api: Garmin) -> None: print(f"❌ Too many requests: {e}") print("💡 Please wait a few minutes before trying again") except Exception as e: - # Check if this is a wrapped HTTP error from the Garmin library error_str = str(e) if "409 Client Error: Conflict" in error_str: print( diff --git a/docs/reference.ipynb b/docs/reference.ipynb index 8b15b9d..662eae0 100644 --- a/docs/reference.ipynb +++ b/docs/reference.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -32,20 +32,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'mtamizi'" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "from getpass import getpass\n", "\n", @@ -67,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -86,20 +75,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'2023-09-19'" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "from datetime import date, timedelta\n", "\n", @@ -110,395 +88,144 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['userProfileId', 'totalKilocalories', 'activeKilocalories', 'bmrKilocalories', 'wellnessKilocalories', 'burnedKilocalories', 'consumedKilocalories', 'remainingKilocalories', 'totalSteps', 'netCalorieGoal', 'totalDistanceMeters', 'wellnessDistanceMeters', 'wellnessActiveKilocalories', 'netRemainingKilocalories', 'userDailySummaryId', 'calendarDate', 'rule', 'uuid', 'dailyStepGoal', 'totalPushDistance', 'totalPushes', 'wellnessStartTimeGmt', 'wellnessStartTimeLocal', 'wellnessEndTimeGmt', 'wellnessEndTimeLocal', 'durationInMilliseconds', 'wellnessDescription', 'highlyActiveSeconds', 'activeSeconds', 'sedentarySeconds', 'sleepingSeconds', 'includesWellnessData', 'includesActivityData', 'includesCalorieConsumedData', 'privacyProtected', 'moderateIntensityMinutes', 'vigorousIntensityMinutes', 'floorsAscendedInMeters', 'floorsDescendedInMeters', 'floorsAscended', 'floorsDescended', 'intensityMinutesGoal', 'userFloorsAscendedGoal', 'minHeartRate', 'maxHeartRate', 'restingHeartRate', 'lastSevenDaysAvgRestingHeartRate', 'source', 'averageStressLevel', 'maxStressLevel', 'stressDuration', 'restStressDuration', 'activityStressDuration', 'uncategorizedStressDuration', 'totalStressDuration', 'lowStressDuration', 'mediumStressDuration', 'highStressDuration', 'stressPercentage', 'restStressPercentage', 'activityStressPercentage', 'uncategorizedStressPercentage', 'lowStressPercentage', 'mediumStressPercentage', 'highStressPercentage', 'stressQualifier', 'measurableAwakeDuration', 'measurableAsleepDuration', 'lastSyncTimestampGMT', 'minAvgHeartRate', 'maxAvgHeartRate', 'bodyBatteryChargedValue', 'bodyBatteryDrainedValue', 'bodyBatteryHighestValue', 'bodyBatteryLowestValue', 'bodyBatteryMostRecentValue', 'bodyBatteryVersion', 'abnormalHeartRateAlertsCount', 'averageSpo2', 'lowestSpo2', 'latestSpo2', 'latestSpo2ReadingTimeGmt', 'latestSpo2ReadingTimeLocal', 'averageMonitoringEnvironmentAltitude', 'restingCaloriesFromActivity', 'avgWakingRespirationValue', 'highestRespirationValue', 'lowestRespirationValue', 'latestRespirationValue', 'latestRespirationTimeGMT'])" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_stats(yesterday).keys()" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['userProfileId', 'totalKilocalories', 'activeKilocalories', 'bmrKilocalories', 'wellnessKilocalories', 'burnedKilocalories', 'consumedKilocalories', 'remainingKilocalories', 'totalSteps', 'netCalorieGoal', 'totalDistanceMeters', 'wellnessDistanceMeters', 'wellnessActiveKilocalories', 'netRemainingKilocalories', 'userDailySummaryId', 'calendarDate', 'rule', 'uuid', 'dailyStepGoal', 'totalPushDistance', 'totalPushes', 'wellnessStartTimeGmt', 'wellnessStartTimeLocal', 'wellnessEndTimeGmt', 'wellnessEndTimeLocal', 'durationInMilliseconds', 'wellnessDescription', 'highlyActiveSeconds', 'activeSeconds', 'sedentarySeconds', 'sleepingSeconds', 'includesWellnessData', 'includesActivityData', 'includesCalorieConsumedData', 'privacyProtected', 'moderateIntensityMinutes', 'vigorousIntensityMinutes', 'floorsAscendedInMeters', 'floorsDescendedInMeters', 'floorsAscended', 'floorsDescended', 'intensityMinutesGoal', 'userFloorsAscendedGoal', 'minHeartRate', 'maxHeartRate', 'restingHeartRate', 'lastSevenDaysAvgRestingHeartRate', 'source', 'averageStressLevel', 'maxStressLevel', 'stressDuration', 'restStressDuration', 'activityStressDuration', 'uncategorizedStressDuration', 'totalStressDuration', 'lowStressDuration', 'mediumStressDuration', 'highStressDuration', 'stressPercentage', 'restStressPercentage', 'activityStressPercentage', 'uncategorizedStressPercentage', 'lowStressPercentage', 'mediumStressPercentage', 'highStressPercentage', 'stressQualifier', 'measurableAwakeDuration', 'measurableAsleepDuration', 'lastSyncTimestampGMT', 'minAvgHeartRate', 'maxAvgHeartRate', 'bodyBatteryChargedValue', 'bodyBatteryDrainedValue', 'bodyBatteryHighestValue', 'bodyBatteryLowestValue', 'bodyBatteryMostRecentValue', 'bodyBatteryVersion', 'abnormalHeartRateAlertsCount', 'averageSpo2', 'lowestSpo2', 'latestSpo2', 'latestSpo2ReadingTimeGmt', 'latestSpo2ReadingTimeLocal', 'averageMonitoringEnvironmentAltitude', 'restingCaloriesFromActivity', 'avgWakingRespirationValue', 'highestRespirationValue', 'lowestRespirationValue', 'latestRespirationValue', 'latestRespirationTimeGMT'])" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_user_summary(yesterday).keys()" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'startGMT': '2023-08-05T06:00:00.0',\n", - " 'endGMT': '2023-08-05T06:15:00.0',\n", - " 'steps': 0,\n", - " 'pushes': 0,\n", - " 'primaryActivityLevel': 'sedentary',\n", - " 'activityLevelConstant': True},\n", - " {'startGMT': '2023-08-05T06:15:00.0',\n", - " 'endGMT': '2023-08-05T06:30:00.0',\n", - " 'steps': 0,\n", - " 'pushes': 0,\n", - " 'primaryActivityLevel': 'sleeping',\n", - " 'activityLevelConstant': False}]" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_steps_data(yesterday)[:2]" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['startTimestampGMT', 'endTimestampGMT', 'startTimestampLocal', 'endTimestampLocal', 'floorsValueDescriptorDTOList', 'floorValuesArray'])" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_floors(yesterday).keys()" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'calendarDate': '2023-08-05',\n", - " 'totalSteps': 17945,\n", - " 'totalDistance': 14352,\n", - " 'stepGoal': 8560}]" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_daily_steps(yesterday, yesterday)" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['userProfilePK', 'calendarDate', 'startTimestampGMT', 'endTimestampGMT', 'startTimestampLocal', 'endTimestampLocal', 'maxHeartRate', 'minHeartRate', 'restingHeartRate', 'lastSevenDaysAvgRestingHeartRate', 'heartRateValueDescriptors', 'heartRateValues'])" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_heart_rates(yesterday).keys()" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['userProfileId', 'totalKilocalories', 'activeKilocalories', 'bmrKilocalories', 'wellnessKilocalories', 'burnedKilocalories', 'consumedKilocalories', 'remainingKilocalories', 'totalSteps', 'netCalorieGoal', 'totalDistanceMeters', 'wellnessDistanceMeters', 'wellnessActiveKilocalories', 'netRemainingKilocalories', 'userDailySummaryId', 'calendarDate', 'rule', 'uuid', 'dailyStepGoal', 'totalPushDistance', 'totalPushes', 'wellnessStartTimeGmt', 'wellnessStartTimeLocal', 'wellnessEndTimeGmt', 'wellnessEndTimeLocal', 'durationInMilliseconds', 'wellnessDescription', 'highlyActiveSeconds', 'activeSeconds', 'sedentarySeconds', 'sleepingSeconds', 'includesWellnessData', 'includesActivityData', 'includesCalorieConsumedData', 'privacyProtected', 'moderateIntensityMinutes', 'vigorousIntensityMinutes', 'floorsAscendedInMeters', 'floorsDescendedInMeters', 'floorsAscended', 'floorsDescended', 'intensityMinutesGoal', 'userFloorsAscendedGoal', 'minHeartRate', 'maxHeartRate', 'restingHeartRate', 'lastSevenDaysAvgRestingHeartRate', 'source', 'averageStressLevel', 'maxStressLevel', 'stressDuration', 'restStressDuration', 'activityStressDuration', 'uncategorizedStressDuration', 'totalStressDuration', 'lowStressDuration', 'mediumStressDuration', 'highStressDuration', 'stressPercentage', 'restStressPercentage', 'activityStressPercentage', 'uncategorizedStressPercentage', 'lowStressPercentage', 'mediumStressPercentage', 'highStressPercentage', 'stressQualifier', 'measurableAwakeDuration', 'measurableAsleepDuration', 'lastSyncTimestampGMT', 'minAvgHeartRate', 'maxAvgHeartRate', 'bodyBatteryChargedValue', 'bodyBatteryDrainedValue', 'bodyBatteryHighestValue', 'bodyBatteryLowestValue', 'bodyBatteryMostRecentValue', 'bodyBatteryVersion', 'abnormalHeartRateAlertsCount', 'averageSpo2', 'lowestSpo2', 'latestSpo2', 'latestSpo2ReadingTimeGmt', 'latestSpo2ReadingTimeLocal', 'averageMonitoringEnvironmentAltitude', 'restingCaloriesFromActivity', 'avgWakingRespirationValue', 'highestRespirationValue', 'lowestRespirationValue', 'latestRespirationValue', 'latestRespirationTimeGMT', 'from', 'until', 'weight', 'bmi', 'bodyFat', 'bodyWater', 'boneMass', 'muscleMass', 'physiqueRating', 'visceralFat', 'metabolicAge'])" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_stats_and_body(yesterday).keys()" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'startDate': '2023-08-05',\n", - " 'endDate': '2023-08-05',\n", - " 'dateWeightList': [],\n", - " 'totalAverage': {'from': 1691193600000,\n", - " 'until': 1691279999999,\n", - " 'weight': None,\n", - " 'bmi': None,\n", - " 'bodyFat': None,\n", - " 'bodyWater': None,\n", - " 'boneMass': None,\n", - " 'muscleMass': None,\n", - " 'physiqueRating': None,\n", - " 'visceralFat': None,\n", - " 'metabolicAge': None}}" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_body_composition(yesterday)" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['date', 'charged', 'drained', 'startTimestampGMT', 'endTimestampGMT', 'startTimestampLocal', 'endTimestampLocal', 'bodyBatteryValuesArray', 'bodyBatteryValueDescriptorDTOList'])" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_body_battery(yesterday)[0].keys()" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'from': '2023-08-05',\n", - " 'until': '2023-08-05',\n", - " 'measurementSummaries': [],\n", - " 'categoryStats': None}" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_blood_pressure(yesterday)" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[]" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_max_metrics(yesterday)" ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'userId': 2591602,\n", - " 'calendarDate': '2023-08-05',\n", - " 'valueInML': 0.0,\n", - " 'goalInML': 3437.0,\n", - " 'dailyAverageinML': None,\n", - " 'lastEntryTimestampLocal': '2023-08-05T12:25:27.0',\n", - " 'sweatLossInML': 637.0,\n", - " 'activityIntakeInML': 0.0}" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_hydration_data(yesterday)" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['userProfilePK', 'calendarDate', 'startTimestampGMT', 'endTimestampGMT', 'startTimestampLocal', 'endTimestampLocal', 'sleepStartTimestampGMT', 'sleepEndTimestampGMT', 'sleepStartTimestampLocal', 'sleepEndTimestampLocal', 'tomorrowSleepStartTimestampGMT', 'tomorrowSleepEndTimestampGMT', 'tomorrowSleepStartTimestampLocal', 'tomorrowSleepEndTimestampLocal', 'lowestRespirationValue', 'highestRespirationValue', 'avgWakingRespirationValue', 'avgSleepRespirationValue', 'avgTomorrowSleepRespirationValue', 'respirationValueDescriptorsDTOList', 'respirationValuesArray'])" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_respiration_data(yesterday).keys()" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['userProfilePK', 'calendarDate', 'startTimestampGMT', 'endTimestampGMT', 'startTimestampLocal', 'endTimestampLocal', 'sleepStartTimestampGMT', 'sleepEndTimestampGMT', 'sleepStartTimestampLocal', 'sleepEndTimestampLocal', 'tomorrowSleepStartTimestampGMT', 'tomorrowSleepEndTimestampGMT', 'tomorrowSleepStartTimestampLocal', 'tomorrowSleepEndTimestampLocal', 'averageSpO2', 'lowestSpO2', 'lastSevenDaysAvgSpO2', 'latestSpO2', 'latestSpO2TimestampGMT', 'latestSpO2TimestampLocal', 'avgSleepSpO2', 'avgTomorrowSleepSpO2', 'spO2ValueDescriptorsDTOList', 'spO2SingleValues', 'continuousReadingDTOList', 'spO2HourlyAverages'])" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_spo2_data(yesterday).keys()" ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'id': 1944943000,\n", - " 'typeId': 16,\n", - " 'activityId': 0,\n", - " 'activityName': None,\n", - " 'activityStartDateTimeInGMT': None,\n", - " 'actStartDateTimeInGMTFormatted': None,\n", - " 'activityStartDateTimeLocal': None,\n", - " 'activityStartDateTimeLocalFormatted': None,\n", - " 'value': 2.0,\n", - " 'prStartTimeGmt': 1691215200000,\n", - " 'prStartTimeGmtFormatted': '2023-08-05T06:00:00.0',\n", - " 'prStartTimeLocal': 1691193600000,\n", - " 'prStartTimeLocalFormatted': '2023-08-05T00:00:00.0',\n", - " 'prTypeLabelKey': None,\n", - " 'poolLengthUnit': None},\n", - " {'id': 2184086093,\n", - " 'typeId': 3,\n", - " 'activityId': 10161959373,\n", - " 'activityName': 'Cuauhtémoc - Threshold',\n", - " 'activityStartDateTimeInGMT': 1671549377000,\n", - " 'actStartDateTimeInGMTFormatted': '2022-12-20T15:16:17.0',\n", - " 'activityStartDateTimeLocal': 1671527777000,\n", - " 'activityStartDateTimeLocalFormatted': '2022-12-20T09:16:17.0',\n", - " 'value': 1413.6650390625,\n", - " 'prStartTimeGmt': 1671549990000,\n", - " 'prStartTimeGmtFormatted': '2022-12-20T15:26:30.0',\n", - " 'prStartTimeLocal': None,\n", - " 'prStartTimeLocalFormatted': None,\n", - " 'prTypeLabelKey': None,\n", - " 'poolLengthUnit': None}]" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_personal_record()[:2]" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[[1695103200000, 'MEASURED', 42, 2.0],\n", - " [1695103380000, 'MEASURED', 42, 2.0],\n", - " [1695103560000, 'MEASURED', 42, 2.0],\n", - " [1695103740000, 'MEASURED', 43, 2.0],\n", - " [1695103920000, 'MEASURED', 43, 2.0],\n", - " [1695104100000, 'MEASURED', 43, 2.0],\n", - " [1695104280000, 'MEASURED', 43, 2.0],\n", - " [1695104460000, 'MEASURED', 44, 2.0],\n", - " [1695104640000, 'MEASURED', 44, 2.0],\n", - " [1695104820000, 'MEASURED', 44, 2.0]]" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "garmin.get_all_day_stress(yesterday)[\"bodyBatteryValuesArray\"][:10]" ] diff --git a/pyproject.toml b/pyproject.toml index 873479f..bad5d20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,9 +84,6 @@ excludes = [ ".github/**", ] -[tool.pdm.python] -path = ".venv/bin/python" - [tool.ruff] line-length = 88 target-version = "py310"