Skip to content

Commit

Permalink
Merge pull request #10 from dlt-hub/test/more-pagination-cases
Browse files Browse the repository at this point in the history
WIP: Add more OpenAPI cases
  • Loading branch information
sh-rp authored May 5, 2024
2 parents 958d9a3 + 18c81f3 commit 4597035
Show file tree
Hide file tree
Showing 8 changed files with 4,747 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ poetry install
poetry shell
```

2. Create new `dlt` pipeline from [PokeAPI spec](https://raw.githubusercontent.com/cliffano/pokeapi-clients/main/specification/pokeapi.yml) and place it in the `pokemon-pipeline`
2. Init git submodules
```sh
git submodule update --recursive --remote
```

3. Create new `dlt` pipeline from [PokeAPI spec](https://raw.githubusercontent.com/cliffano/pokeapi-clients/main/specification/pokeapi.yml) and place it in the `pokemon-pipeline`
```
dlt-init init pokemon --url https://raw.githubusercontent.com/cliffano/pokeapi-clients/ec9a2707ef2a85f41b747d8df013e272ef650ec5/specification/pokeapi.yml
```

3. After executing of the command, you can pick the endpoints that you want to add to your source and then load with the pipeline. The endpoints are grouped by returned data type (table) and ordered by centrality (a measure how many other tables, the given table links to):
4. After executing of the command, you can pick the endpoints that you want to add to your source and then load with the pipeline. The endpoints are grouped by returned data type (table) and ordered by centrality (a measure how many other tables, the given table links to):
```
? Which resources would you like to generate? (Use arrow keys to move, <space> to select, <a> to toggle, <i> to invert)
Expand Down Expand Up @@ -68,15 +73,15 @@ Pokemon endpoints:
○ pokemon_read /api/v2/pokemon/{id}/
```

4. Pick your endpoints and press **ENTER** to generate pipeline. Now you are ready to load data.
5. Pick your endpoints and press **ENTER** to generate pipeline. Now you are ready to load data.

5. Enter the `pokemon-pipeline` folder and execute the `pipeline.py` script. This will load your endpoints to local `duckdb`. Below we use `enlighten` to show fancy progress bars:
6. Enter the `pokemon-pipeline` folder and execute the `pipeline.py` script. This will load your endpoints to local `duckdb`. Below we use `enlighten` to show fancy progress bars:
```
cd pokemon-pipeline
PROGRESS=enlighten python pipeline.py
```

6. Inspect the pipeline to see what got loaded
7. Inspect the pipeline to see what got loaded
```
$ dlt pipeline pokemon_pipeline info
Found pipeline pokemon_pipeline in /home/rudolfix/.dlt/pipelines
Expand All @@ -102,7 +107,7 @@ Has 1 completed load packages with following load ids:
Pipeline has last run trace. Use 'dlt pipeline pokemon_pipeline trace' to inspect
```
7. Launch the streamlit app to preview the data (we copy a streamlit config to make it work on codespaces)
8. Launch the streamlit app to preview the data (we copy a streamlit config to make it work on codespaces)
```
cp -r ../.streamlit .
pip install pandas streamlit
Expand Down
Loading

0 comments on commit 4597035

Please sign in to comment.