diff --git a/Jupyter/activities.ipynb b/Jupyter/activities.ipynb index 94e8d77..dcc2116 100644 --- a/Jupyter/activities.ipynb +++ b/Jupyter/activities.ipynb @@ -80,14 +80,17 @@ " if activity:\n", " if activity.is_steps_activity():\n", " steps_activity = StepsActivities.get(garmin_act_db, activity.activity_id)\n", - " return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1), steps_activity.avg_pace, format_number(activity.calories)]\n", - " return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1), '', format_number(activity.calories)]\n", + " return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1),\n", + " steps_activity.avg_pace, format_number(activity.calories), format_number(activity.training_load, 1), activity.self_eval_feel, activity.self_eval_effort]\n", + " return [activity.activity_id, activity.name, activity.type, activity.sport, format_number(activity.distance, 1), activity.elapsed_time, format_number(activity.avg_speed, 1), '',\n", + " format_number(activity.calories), format_number(activity.training_load, 1), activity.self_eval_feel, activity.self_eval_effort]\n", " return ['', '', '', '', '', '', '', '', '']\n", "\n", "activities = Activities.get_latest(garmin_act_db, 10)\n", "rows = [__format_activity(activity) for activity in activities]\n", "doc.add_heading(\"Last Ten Activities\", 3)\n", - "doc.add_table(['Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})', f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories'], rows)\n", + "doc.add_table(['Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})',\n", + " f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories', 'Training Load', 'Feel', 'Effort'], rows)\n", "\n", "rows = []\n", "for display_activity in gc_config.display_activities():\n", @@ -98,7 +101,8 @@ " rows.append([f'Longest {name}'] + __format_activity(Activities.get_longest_by_sport(garmin_act_db, display_activity)))\n", "\n", "doc.add_heading(\"Interesting Activities\", 3)\n", - "doc.add_table(['What', 'Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})', f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories'], rows)\n", + "doc.add_table(['What', 'Id', 'Name', 'Type', 'Sport', f'Distance ({distance_units})', 'Elapsed Time', f'Speed ({unit_strings[fitfile.units.UnitTypes.speed]})',\n", + " f'Pace ({unit_strings[fitfile.units.UnitTypes.pace]})', 'Calories', 'Training Load', 'Feel', 'Effort'], rows)\n", "\n", "doc.add_heading(\"Courses\", 3)\n", "courses = Activities.get_col_distinct(garmin_act_db, Activities.course_id)\n", @@ -126,7 +130,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.7" }, "orig_nbformat": 4 }, diff --git a/Jupyter/activity.ipynb b/Jupyter/activity.ipynb index f2c0a7c..fe41213 100644 --- a/Jupyter/activity.ipynb +++ b/Jupyter/activity.ipynb @@ -50,13 +50,13 @@ "doc.add_table(\n", " [\n", " 'Start', 'Id', 'Sport', 'Type', f'Distance ({distance_units})', \"Ellapsed Time\", \"Moving Time\", 'Avg HR', 'Max HR', 'Avg RR', 'Max RR', f'Gained ({altitude_units})', f'Lost ({altitude_units})',\n", - " \"Calories\", f\"Avg Temp (deg {temp_units})\", 'Start Location', 'End Location'\n", + " \"Calories\", 'Training Load', f\"Avg Temp (deg {temp_units})\", 'Start Location', 'End Location', \"Feel\", \"Effort\"\n", " ],\n", " [\n", " [\n", " activity.start_time, activity_id, activity.sport, activity.type, format_distance(activity.distance), activity.elapsed_time, activity.moving_time, activity.avg_hr, activity.max_hr,\n", - " format_number(activity.avg_rr), format_number(activity.max_rr), format_number(activity.ascent), format_number(activity.descent),\n", - " activity.calories, format_temp(activity.avg_temperature), linked_location(start_loc), linked_location(end_loc)\n", + " format_number(activity.avg_rr), format_number(activity.max_rr), format_number(activity.ascent), format_number(activity.descent), activity.calories,\n", + " format_number(activity.training_load, 1), format_temp(activity.avg_temperature), linked_location(start_loc), linked_location(end_loc), activity.self_eval_feel, activity.self_eval_effort\n", " ]\n", " ]\n", ")\n", @@ -141,7 +141,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.7" }, "orig_nbformat": 4 }, diff --git a/Jupyter/jupyter_funcs.py b/Jupyter/jupyter_funcs.py index 4062a76..01bdc8f 100644 --- a/Jupyter/jupyter_funcs.py +++ b/Jupyter/jupyter_funcs.py @@ -39,4 +39,4 @@ def format_weight(distance, digits=1): def linked_location(location): """Return a location as markdown formatted linked text.""" - return snakemd.Inline(location.display(), location.to_google_maps_url()) + return snakemd.Inline(location.display(), link=location.to_google_maps_url()) diff --git a/Jupyter/requirements.txt b/Jupyter/requirements.txt index ce31e45..4c3f520 100644 --- a/Jupyter/requirements.txt +++ b/Jupyter/requirements.txt @@ -1,5 +1,5 @@ garmindb>=3.2.8 -snakemd==2.1.0 +snakemd==2.2.0 ipykernel==6.25.1 ipywidgets==7.7.2 ipyleaflet==0.17.3 diff --git a/Makefile b/Makefile index 9b0dd20..b0cdc6a 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ all: update_dbs # install all needed code setup_repo: $(CONF_DIR)/GarminConnectConfig.json $(PROJECT_BASE)/.venv submodules_update -setup_install: deps devdeps install_all +setup_install: version_check deps devdeps install_all setup: setup_repo setup_install @@ -68,6 +68,9 @@ $(PROJECT_BASE)/.venv: clean_venv: rm -rf $(PROJECT_BASE)/.venv +version_check: + python -c 'import sys; import garmindb.version; garmindb.version.python_dev_version_check(sys.argv[0])' + update: submodules_update git pull diff --git a/README.md b/README.md index c3794ad..81a6faa 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ Jupyter notebooks for analzing data from the database can be found in the 'Jupyt Plugins allow the user to expand the types of data that are processed and stored in the database. GarminDb already has a number of plugins for handling data from third-party Connect IQ apps and data fields. Read more about plugins [here](https://github.com/tcgoetz/GarminDbPlugins). +# Support This Project + +Do you find this project useful? Buy Me A Coffee + # Success Stories Find out who's using GarminDb on what platforms, OSes, and python versions [here](https://github.com/tcgoetz/GarminDB/wiki/Success-Stories). If you're using GarminDB and your scenario isn't listed send me a message or file an issue with your success case. diff --git a/dev-requirements.txt b/dev-requirements.txt index de77b56..1ea41cf 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -flake8==6.1.0 -build==0.10.0 -wheel==0.41.1 -twine==4.0.2 +flake8==7.0.0 +build==1.0.3 +wheel==0.42.0 +twine==5.0.0 diff --git a/garmindb/garmin_json_data.py b/garmindb/garmin_json_data.py index 1ec4c21..74459ee 100755 --- a/garmindb/garmin_json_data.py +++ b/garmindb/garmin_json_data.py @@ -293,7 +293,6 @@ def get_self_eval_feel(cls, value): """Return the Garmin Connect self evaluation 'How did you feel' label for the activity.""" levels = [(100, "Very Strong"), (75, "Strong"), (50, "Normal"), (25, "Weak"), (0, "Very Weak")] for threshold, label in levels: - print(f"Threshold {threshold} label {label}") if value >= threshold: return label @@ -303,7 +302,6 @@ def get_self_eval_effort(cls, value): levels = [(100, "Maximum"), (90, "Extremely Hard"), (70, "Very Hard"), (50, "Hard"), (40, "Somewhat Hard"), (30, "Moderate"), (20, "Light"), (10, "Very Light"), (0, "None")] for threshold, label in levels: - print(f"Threshold {threshold} label {label}") if value >= threshold: return label diff --git a/garmindb/version.py b/garmindb/version.py index 1dab9ee..7263c29 100644 --- a/garmindb/version.py +++ b/garmindb/version.py @@ -6,7 +6,7 @@ import idbutils.version as uv -from .version_info import python_required, python_tested, version_info, prerelease +from .version_info import dev_python_required, python_required, python_tested, version_info, prerelease version_string = uv.to_string(version_info, prerelease) @@ -23,5 +23,10 @@ def log_version(program): def python_version_check(program): - """Validate the Python version requirements.""" + """Validate the Python version requirements for a pip installed package.""" uv.python_version_check(program, python_required, python_tested) + + +def python_dev_version_check(program): + """Validate the Python version requirements for development.""" + uv.python_version_check(program, dev_python_required, python_tested, verbose=True) diff --git a/garmindb/version_info.py b/garmindb/version_info.py index fdbc03c..703c11d 100644 --- a/garmindb/version_info.py +++ b/garmindb/version_info.py @@ -6,6 +6,7 @@ python_required = (3, 0, 0) +dev_python_required = (3, 9, 0) python_tested = (3, 11, 4) version_info = (3, 5, 3) prerelease = False diff --git a/requirements.in b/requirements.in index 307c23c..70672cc 100644 --- a/requirements.in +++ b/requirements.in @@ -1,5 +1,4 @@ -sqlalchemy~=2.0.25 -requests +sqlalchemy~=2.0.27 python-dateutil cached-property tqdm diff --git a/requirements.txt b/requirements.txt index a8c6424..12cb8e6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ -SQLAlchemy==2.0.25 -requests==2.31.0 +SQLAlchemy==2.0.27 python-dateutil==2.8.2 cached-property==1.5.2 -tqdm==4.65.1 +tqdm==4.66.2 garth>=0.4.44 fitfile>=1.1.7 tcxfile>=1.0.4