Skip to content

Commit ac53386

Browse files
Merge pull request #36 from pdfrest/pdfcloud-5597-readme-updates
PDFCLOUD-5597 Readme Updates
2 parents b6c3cec + 0c18437 commit ac53386

7 files changed

Lines changed: 487 additions & 35 deletions

File tree

CONTRIBUTING.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributing
2+
3+
Thanks for contributing to `pdfrest`.
4+
5+
## Development setup
6+
7+
1. Install project tooling:
8+
9+
```bash
10+
uv sync --group dev
11+
```
12+
13+
2. (Recommended) install git hooks:
14+
15+
```bash
16+
uv run pre-commit install
17+
```
18+
19+
3. Verify package import/version:
20+
21+
```bash
22+
uv run python -c "import pdfrest; print(pdfrest.__version__)"
23+
```
24+
25+
## Code quality checks
26+
27+
Run these before opening a PR:
28+
29+
```bash
30+
uv run ruff format .
31+
uv run ruff check .
32+
uv run basedpyright
33+
```
34+
35+
## Tests
36+
37+
Quick local run:
38+
39+
```bash
40+
uv run pytest -n auto --maxschedchunk 2
41+
```
42+
43+
Full interpreter matrix with coverage artifacts (`coverage/py<version>/`):
44+
45+
```bash
46+
uvx nox -s tests
47+
```
48+
49+
Class/function coverage gate for client classes:
50+
51+
```bash
52+
uvx nox -s class-coverage
53+
```
54+
55+
To reuse existing coverage JSON without rerunning tests:
56+
57+
```bash
58+
uvx nox -s class-coverage -- --no-tests
59+
```
60+
61+
## Examples
62+
63+
Run all examples:
64+
65+
```bash
66+
uvx nox -s examples
67+
```
68+
69+
Run one example:
70+
71+
```bash
72+
uv run nox -s run-example -- examples/delete/delete_example.py
73+
```
74+
75+
## Docs preview (optional)
76+
77+
```bash
78+
uv run mkdocs serve
79+
uv run mkdocs build --strict
80+
```

README.md

Lines changed: 111 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,141 @@
1-
# pdfrest
1+
# pdfRest Python SDK
22

