%global _empty_manifest_terminate_build 0 Name: python-pylotoncycle Version: 0.6.0 Release: 1 Summary: Module to access your Peloton workout data License: BSD URL: https://github.com/justmedude/pylotoncycle Source0: https://mirrors.nju.edu.cn/pypi/web/packages/c6/db/0c32bc59cc5bf0ab5c3aa8fd7a078d1110cbfa6658ebbaeb967ba26d7918/pylotoncycle-0.6.0.tar.gz BuildArch: noarch Requires: python3-requests %description # PylotonCycle Python Library for getting your Peloton workout data. ## Table of contents * [General info](#general-info) * [Example Usage](#example-usage) ## General info As someone who wants to see my progress over time, I've been wanting a way to pull and play with my ride data. However, I'm also cautious about linking myself to too many external parties. As I've been playing with other libraries out there, I wanted something that was a bit more intuitive and would play nicer with the rest of my python code. So, PylotonCycle is born. ## Example Usage ``` import pylotoncycle username = 'your username or email address' password = 'your password' conn = pylotoncycle.PylotonCycle(username, password) workouts = conn.GetRecentWorkouts(5) ``` `workouts` is a list of workouts. An example of a list element ``` {'achievement_templates': [{'description': 'Awarded for working out with a ' 'friend.', 'id': '', 'image_url': 'https://s3.amazonaws.com/peloton-achievement-images-prod/702495cd985d4791bfd3d25f36e0df72', 'name': 'Dynamic Duo', 'slug': 'two_to_tango'}, {'description': 'Awarded for achieving Silver in ' 'the May Cycling Challenge.', 'id': '', 'image_url': 'https://s3.amazonaws.com/challenges-and-tiers-image-prod/6b772477ccd04f189fba16f2f877faad', 'name': 'May Cycling Challenge', 'slug': 'may_cycling_challenge_silver'}], 'created': 1589642476, 'created_at': 1589642476, 'device_time_created_at': 1589617276, 'device_type': 'home_bike_v1', 'device_type_display_name': 'Bike', 'end_time': 1589644336, 'fitbit_id': None, 'fitness_discipline': 'cycling', 'ftp_info': {'ftp': 111, 'ftp_source': 'ftp_workout_source', 'ftp_workout_id': ''}, 'has_leaderboard_metrics': True, 'has_pedaling_metrics': True, 'id': '', 'instructor_name': 'Matt Wilpers', 'is_total_work_personal_record': False, 'leaderboard_rank': 5015, 'metrics_type': 'cycling', 'name': 'Cycling Workout', 'overall_summary': {'avg_cadence': 85.48, 'avg_heart_rate': 0.0, 'avg_power': 179.24, 'avg_resistance': 47.61, 'avg_speed': 20.39, 'cadence': 0.0, 'calories': 496.71, 'distance': 10.19, 'heart_rate': 0.0, 'id': '', 'instant': 1589644336, 'max_cadence': 122.0, 'max_heart_rate': 0.0, 'max_power': 255.8, 'max_resistance': 60.95, 'max_speed': 23.48, 'power': 0.0, 'resistance': 0.0, 'seconds_since_pedaling_start': 0, 'speed': 0.0, 'total_work': 322417.21, 'workout_id': ''}, 'peloton_id': '', 'platform': 'home_bike', 'ride': {'captions': ['en-US'], 'class_type_ids': [''], 'content_format': 'video', 'content_provider': 'peloton', 'description': 'Max out the effectiveness of your training with this ' 'ride. Instructors will expertly guide you through ' 'specific output ranges 1 through 7 to help you build ' 'endurance, strength and speed.', 'difficulty_estimate': 6.3779, 'difficulty_level': None, 'difficulty_rating_avg': 6.3779, 'difficulty_rating_count': 17157, 'duration': 1800, 'equipment_ids': [], 'equipment_tags': [], 'excluded_platforms': [], 'extra_images': [], 'fitness_discipline': 'cycling', 'fitness_discipline_display_name': 'Cycling', 'has_closed_captions': True, 'has_free_mode': False, 'has_pedaling_metrics': True, 'home_peloton_id': '', 'id': '', 'image_url': 'https://s3.amazonaws.com/peloton-ride-images/58aa8ebc7d51d09d6513e1a2fab53c4c62c076c6/img_1580922399_a5f1fd0e3a2e48d38ecdd6a3d874820f.png', 'instructor_id': '', 'is_archived': True, 'is_closed_caption_shown': True, 'is_explicit': False, 'is_live_in_studio_only': False, 'language': 'english', 'length': 1940, 'live_stream_id': '-live', 'live_stream_url': None, 'location': 'nyc', 'metrics': ['heart_rate', 'cadence', 'calories'], 'origin_locale': 'en-US', 'original_air_time': 1580919480, 'overall_estimate': 0.9956, 'overall_rating_avg': 0.9956, 'overall_rating_count': 20737, 'pedaling_duration': 1800, 'pedaling_end_offset': 1860, 'pedaling_start_offset': 60, 'rating': 0, 'ride_type_id': '', 'ride_type_ids': [''], 'sample_vod_stream_url': None, 'scheduled_start_time': 1580920200, 'series_id': '', 'sold_out': False, 'studio_peloton_id': '', 'title': '30 min Power Zone Endurance Ride', 'total_in_progress_workouts': 0, 'total_ratings': 0, 'total_workouts': 32489, 'vod_stream_id': '-vod', 'vod_stream_url': None}, 'start_time': 1589642537, 'status': 'COMPLETE', 'strava_id': None, 'timezone': 'America/Los_Angeles', 'title': None, 'total_leaderboard_users': 31240, 'total_work': 322417.21, 'user_id': '', 'workout_type': 'class'} ``` An example of how you may fetch performance data for a ride ``` import pprint conn = pylotoncycle.PylotonCycle(username, password) workouts = conn.GetRecentWorkouts(5) for w in workouts: workout_id = w['id'] resp = conn.GetWorkoutMetricsById(workout_id) pprint.pprint(resp) ``` ## Install This package is available via pip install. ``` pip install pylotoncycle ``` ## TODO * Lots more to cover. I want to find the right format for pulling in the ride performance data. * Pull in GPS data for outdoor runs ## Note to folks who want to contribute I'm very happy to take pull requests and fix bugs that come up. But, this is definitely a side project for me. %package -n python3-pylotoncycle Summary: Module to access your Peloton workout data Provides: python-pylotoncycle BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-pylotoncycle # PylotonCycle Python Library for getting your Peloton workout data. ## Table of contents * [General info](#general-info) * [Example Usage](#example-usage) ## General info As someone who wants to see my progress over time, I've been wanting a way to pull and play with my ride data. However, I'm also cautious about linking myself to too many external parties. As I've been playing with other libraries out there, I wanted something that was a bit more intuitive and would play nicer with the rest of my python code. So, PylotonCycle is born. ## Example Usage ``` import pylotoncycle username = 'your username or email address' password = 'your password' conn = pylotoncycle.PylotonCycle(username, password) workouts = conn.GetRecentWorkouts(5) ``` `workouts` is a list of workouts. An example of a list element ``` {'achievement_templates': [{'description': 'Awarded for working out with a ' 'friend.', 'id': '', 'image_url': 'https://s3.amazonaws.com/peloton-achievement-images-prod/702495cd985d4791bfd3d25f36e0df72', 'name': 'Dynamic Duo', 'slug': 'two_to_tango'}, {'description': 'Awarded for achieving Silver in ' 'the May Cycling Challenge.', 'id': '', 'image_url': 'https://s3.amazonaws.com/challenges-and-tiers-image-prod/6b772477ccd04f189fba16f2f877faad', 'name': 'May Cycling Challenge', 'slug': 'may_cycling_challenge_silver'}], 'created': 1589642476, 'created_at': 1589642476, 'device_time_created_at': 1589617276, 'device_type': 'home_bike_v1', 'device_type_display_name': 'Bike', 'end_time': 1589644336, 'fitbit_id': None, 'fitness_discipline': 'cycling', 'ftp_info': {'ftp': 111, 'ftp_source': 'ftp_workout_source', 'ftp_workout_id': ''}, 'has_leaderboard_metrics': True, 'has_pedaling_metrics': True, 'id': '', 'instructor_name': 'Matt Wilpers', 'is_total_work_personal_record': False, 'leaderboard_rank': 5015, 'metrics_type': 'cycling', 'name': 'Cycling Workout', 'overall_summary': {'avg_cadence': 85.48, 'avg_heart_rate': 0.0, 'avg_power': 179.24, 'avg_resistance': 47.61, 'avg_speed': 20.39, 'cadence': 0.0, 'calories': 496.71, 'distance': 10.19, 'heart_rate': 0.0, 'id': '', 'instant': 1589644336, 'max_cadence': 122.0, 'max_heart_rate': 0.0, 'max_power': 255.8, 'max_resistance': 60.95, 'max_speed': 23.48, 'power': 0.0, 'resistance': 0.0, 'seconds_since_pedaling_start': 0, 'speed': 0.0, 'total_work': 322417.21, 'workout_id': ''}, 'peloton_id': '', 'platform': 'home_bike', 'ride': {'captions': ['en-US'], 'class_type_ids': [''], 'content_format': 'video', 'content_provider': 'peloton', 'description': 'Max out the effectiveness of your training with this ' 'ride. Instructors will expertly guide you through ' 'specific output ranges 1 through 7 to help you build ' 'endurance, strength and speed.', 'difficulty_estimate': 6.3779, 'difficulty_level': None, 'difficulty_rating_avg': 6.3779, 'difficulty_rating_count': 17157, 'duration': 1800, 'equipment_ids': [], 'equipment_tags': [], 'excluded_platforms': [], 'extra_images': [], 'fitness_discipline': 'cycling', 'fitness_discipline_display_name': 'Cycling', 'has_closed_captions': True, 'has_free_mode': False, 'has_pedaling_metrics': True, 'home_peloton_id': '', 'id': '', 'image_url': 'https://s3.amazonaws.com/peloton-ride-images/58aa8ebc7d51d09d6513e1a2fab53c4c62c076c6/img_1580922399_a5f1fd0e3a2e48d38ecdd6a3d874820f.png', 'instructor_id': '', 'is_archived': True, 'is_closed_caption_shown': True, 'is_explicit': False, 'is_live_in_studio_only': False, 'language': 'english', 'length': 1940, 'live_stream_id': '-live', 'live_stream_url': None, 'location': 'nyc', 'metrics': ['heart_rate', 'cadence', 'calories'], 'origin_locale': 'en-US', 'original_air_time': 1580919480, 'overall_estimate': 0.9956, 'overall_rating_avg': 0.9956, 'overall_rating_count': 20737, 'pedaling_duration': 1800, 'pedaling_end_offset': 1860, 'pedaling_start_offset': 60, 'rating': 0, 'ride_type_id': '', 'ride_type_ids': [''], 'sample_vod_stream_url': None, 'scheduled_start_time': 1580920200, 'series_id': '', 'sold_out': False, 'studio_peloton_id': '', 'title': '30 min Power Zone Endurance Ride', 'total_in_progress_workouts': 0, 'total_ratings': 0, 'total_workouts': 32489, 'vod_stream_id': '-vod', 'vod_stream_url': None}, 'start_time': 1589642537, 'status': 'COMPLETE', 'strava_id': None, 'timezone': 'America/Los_Angeles', 'title': None, 'total_leaderboard_users': 31240, 'total_work': 322417.21, 'user_id': '', 'workout_type': 'class'} ``` An example of how you may fetch performance data for a ride ``` import pprint conn = pylotoncycle.PylotonCycle(username, password) workouts = conn.GetRecentWorkouts(5) for w in workouts: workout_id = w['id'] resp = conn.GetWorkoutMetricsById(workout_id) pprint.pprint(resp) ``` ## Install This package is available via pip install. ``` pip install pylotoncycle ``` ## TODO * Lots more to cover. I want to find the right format for pulling in the ride performance data. * Pull in GPS data for outdoor runs ## Note to folks who want to contribute I'm very happy to take pull requests and fix bugs that come up. But, this is definitely a side project for me. %package help Summary: Development documents and examples for pylotoncycle Provides: python3-pylotoncycle-doc %description help # PylotonCycle Python Library for getting your Peloton workout data. ## Table of contents * [General info](#general-info) * [Example Usage](#example-usage) ## General info As someone who wants to see my progress over time, I've been wanting a way to pull and play with my ride data. However, I'm also cautious about linking myself to too many external parties. As I've been playing with other libraries out there, I wanted something that was a bit more intuitive and would play nicer with the rest of my python code. So, PylotonCycle is born. ## Example Usage ``` import pylotoncycle username = 'your username or email address' password = 'your password' conn = pylotoncycle.PylotonCycle(username, password) workouts = conn.GetRecentWorkouts(5) ``` `workouts` is a list of workouts. An example of a list element ``` {'achievement_templates': [{'description': 'Awarded for working out with a ' 'friend.', 'id': '', 'image_url': 'https://s3.amazonaws.com/peloton-achievement-images-prod/702495cd985d4791bfd3d25f36e0df72', 'name': 'Dynamic Duo', 'slug': 'two_to_tango'}, {'description': 'Awarded for achieving Silver in ' 'the May Cycling Challenge.', 'id': '', 'image_url': 'https://s3.amazonaws.com/challenges-and-tiers-image-prod/6b772477ccd04f189fba16f2f877faad', 'name': 'May Cycling Challenge', 'slug': 'may_cycling_challenge_silver'}], 'created': 1589642476, 'created_at': 1589642476, 'device_time_created_at': 1589617276, 'device_type': 'home_bike_v1', 'device_type_display_name': 'Bike', 'end_time': 1589644336, 'fitbit_id': None, 'fitness_discipline': 'cycling', 'ftp_info': {'ftp': 111, 'ftp_source': 'ftp_workout_source', 'ftp_workout_id': ''}, 'has_leaderboard_metrics': True, 'has_pedaling_metrics': True, 'id': '', 'instructor_name': 'Matt Wilpers', 'is_total_work_personal_record': False, 'leaderboard_rank': 5015, 'metrics_type': 'cycling', 'name': 'Cycling Workout', 'overall_summary': {'avg_cadence': 85.48, 'avg_heart_rate': 0.0, 'avg_power': 179.24, 'avg_resistance': 47.61, 'avg_speed': 20.39, 'cadence': 0.0, 'calories': 496.71, 'distance': 10.19, 'heart_rate': 0.0, 'id': '', 'instant': 1589644336, 'max_cadence': 122.0, 'max_heart_rate': 0.0, 'max_power': 255.8, 'max_resistance': 60.95, 'max_speed': 23.48, 'power': 0.0, 'resistance': 0.0, 'seconds_since_pedaling_start': 0, 'speed': 0.0, 'total_work': 322417.21, 'workout_id': ''}, 'peloton_id': '', 'platform': 'home_bike', 'ride': {'captions': ['en-US'], 'class_type_ids': [''], 'content_format': 'video', 'content_provider': 'peloton', 'description': 'Max out the effectiveness of your training with this ' 'ride. Instructors will expertly guide you through ' 'specific output ranges 1 through 7 to help you build ' 'endurance, strength and speed.', 'difficulty_estimate': 6.3779, 'difficulty_level': None, 'difficulty_rating_avg': 6.3779, 'difficulty_rating_count': 17157, 'duration': 1800, 'equipment_ids': [], 'equipment_tags': [], 'excluded_platforms': [], 'extra_images': [], 'fitness_discipline': 'cycling', 'fitness_discipline_display_name': 'Cycling', 'has_closed_captions': True, 'has_free_mode': False, 'has_pedaling_metrics': True, 'home_peloton_id': '', 'id': '', 'image_url': 'https://s3.amazonaws.com/peloton-ride-images/58aa8ebc7d51d09d6513e1a2fab53c4c62c076c6/img_1580922399_a5f1fd0e3a2e48d38ecdd6a3d874820f.png', 'instructor_id': '', 'is_archived': True, 'is_closed_caption_shown': True, 'is_explicit': False, 'is_live_in_studio_only': False, 'language': 'english', 'length': 1940, 'live_stream_id': '-live', 'live_stream_url': None, 'location': 'nyc', 'metrics': ['heart_rate', 'cadence', 'calories'], 'origin_locale': 'en-US', 'original_air_time': 1580919480, 'overall_estimate': 0.9956, 'overall_rating_avg': 0.9956, 'overall_rating_count': 20737, 'pedaling_duration': 1800, 'pedaling_end_offset': 1860, 'pedaling_start_offset': 60, 'rating': 0, 'ride_type_id': '', 'ride_type_ids': [''], 'sample_vod_stream_url': None, 'scheduled_start_time': 1580920200, 'series_id': '', 'sold_out': False, 'studio_peloton_id': '', 'title': '30 min Power Zone Endurance Ride', 'total_in_progress_workouts': 0, 'total_ratings': 0, 'total_workouts': 32489, 'vod_stream_id': '-vod', 'vod_stream_url': None}, 'start_time': 1589642537, 'status': 'COMPLETE', 'strava_id': None, 'timezone': 'America/Los_Angeles', 'title': None, 'total_leaderboard_users': 31240, 'total_work': 322417.21, 'user_id': '', 'workout_type': 'class'} ``` An example of how you may fetch performance data for a ride ``` import pprint conn = pylotoncycle.PylotonCycle(username, password) workouts = conn.GetRecentWorkouts(5) for w in workouts: workout_id = w['id'] resp = conn.GetWorkoutMetricsById(workout_id) pprint.pprint(resp) ``` ## Install This package is available via pip install. ``` pip install pylotoncycle ``` ## TODO * Lots more to cover. I want to find the right format for pulling in the ride performance data. * Pull in GPS data for outdoor runs ## Note to folks who want to contribute I'm very happy to take pull requests and fix bugs that come up. But, this is definitely a side project for me. %prep %autosetup -n pylotoncycle-0.6.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-pylotoncycle -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu Mar 09 2023 Python_Bot - 0.6.0-1 - Package Spec generated