Skip to main content
Help improve PyPI by participating in a 5-minute user interface survey!

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

Project Description

polib allows you to manipulate, create, modify gettext catalogs (.pot, .po and binary .mo files). You can load existing files, iterate through it’s entries, add, modify entries, comments or metadata, etc… or create new po/pot files from scratch.

polib provides a simple and pythonic API, exporting only two convenience functions ‘pofile’ and ‘mofile’, and the 4 core classes: POFile, MOFile, POEntry and MOEntry for creating new files/entries.

A basic example

>>> import polib
>>> # load an existing po file
>>> po = polib.pofile('tests/test.po')
>>> for entry in po:
...     # do something with entry...
...     print entry.msgid, entry.msgstr
>>> # add an entry
>>> entry = polib.POEntry()
>>> entry.msgid = 'Welcome'
>>> entry.msgstr = 'Bienvenue'
>>> entry.occurences = [('welcome.py', '12'), ('anotherfile.py', '34')]
>>> po.append(entry)
>>> # save our modified po file
>>> po.save()

Release history Release notifications

History Node

1.1.0

History Node

1.0.8

History Node

1.0.7

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.7.0

History Node

0.6.4

History Node

0.6.3

History Node

0.6.2

History Node

0.6.1

History Node

0.6.0

History Node

0.5.5

History Node

0.5.4

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5.0

History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

History Node

0.3.1

History Node

0.3.0

This version
History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
polib-0.1.0-1.noarch.rpm (21.1 kB) Copy SHA256 hash SHA256 RPM 2.4 Aug 9, 2006
polib-0.1.0.tar.gz (39.3 kB) Copy SHA256 hash SHA256 Source None Aug 9, 2006
polib-0.1.0.win32.exe (70.6 kB) Copy SHA256 hash SHA256 Windows Installer 2.4 Aug 9, 2006

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page