summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorRasmus Luha <rasmus.luha@gmail.com>2022-03-17 19:23:03 +0200
committerRasmus Luha <rasmus.luha@gmail.com>2022-03-17 19:23:03 +0200
commita2dfb5fdcfc541693f735cd433d33b140c152942 (patch)
tree0b4b1765dcfde14f85424ac4e1b238f2281f7497 /README.md
parentaba5fe2805cd90048774994d4b1d11baf1319f6e (diff)
another readme updata, removed __ini__'s
Diffstat (limited to 'README.md')
-rw-r--r--README.md40
1 files changed, 23 insertions, 17 deletions
diff --git a/README.md b/README.md
index 2a8c9a6..0c37073 100644
--- a/README.md
+++ b/README.md
@@ -3,37 +3,43 @@ This project has the functionality to fetch data about NBA and store it in csv f
It also has an API to serve the data.
API is at this [url](https://luhamus-nba-data.herokuapp.com/).
-## How to use
-### API
+# How to use
+## API
From the api you can fetch data as follows:
* For teams, the endpoint is "/teams" and you can fetch data as follows:
```
{api_url}/teams
```
-or just use [this](https://luhamus-nba-data.herokuapp.com/teams).
+ or just use [this](https://luhamus-nba-data.herokuapp.com/teams) link.
-* For player information, the endpoint is "/players/{team_name}
- - you can get the team name from fetching the teams data.
- '''
- {api_url}/players/{team_name}
- '''
+* For players information, you can search by the team. the endpoint is "/players/{team_name}
+ - you can get the team name from fetching the teams data from /teams.
- Examples with Bulls, Celtics, Hawks:
- * [https://luhamus-nba-data.herokuapp.com/teams/bulls](https://luhamus-nba-data.herokuapp.com/teams/bulls).
- * [https://luhamus-nba-data.herokuapp.com/teams/celtics](https://luhamus-nba-data.herokuapp.com/teams/celtics).
- * [https://luhamus-nba-data.herokuapp.com/teams/hawks](https://luhamus-nba-data.herokuapp.com/teams/hawks).
- - NB: you shouldn't use the "full_name", like "Chicago Bulls".
+ * [https://luhamus-nba-data.herokuapp.com/players/bulls](https://luhamus-nba-data.herokuapp.com/players/bulls).
+ * [https://luhamus-nba-data.herokuapp.com/players/celtics](https://luhamus-nba-data.herokuapp.com/players/celtics).
+ * [https://luhamus-nba-data.herokuapp.com/players/hawks](https://luhamus-nba-data.herokuapp.com/players/hawks).
+ - NB: you shouldn't use the "fullName", like "Chicago Bulls".
-### Fetching Data
-Code for fetching data in in directory AllAboutData, where the
-fetched data will also be stored.
-To use the data fetching script, you should clone the repo and do following:
+### API on localhost
+To run the API locally, you should first clone the Repo and do the following:
```bash
cd {cloned_repo_name}
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```
-Then you should make a file
+then you can run the API on localhost, at port 8000, as follows:
+```
+uvicorn api.main:app --reload
+```
+where reload option is for development.
+
+
+## Fetching Data
+Code for fetching data in in directory AllAboutData, where the
+fetched data will also be stored.
+To use the data fetching script, you should follow the same steps as
+for running API locally. Then you should make a file
```
.env
```