3-
Python client library for the PDFRest service. The project is managed with
4-
[uv](https://docs.astral.sh/uv/) and targets Python 3.9 and newer.
3+
[![Tests](https://img.shields.io/github/actions/workflow/status/pdfrest/pdfrest-python/test-and-publish.yml?branch=main&label=tests)](https://github.com/pdfrest/pdfrest-python/actions/workflows/test-and-publish.yml)
4+
[![PyPI Version](https://img.shields.io/pypi/v/pdfrest)](https://pypi.org/project/pdfrest/)
5+
[![Python Versions](https://img.shields.io/pypi/pyversions/pdfrest)](https://pypi.org/project/pdfrest/)
6+
[![llms.txt](https://img.shields.io/badge/llms.txt-available-2ea44f)](https://python.pdfrest.com/llms.txt)
57

6-
## Running examples
8+
Build production-grade PDF automation with the official Python SDK for
9+
[pdfRest](https://pdfrest.com/): a powerful PDF API platform for conversion,
10+
OCR, extraction, redaction, security, forms, and AI-ready document workflows.
711

8-
```bash
9-
uvx nox -s examples
10-
uv run nox -s run-example -- examples/delete/delete_example.py
11-
```
12+
- Homepage: [pdfrest.com](https://pdfrest.com/)
13+
- API docs: [pdfrest.com/apidocs](https://pdfrest.com/apidocs/)
14+
- Python SDK docs: [python.pdfrest.com](https://python.pdfrest.com/)
15+
- API Lab: [pdfrest.com/apilab](https://pdfrest.com/apilab/)
1216

13-
## Getting started
17+
## Why pdfRest
1418

15-
```bash
16-
uv sync
17-
uv run python -c "import pdfrest; print(pdfrest.__version__)"
18-
```
19+
- Enterprise PDF quality powered by Adobe PDF Library technology.
20+
- Fast onboarding with API Lab, code samples, and straightforward REST patterns.
21+
- Chainable API workflows that let you pass outputs between calls.
22+
- Deployment flexibility: Cloud, self-hosted on AWS, or self-hosted container.
23+
- Security and compliance resources published in the trust center and product
24+
documentation.
25+
26+
## Why this SDK
27+
28+
- Official typed Python interface to pdfRest (`PdfRestClient` and
29+
`AsyncPdfRestClient`).
30+
- Pydantic-backed request/response models for safer integrations.
31+
- High-level helpers for the endpoints teams use most in production.
32+
- Consistent error handling, request customization, and file management helpers.
33+
34+
## What you can build
1935

20-
## Development
36+
Use this PDF API for workflows like:
2137

22-
To install the tooling used by CI locally, include the `--group dev` flag:
38+
- Convert and transform: PDF to Word/Excel/PowerPoint/images/Markdown, and
39+
convert files to PDF/PDF-A/PDF-X.
40+
- Extract and analyze: OCR, text extraction, image extraction, PDF metadata.
41+
- Secure and govern: redaction, encryption, permissions, signing, watermarking.
42+
- Compose and optimize: merge/split, compress, flatten, rasterize, color
43+
conversion.
44+
- Form operations: import/export form data, flatten forms, XFA to Acroforms.
45+
46+
## Built for AI and LLM pipelines
47+
48+
pdfRest is especially useful for document AI systems:
49+
50+
- Convert PDFs to structured Markdown for downstream retrieval and training data
51+
prep.
52+
- Extract clean text and metadata for indexing and chunking pipelines.
53+
- Summarize and translate document content with API-native operations.
54+
- Keep multi-step pipelines efficient by chaining outputs between operations.
55+
56+
## Installation
57+
58+
`pdfrest` supports Python `3.10+`.
59+
60+
Recommended (`uv`):
2361

2462
```bash
25-
uv sync --group dev
63+
uv add pdfrest
2664
```
2765

28-
It is recommended to enable the pre-commit hooks after installation:
66+
Fallback (`pip`):
2967

3068
```bash
31-
uv run pre-commit install
69+
pip install pdfrest
3270
```
3371

34-
Run the test suite with:
72+
## Quick start
73+
74+
Set your API key in `PDFREST_API_KEY`:
3575

3676
```bash
37-
uv run pytest
77+
export PDFREST_API_KEY="your-api-key"
3878
```
3979

40-
Check per-function coverage for the client classes:
80+
Run your script:
4181

4282
```bash
43-
uvx nox -s class-coverage
83+
uv run python your_script.py
4484
```
4585

46-
To reuse an existing `coverage/py<version>/coverage.json` without rerunning
47-
tests, add `-- --no-tests` (and optional `--coverage-json path`).
86+
Example (upload + extract text):
4887

49-
## Documentation
88+
```python
89+
from pathlib import Path
5090

51-
Run the docs site locally:
91+
from pdfrest import PdfRestClient
5292

53-
```bash
54-
uv run mkdocs serve
93+
with PdfRestClient() as client:
94+
uploaded = client.files.create_from_paths([Path("input.pdf")])[0]
95+
result = client.extract_pdf_text(uploaded, full_text="document")
96+
97+
preview = ""
98+
if result.full_text is not None and result.full_text.document_text is not None:
99+
preview = result.full_text.document_text[:500]
100+
print(preview)
55101
```
56102

57-
Build the static documentation site:
103+
Async example:
58104

59-
```bash
60-
uv run mkdocs build --strict
105+
```python
106+
import asyncio
107+
from pathlib import Path
108+
109+
from pdfrest import AsyncPdfRestClient
110+
111+
112+
async def main() -> None:
113+
async with AsyncPdfRestClient() as client:
114+
uploaded = (await client.files.create_from_paths([Path("input.pdf")]))[0]
115+
result = await client.extract_pdf_text(uploaded, full_text="document")
116+
preview = ""
117+
if result.full_text is not None and result.full_text.document_text is not None:
118+
preview = result.full_text.document_text[:500]
119+
print(preview)
120+
121+
122+
asyncio.run(main())
61123
```
124+
125+
## Deployment options
126+
127+
- Cloud (default): use `PdfRestClient()` with `PDFREST_API_KEY`.
128+
- Self-hosted: set `base_url="https://your-api-host"` and keep the same Python
129+
SDK surface.
130+
131+
## Learn more
132+
133+
- API toolkit overview: [pdfrest.com](https://pdfrest.com/)
134+
- Resources and insights:
135+
[pdfrest.com/resources](https://pdfrest.com/resources/)
136+
- Example scripts: `examples/README.md`
137+
- Python SDK docs: [python.pdfrest.com](https://python.pdfrest.com/)
138+
139+
## For contributors
140+
141+
Contributor workflows live in `CONTRIBUTING.md`.

0 commit comments

Comments
 (0)