Rest API service that converts HTML and CSS into high‑quality PDFs.
To build and run the application, you'll need:
- Docker, for infrastructure or running a containerized version of the entire application locally
- A Python3 Installation
If you would like to make changes to the application, you'll also need:
talisman
, for preventing accidentially committing sensitive datalefthook
, for running Git hooksgh
, for checking the pipeline status before pushingdocker
, for running containers-python
as runtimepango stack
for pdf printinguv
Python package and project manager
If you use Homebrew, you can install all of them like this:
brew install talisman lefthook gh
brew install python
brew install pango cairo harfbuzz fontconfig freetype pkg-config
brew install --cask docker # or `brew install docker` if you don't want the desktop app
Install uv by running:
curl -LsSf https://astral.sh/uv/install.sh | sh
or
brew install uv
Once you installed the prerequisites, make sure to initialize Git hooks. This will ensure any code you commit follows our coding standards, is properly formatted, and has a commit message adhering to our conventions:
lefthook install
Download dependencies:
uv sync
Start server:
uv run python -m fastapi run src/main.py --host 0.0.0.0 --port 8080
Test manually:
curl -X POST http://localhost:8080/pdf -F "html=@./sbgg.html" -F "css=@./style.css" -o sbgg.pdf
Run tests:
uv run pytest
Run linter
uv run flake8 ./src
Run formatter
uv run black ./src