Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python-uv/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Managing Python Projects With `uv`: An All-in-One Solution

This folder provides the code examples for the Real Python tutorial [Managing Python Projects With `uv`: An All-in-One Solution](https://realpython.com/python-uv/).

The sample app uses the [Cat API](https://thecatapi.com/), which requires an API key. Get one from the Cat API website and store it in an environment variable called `CAT_API_KEY` before running the app:

```sh
$ export CAT_API_KEY=<your-api-key>
$ uv run main.py Persian
```
6 changes: 5 additions & 1 deletion python-uv/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import argparse
import os
import sys

import requests


def get_breeds_info():
response = requests.get("https://api.thecatapi.com/v1/breeds")
response = requests.get(
"https://api.thecatapi.com/v1/breeds",
headers={"x-api-key": os.environ.get("CAT_API_KEY", "")},
)
response.raise_for_status()
return response.json()

Expand Down
Loading