Skip to content

Commit

Permalink
add data sample
Browse files Browse the repository at this point in the history
  • Loading branch information
lfunderburk committed Dec 4, 2023
1 parent e86eea4 commit 5bfcb1a
Show file tree
Hide file tree
Showing 3 changed files with 1,313 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,5 @@ mini-projects/movie-rec-system/movie_rec_system/products/eda-pipeline.ipynb
mini-projects/movie-rec-system/movie_rec_system/products/extract-pipeline.ipynb

!mini-projects/end-to-end/weather.csv
!docs/deploying-your-sql-applications/weather.csv
!mini-projects/end-to-end/requirements.txt
15 changes: 15 additions & 0 deletions docs/deploying-your-sql-applications/sample-deployment-pc.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ if __name__ == "__main__":

```

The script above uses the [RapidAPI](https://rapidapi.com/weatherapi/api/weatherapi-com/) to extract weather data. You can sign up for a free account to get an API key. The script also uses the [dotenv](https://pypi.org/project/python-dotenv/) package to load the API key from an environment variable. To download weather data for different locations, you can replace the latitude and longitude coordinates in the script. The following locations were used in the sample script using the coordinates corresponding to the cities listed below:

|Continent | Cities |
| --- | --- |
| North America | New York City, Los Angeles , Toronto |
| South America | São Paulo ,Buenos Aires, Bogotá |
| Europe | London, Paris, Berlin |
| Asia | Tokyo , Beijing,Mumbai |
| Africa | Cairo ,Lagos, Johannesburg |
| Australia | Sydney , Melbourne , Brisbane |

Once you have created the script, you can run it to extract the data. You can also schedule its execution with GitHub Actions.

## Visualize the data

Let's visualize the data to see what it looks like. We will use the Plotly package.
Expand All @@ -163,6 +176,8 @@ fig = px.scatter_geo(
fig.show()
```

The code above creates an interactive map that shows the wind forecast for the next 5 days for the cities in the world. Press the Play > button to see the animation. Let's save this into a notebook called `app.ipynb`.

## Create a GitHub repository and initializing Ploomber Cloud deployment

Create a GitHub repository and add the Python script and Jupyter notebook to it. You can also add a README file to describe your project.
Expand Down
Loading

0 comments on commit 5bfcb1a

Please sign in to comment.