polib-merge /

Filename Size Date modified Message
470 B
4.6 KB
1.0 KB
82 B
2.6 KB
60.6 KB
1.8 KB



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 is pretty stable now and is used by many opensource projects.


Note: chances are that polib is already packaged for your linux/bsd system, if so, we recommend you use your OS package system, if not then choose a method below:

Installing latest polib version with setuptools

$ easy_install polib

Installing latest polib version with pip

$ pip install polib

Installing latest polib version from source tarball

Download latest version

$ tar xzfv polib-x.y.z.tar.gz
$ cd polib-x.y.z
$ python setup build
$ sudo python install

Installing the polib development version

Note: this is not recommended in a production environment.

$ hg clone
$ cd polib
$ python setup build
$ sudo python install

Basic usage example

>>> import polib
>>> # load an existing po file
>>> po = polib.pofile('tests/test_utf8.po')
>>> for entry in po: print entry.msgid, entry.msgstr
>>> # add an entry
>>> entry = polib.POEntry(msgid='Welcome', msgstr='Bienvenue')
>>> entry.occurrences = [('', '12'), ('', '34')]
>>> po.append(entry)
>>> # save our modified po file
>>> # compile mo file
>>> po.save_as_mofile('tests/')


A tutorial is available and you can also browse the complete api documentation.


Bugtracker, wiki and mercurial repository can be found at the project's page. New releases are also published at the cheeseshop.


Author: David Jean Louis.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.