This project provides tools for retrieving data from the Strava API and processing it for analysis. The code is designed to facilitate the extraction, transformation, and loading (ETL) of Strava activity data into a structured format, enabling further analysis and visualization.
This project leverages Strava's API to retrieve activity data, process it, and export it to formats suitable for analysis (e.g., CSV). It supports fetching details about individual runs, rides, or other activities and transforming the raw data for easy exploration and reporting.
- Authentication: Handles OAuth2 authentication with Strava's API.
- Data Retrieval: Fetches data from Strava, such as activity details (distance, pace, time, etc.).
- Data Processing: Cleans and transforms the data into a structured format.
- Export to CSV: Exports processed data to CSV for further use in analysis tools like Power BI or Excel.
- Data Visualization: Visualizes your Strava data in a Power BI report, enabling you to analyze your running activity.
-
Clone the repository:
git clone https://github.com/RDNelson00/Strava-Stream-.git
-
Dependencies:
Install the required Python packages by running:
pip install -r requirements.txt
To visualize your Strava data, you'll need Power BI Desktop installed on your system.
-
Download Power BI Desktop:
- Go to the Power BI Download Page.
- Click on "Download free" to get the latest version of Power BI Desktop.
-
Install Power BI Desktop:
- Run the downloaded installer and follow the installation prompts.
- After installation, launch Power BI Desktop.
-
Verify Installation:
- Open Power BI Desktop and confirm it loads correctly.
-
Set up Strava API credentials:
- Go to the Strava API Settings and create an application.
- Obtain the
Client IDandClient Secret.
-
Update the configuration file:
Open the
.envfile in the root directory and update the following values:CLIENT_ID=your_client_id CLIENT_SECRET=your_client_secret
-
Run the data extraction script:
python _Main.py
- If you have not previously authorized the project, you will be routed to an authorization prompt on Strava's website.
- Grant authorization and copy & paste the URL into the input prompt in the Python terminal.
- The application will parse the authorization code from the pasted URL and update your
.envfile.
Execute the
_Main.pyscript once more, and your Strava activities will be extracted and saved as a local CSV file. -
Review the output:
Check the
strava_activities.csvfile containing the processed activity data. -
Open the Power BI Report:
- Navigate to the
Reportdirectory and open the fileStrava Report.pbipin Power BI Desktop.
- Navigate to the
-
Update the Connection String:
- In Power BI, modify the connection string of the
strava_activitiesdataset so it matches the location where yourstrava_activities.csvfile is saved. - After updating the connection, refresh the report to visualize your Strava data.
- In Power BI, modify the connection string of the
