Skip to content

Instantly share code, notes, and snippets.

@trbarron
Last active December 2, 2019 03:20
Show Gist options
  • Save trbarron/9567adde3a18ca53616ef3ef2860569d to your computer and use it in GitHub Desktop.
Save trbarron/9567adde3a18ca53616ef3ef2860569d to your computer and use it in GitHub Desktop.
import pickle
import peloton
username = "username_1"
workouts = peloton.PelotonWorkout.list()
with open(username+".pkl","wb") as f:
pickle.dump(workouts,f)
pkl_file = open(username + '.pkl', 'rb')
workouts_as_loaded = pickle.load(pkl_file)
latest_workout = workouts_as_loaded[0]
print(latest_workout.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment