Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add synchronization agent for Strava to TrainingPeaks #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Lucs1590
Copy link
Owner

@Lucs1590 Lucs1590 commented Jan 6, 2025

Add a synchronization agent to automate the synchronization of workouts from Strava to TrainingPeaks.

  • New SyncAgent Class:

    • Create SyncAgent class in src/sync_agent.py to handle synchronization tasks.
    • Implement methods to retrieve workouts from Strava and push to TrainingPeaks.
    • Add error handling and logging within the SyncAgent class.
    • Implement a method to schedule the synchronization process weekly.
    • Use LangChain agent to manage synchronization tasks.
  • Main Function Update:

    • Import SyncAgent class in src/main.py.
    • Instantiate and run the SyncAgent within the main function.
  • Dependencies:

    • Add schedule and requests to requirements.txt.
  • Testing:

    • Add tests/test_sync_agent.py to define test cases for the synchronization process, error handling, logging, and scheduling.
  • Documentation:

    • Update README.md to include a section detailing the new synchronization agent functionality.
    • Provide setup and usage instructions for the synchronization agent.

For more details, open the Copilot Workspace session.

Add a synchronization agent to automate the synchronization of workouts from Strava to TrainingPeaks.

* **New SyncAgent Class**:
  - Create `SyncAgent` class in `src/sync_agent.py` to handle synchronization tasks.
  - Implement methods to retrieve workouts from Strava and push to TrainingPeaks.
  - Add error handling and logging within the `SyncAgent` class.
  - Implement a method to schedule the synchronization process weekly.
  - Use LangChain agent to manage synchronization tasks.

* **Main Function Update**:
  - Import `SyncAgent` class in `src/main.py`.
  - Instantiate and run the `SyncAgent` within the `main` function.

* **Dependencies**:
  - Add `schedule` and `requests` to `requirements.txt`.

* **Testing**:
  - Add `tests/test_sync_agent.py` to define test cases for the synchronization process, error handling, logging, and scheduling.

* **Documentation**:
  - Update `README.md` to include a section detailing the new synchronization agent functionality.
  - Provide setup and usage instructions for the synchronization agent.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Lucs1590/strava-to-trainingpeaks?shareId=XXXX-XXXX-XXXX-XXXX).
…ization agent details

* **tests/test_sync_agent.py**
  - Add test cases for `get_workouts_from_strava`, `push_workouts_to_trainingpeaks`, `sync_workouts_for_week`, `handle_api_rate_limits`, and `schedule_weekly_sync` methods.
  - Mock necessary modules and methods for testing.

* **README.md**
  - Add an overview section for the synchronization agent.
  - Update setup instructions with environment variables and dependency installation.
  - Add usage instructions for running the synchronization agent.
@Lucs1590
Copy link
Owner Author

Lucs1590 commented Jan 6, 2025

Instead of get the workouts via Strava API and do the post via requets to Training Peaks, the application behavior must be:

  1. Get the workout ids from the current week;
  2. Download the .tcx files (like scr/main.py) related to the current week (using current browser);
  3. Login in Training Peaks;
  4. Open https://app.trainingpeaks.com/#calendar guide;
  5. Upload the tcx files in the right days that the workouts were done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant