Este projeto contém um notebook Jupyter para interagir com a API do Strava, permitindo a análise de atividades esportivas.
- Docker
- Docker Compose
Configure as seguintes variáveis de ambiente antes de executar o container:
STRAVA_CLIENT_ID
: Seu ID de cliente StravaSTRAVA_CLIENT_SECRET
: Seu segredo de cliente Strava
Você pode configurá-las criando um arquivo .env
na raiz do projeto.
Para gerar essas variáveis, é necessário a criação de uma app no Strava.
Para facilitar a configuração das variáveis de ambiente, você pode usar o comando:
make env STRAVA_CLIENT_ID=seu_id STRAVA_CLIENT_SECRET=seu_secret
Este comando criará automaticamente o arquivo .env
com as credenciais fornecidas.
Comando | Descrição |
---|---|
make build |
Constrói o container Docker |
make run |
Inicia o container em modo detached |
make jupyter |
Executa o servidor Jupyter Notebook |
make sh |
Acessa o container usando shell sh |
make bash |
Acessa o container usando bash |
make logs |
Mostra os logs do container |
make stop |
Para e remove o container |
make restart |
Reinicia o container |
make black |
Executa o formatador Black no código |
make env |
Cria o arquivo .env com as credenciais do Strava |
make help |
Mostra a ajuda com todos os comandos |
- Execute o comando
make jupyter
para iniciar o servidor Jupyter Notebook - Abra seu navegador e acesse
http://localhost:8888
- Use o token de acesso mostrado no terminal para fazer login
- Abra o notebook
strava_statistics.ipynb
- Execute as células do notebook para obter o link de autorização
- Clique no link e autorize o acesso ao Strava
- Copie a URL de redirecionamento e cole-a no notebook quando solicitado
- Os dados e análises ficam salvos no volume montado.
This project contains a Jupyter notebook to interact with the Strava API, allowing the analysis of sports activities.
- Docker
- Docker Compose
Configure the following environment variables before running the container:
STRAVA_CLIENT_ID
: Your Strava client IDSTRAVA_CLIENT_SECRET
: Your Strava client secret
You can configure creating the .env
file at the root of the project.
To generate these variables, you need to create a Strava app.
To easily configure the environment variables, you can use the command:
make env STRAVA_CLIENT_ID=your_id STRAVA_CLIENT_SECRET=your_secret
This command will automatically create the .env
file with the provided credentials.
Command | Description |
---|---|
make build |
Build the Docker container |
make run |
Start the container in detached mode |
make jupyter |
Run the Jupyter Notebook server |
make sh |
Access the container using sh shell |
make bash |
Access the container using bash |
make logs |
Show container logs |
make stop |
Stop and remove the container |
make restart |
Restart the container |
make black |
Run the Black formatter on the code |
make env |
Create the .env file with Strava credentials |
make help |
Show help with all commands |
- Run the
make jupyter
command to start the Jupyter Notebook server - Open your browser and go to
http://localhost:8888
- Use the access token shown in the terminal to log in
- Open the
strava_statistics.ipynb
notebook
- Run the notebook cells to get the authorization link
- Click on the link and authorize access to Strava
- Copy the redirect URL and paste it into the notebook when prompted
- Data and analyses are saved in the mounted volume.