polib
A library to manipulate gettext files (po and mo files).
What it is and what it does
polib is a pure-Python library for reading, writing, and manipulating gettext translation files in PO, POT, and MO formats. It lets you load existing translation catalogs, iterate through entries, modify or add translations, manage metadata and comments, and generate new files—all without external dependencies. The library supports Python 2.7 and Python 3.6 through 3.11, as well as PyPy.
It is typically used in build pipelines, localization workflows, and translation management tools where programmatic access to gettext files is needed. You can use it to merge translation files, extract or update translations, validate catalog structure, or automate translation catalog generation as part of a continuous localization process.
Use it for:
- Merge or update PO files in a build pipeline to keep translations in sync with source code changes.
- Programmatically extract and modify translation strings in a localization management tool or web interface.
- Generate or validate MO (compiled) files from PO catalogs for deployment to production.
- Automate translation workflow tasks such as marking entries as fuzzy, updating metadata, or reorganizing comments.
- Parse and analyze translation coverage or completeness across multiple language catalogs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
polib reads, writes, and manipulates gettext translation files (PO, POT, and MO formats), allowing you to load, iterate, modify entries, and create translation catalogs programmatically.
Yes. polib is a stable, dependency-free library with a long track record in production use across many open-source projects. It has no known vulnerabilities, permissive licensing, and low install friction. The dormant maintenance status is not a concern for a mature, focused tool that solves a well-defined problem. Install it if you need to work with gettext files programmatically.
Install
polib on PyPI
pip
pip install polibuv
uv add polibpoetry
poetry add polibInstalling polib
Before you install
Low install friction—pure Python wheel with no runtime dependencies. Maintenance is dormant (last release 1268 days ago), but the package is marked Production/Stable and used by many open-source projects; recent repository activity (last commit 2025-01-10) suggests it is maintained despite infrequent releases.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source contexts.
Quickstart
pip install polib
import polib
pofile = polib.pofile('/path/to/pofile.po')
for entry in pofile:
print(entry.msgid, entry.msgstr)
Verify before relying
- Whether the package handles all edge cases in modern gettext formats (e.g., pluralization rules, context-aware translations) reliably in production use.
- Performance characteristics when working with very large translation files (thousands or tens of thousands of entries).
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,268 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,027,525/month — #1,795 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: polib-1.2.0-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
translate-toolkitTranslate Toolkit converts, validates, and…
copyleft · top 15,000 on PyPI
types-polibProvides type stubs for the polib package,…
permissive · top 15,000 on PyPI
edx-i18n-toolsCommand-line tool for extracting, compiling,…
permissive · top 15,000 on PyPI
translation-finderDiscovers and identifies translation files in…
copyleft · top 15,000 on PyPI
zope.i18nProvides internationalization and localization…
unclear · top 15,000 on PyPI
oslo.i18noslo.i18n provides utilities for handling…
permissive · top 5,000 on PyPI
ResourceBundleResourceBundle manages internationalization and…
permissive · top 15,000 on PyPI
translationstringProvides translation string objects and…
permissive · top 5,000 on PyPI
weblate-language-dataProvides language definitions, plural rules,…
permissive · top 15,000 on PyPI