skillfed

polib

A library to manipulate gettext files (po and mo files).

polib v1.2.0 7.0M downloads/30d#1,795 on PyPI135
Permissive license MIT DORMANT released

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 polib

uv

uv add polib

poetry

poetry add polib

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: InternationalizationTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: LocalizationTopic :: Text Processing :: Linguistic

Tags

gettext po file manipulationtranslation file parserpo mo file libraryi18n translation cataloggettext file editorpo file reader writerlocalization file handling
i18n-localizationgettext-tools

More Python Modules packages