Pure python library to manipulate, create, modify gettext files (pot, po and mo files).
Find a file
CyberVitexus 70be5582eb fix: add buildBlocker to prevent race with RebulidDEBRepoByAnsible
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 18:10:20 +02:00
.github ci: add Python 3.12 2024-02-18 17:25:10 -08:00
debian fix: add buildBlocker to prevent race with RebulidDEBRepoByAnsible 2026-06-20 18:10:20 +02:00
docs added members 2024-09-21 19:51:34 +02:00
tests Merge pull request #157 from petitlapin/work/escape_a 2025-01-10 09:30:04 +01:00
.coveragerc Omit __init__.py 2021-04-15 12:48:47 +02:00
.gitignore Setup CI, use .gitignore, updated README and docs 2021-02-19 12:45:25 +01:00
.travis.yml ci: add Python 3.12 2024-02-18 17:25:10 -08:00
__init__.py Fix typos 2016-05-13 19:14:32 +02:00
CHANGELOG Release 1.2.0 2023-02-23 18:11:39 +01:00
codecov.yml Added codecov.yml 2021-04-16 09:43:23 +02:00
LICENSE Fixed issue #71 (tcomment and flags not saved for obsolete entries) 2015-12-22 10:54:35 +01:00
Makefile Pep8 was renamed pycodestyle 2017-11-27 18:29:39 +01:00
MANIFEST.in Fixed issue #71 (tcomment and flags not saved for obsolete entries) 2015-12-22 10:54:35 +01:00
polib.py Merge pull request #157 from petitlapin/work/escape_a 2025-01-10 09:30:04 +01:00
README.rst Fixed build badge 2023-02-23 18:30:25 +01:00
requirements-dev.txt Added development requirements file 2021-04-15 12:26:33 +02:00
runtests.sh Fixed issue #71 (tcomment and flags not saved for obsolete entries) 2015-12-22 10:54:35 +01:00
setup.cfg Fixed issue #71 (tcomment and flags not saved for obsolete entries) 2015-12-22 10:54:35 +01:00
setup.py setup.py: add Python 3.12 2024-02-18 17:25:18 -08:00
tox.ini tox: add coverage for Python 3.12 2024-02-18 17:24:52 -08:00

=====
polib
=====

|pypi-version| |pypi-stats| |build-status-image| |codecov-image| |documentation-status-image| |py-versions|

Overview
--------

polib is a library to manipulate, create, modify gettext files (pot, po and mo
files). You can load existing files, iterate through it's entries, add, modify
entries, comments or metadata, etc... or create new po files from scratch.

polib supports out of the box any version of python ranging from 2.7 to latest
3.X version.

polib is pretty stable now and is used by many 
`opensource projects <http://polib.readthedocs.org/en/latest/projects.html>`_.

The project code and bugtracker is hosted on 
`Github <https://github.com/izimobil/polib/>`_.

polib is generously documented, you can `browse the documentation online 
<http://polib.readthedocs.org/>`_, a good start is to read 
`the quickstart guide  <http://polib.readthedocs.org/en/latest/quickstart.html>`_.


Installation
~~~~~~~~~~~~

Just use ``pip``:

.. code:: bash

    $ pip install polib


Basic example
~~~~~~~~~~~~~

.. code:: python

    import polib

    pofile = polib.pofile('/path/to/pofile.po')

    for entry in pofile:
        print(entry.msgid, entry.msgstr)


.. |build-status-image| image:: https://api.travis-ci.com/izimobil/polib.svg?branch=master
   :target: https://app.travis-ci.com/github/izimobil/polib
   :alt: Travis build

.. |codecov-image| image:: https://codecov.io/gh/izimobil/polib/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/izimobil/polib

.. |pypi-version| image:: https://img.shields.io/pypi/v/polib.svg
   :target: https://pypi.python.org/pypi/polib
   :alt: Pypi version

.. |pypi-stats| image:: https://img.shields.io/pypi/dm/polib.svg
   :target: https://pypistats.org/packages/polib
   :alt: Pypi downloads

.. |documentation-status-image| image:: https://readthedocs.org/projects/polib/badge/?version=latest
   :target: http://polib.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

.. |py-versions| image:: https://img.shields.io/pypi/pyversions/polib.svg
   :target: https://img.shields.io/pypi/pyversions/polib.svg
   :alt: Python versions