Skip to content

Commit 2a3aa61

Browse files
docs/examples: Add usage instructions and examples README
- Updated `README.md` with instructions on running example scripts. - Added a new `examples/README.md` explaining how to execute and test example scripts using `uv` and `nox`. - Highlighted support for Python-version-specific overrides and the use of `.env` files to manage environment variables. Assisted-by: Codex
1 parent 5bccfcb commit 2a3aa61

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
Python client library for the PDFRest service. The project is managed with
44
[uv](https://docs.astral.sh/uv/) and targets Python 3.9 and newer.
55

6+
## Running examples
7+
8+
```bash
9+
uvx nox -s examples
10+
uv run nox -s run-example -- examples/delete/delete_example.py
11+
```
12+
613
## Getting started
714

815
```bash

examples/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Examples
2+
3+
Each example script includes [PEP 723](https://peps.python.org/pep-0723/)
4+
metadata so `uv` can create a disposable environment and install the script's
5+
dependencies without touching the project-wide virtualenv. Run them directly
6+
with `uv run` instead of relying on `--project` mode:
7+
8+
```bash
9+
# Default (Python 3.11+)
10+
uv run examples/delete/delete_example.py
11+
12+
# Version-specific overrides
13+
uv run --python 3.10 examples/delete/python-3.10/delete_example.py
14+
```
15+
16+
The commands above read `PDFREST_API_KEY` from your environment (you can manage
17+
that via `.env` if desired), upload the checked-in sample assets under
18+
`examples/resources/`, and exercise the async client end-to-end. Use
19+
`uvx nox -s examples` when you want to execute every example across the
20+
supported interpreter matrix.

0 commit comments

Comments
 (0)