Skip to main content

entirius-django-pim-translator

A Django module that translates the product catalogue of Entirius, the open-source modular ecommerce platform. It extracts translatable fields from PIM entities, sends them to an AI toolbox service over HTTP and writes the translated text back.

PyPI Python License: MPL-2.0

What it does

  • Translates products, categories, features, attributes and other PIM entities into the requested target languages.
  • Estimates the cost first: every translate call accepts dry_run and returns an estimate without translating.
  • Runs bulk translation as toolbox jobs that a Celery task polls and applies when they finish.
  • Sanitises translated HTML and marks the target language as overridden, so inheritance does not undo it.
  • Imports existing official translations from a JSONL file without calling the AI toolbox.
  • Exposes an admin API (JWT, Pydantic schemas, OpenAPI) and the commands translate_pim and import_translations.

Installation

uv add entirius-django-pim-translator
pip install entirius-django-pim-translator
INSTALLED_APPS = [
    # ...
    "django_pim",
    "django_utils",
    "django_utils_translator",
    "django_pim_translator",
]

# main/urls.py
urlpatterns.append(path("", include("django_pim_translator.urls")))

The module needs a reachable AI toolbox service, configured through AI_TOOLBOX_BASE_URL and AI_TOOLBOX_API_KEY of entirius-django-utils; the channel idx of a call is sent as the toolbox channel. The toolbox itself is not part of this package. Settings reference: https://github.com/entirius/entirius-django-utils/blob/develop/docs/toolbox-client.md

Quick start

from django_pim_translator.services.translator import translate_entity

estimate = translate_entity(
    channel_idx="my-channel",
    entity_type="product",
    entity_id="SKU-1",
    target_languages=["pl"],
    dry_run=True,
)

With dry_run=True the call returns a cost estimate; without it a toolbox job is created and applied by the Celery task. The admin API is mounted under api/pim-translator/v2/admin/<shop_idx>/. The same orchestrator backs manage.py translate_pim.

Requirements

  • Python 3.11 or newer, Django 5.0 or newer.
  • PostgreSQL (through entirius-django-pim) and a Celery worker.
  • A reachable AI toolbox service (AI_TOOLBOX_* settings).
  • Entirius packages pulled in: entirius-django-pim, entirius-django-utils, entirius-django-utils-translator.

Documentation

Part of Entirius

This module runs inside the Entirius backend service (Volkanos) next to the PIM module it translates.

Development

make install     # sync dependencies (uv, incl. extras)
make check       # lint + format check (ruff)
make test        # test suite (pytest; PostgreSQL through DATABASE_URL)

Development and agent instructions: https://github.com/entirius/entirius-django-pim-translator/blob/develop/AGENTS.md

License

Mozilla Public License 2.0 (MPL-2.0) — see https://github.com/entirius/entirius-django-pim-translator/blob/develop/LICENSE.

Metadata

Release files for entirius-django-pim-translator 2.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 entirius-django-pim-translator 2.1.0
File Size Uploaded
entirius_django_pim_translator-2.1.0.tar.gz 150.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for entirius-django-pim-translator 2.1.0
File Interpreter ABI Platform
entirius_django_pim_translator-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 183.6 kB

Release files / entirius_django_pim_translator-2.1.0.tar.gz

Download URL entirius_django_pim_translator-2.1.0.tar.gz
Size 150.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a74012be61329cab7bb2cdc7a4981f3fead52126dde6a68dd3e2d077100ccea6
BLAKE2b-256 checksum
How to use checksums
9ed80cc2f3cb796f8c8aa26e94d49343d9ae55f53985214f9517173b3ab8df6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / entirius_django_pim_translator-2.1.0-py3-none-any.whl

Download URL entirius_django_pim_translator-2.1.0-py3-none-any.whl
Size 33.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f142605fc46cc19079ee5a25b21c7c9e41b9c95027294b1add4696d840cd1f14
BLAKE2b-256 checksum
How to use checksums
6d92c3b1502731df4a3b679b787d3163777d621c58111724d0861137287306ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

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