Skip to main content

Pinta backend

Development

By default, run the backend in a container from the repository root with Docker Compose:

docker compose up -d

This also starts the Airflow container the backend depends on. Make sure that you have setup Airflow connection configuration from .env.example to your .env.

The backend listens on http://localhost:3011 by default and runs with uvicorn live reload enabled. Override the host port with COMPOSE_BACKEND_PORT:

Verify that the API works:

curl http://localhost:3011/health

The health response includes a versions object containing the keys and values from /opt/pinta/version.json. On installed hosts, Ansible writes this file. Set PINTA_BACKEND_VERSION_DIR to change its containing directory. If the file is missing or invalid, versions is empty and dependency health is unchanged.

For local development, make up, make up-backend, and make backend-start generate a root-level version.json from component pyproject.toml versions. Compose mounts it at /opt/pinta/version.json; the host-run backend reads it from the repository root. Before using docker compose up directly, run make generate-versions. Local processing_image_tag and backend_image_tag are package versions, not Docker image tags; db_version is the package version, not an Alembic revision. The backend returns all file values as-is.

or play with the API manually with requests.http file.

If health shows DOWN for Airflow, make sure that you have Airflow running. The backend authenticates against Airflow using PINTA_BACKEND_AIRFLOW_USERNAME / PINTA_BACKEND_AIRFLOW_PASSWORD from .env.

Local development

Optionally run the backend directly on the host from the repository root:

make backend-start
# If you want to use local airflow as well:
# make airflow-start

This stops the Compose backend container first, so the local process can bind to port 3011. From this directory, the equivalent local command is python -m pinta_backend.

Swagger

FastAPI serves the interactive Openapi spec at http://localhost:3011/docs.

Building the container

Build targets:

Target Package source Usage
dev Local repository source Used by Docker Compose for backend development. Tagged as latest and build from main branch.
prod Published PyPI package Used for release images. Build requires PINTA_BACKEND_VERSION and PINTA_BACKEND_CONSTRAINT.

Build a production image with:

VERSION=0.3.1
uv pip install --no-deps --target /tmp/pinta-backend "pinta_backend==$VERSION"
mkdir -p .release-constraints
cp /tmp/pinta-backend/pinta_backend/constraints.txt .release-constraints/pinta_backend.txt

docker build \
  --target prod \
  -f components/backend/Containerfile \
  --build-arg "PINTA_BACKEND_VERSION=$VERSION" \
  --build-arg PINTA_BACKEND_CONSTRAINT=.release-constraints/pinta_backend.txt \
  --build-arg PYPI_INDEX_URL=https://pypi.example.invalid/simple \
  -t "ghcr.io/nlsfi/pinta/pinta-backend:$VERSION" \
  .

Image tags:

  • latest is the nightly build from the main branch.
  • Version tags are release builds from tagged versions, published as both backend:<version> and pinta-backend:<version>.

Translations

The API is localized using the Accept-Language request header. The response language is defined in the Content-Language response header.

Translate texts with:

from pinta_backend.i18n import _

translated_string = _("Foo")

Currently, translations are not automatically updated if the translator is imported using a symbol other than _.

Updating translations

  • Update translation files from the repository root with make backend-ts, or from this directory with ./src/pinta_backend/scripts/update-translations.sh
  • Update translations in the language-specific .po files
  • Compile translations from the repository root with make backend-tc, or from this directory with ./src/pinta_backend/scripts/compile-translations.sh

Initialize new languages with:

msginit --input=<path to .pot> --locale=<locale code> --output-file=<path to output .po>

Metadata

Release files for pinta_backend 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinta_backend 0.1.0
File Size Uploaded Provenance Actions
pinta_backend-0.1.0.tar.gz 18.0 kB Without provenance Details for pinta_backend-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pinta_backend 0.1.0
File Interpreter ABI Platform Actions
pinta_backend-0.1.0-py3-none-any.whl Python 3 none any Details for pinta_backend-0.1.0-py3-none-any.whl

Total release size: 43.9 kB

Release files / pinta_backend-0.1.0.tar.gz

Download URL pinta_backend-0.1.0.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
40c54cb0d17ab68a601ac07ac4c09a361fde77e4a60ee9f077b24713ec3d0e77
BLAKE2b-256 checksum
How to use checksums
5cad1bba65a765df3bcdfcda1354ea05eaf22c585fa2c62198fe72e3a2745057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pinta_backend-0.1.0-py3-none-any.whl

Download URL pinta_backend-0.1.0-py3-none-any.whl
Size 26.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ed52f6dca412520529825ee82e6781a985cbee4b97dfa0282a60cfa4a276ca3
BLAKE2b-256 checksum
How to use checksums
c548f19a82165b5f067a209a25c7aec060b3bc1808a608e9bf7a02d92860cc8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pinta_backend 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page