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.4 to latest 3.X version.
polib is pretty stable now and is used by many opensource projects.
The project code and bugtracker is hosted on Bitbucket.
Thanks for downloading polib !
- Wheel support
- Add missing 'Language' and 'Plural-Forms' to metadata ordering
- More accurate float operation for POFile.percent_translated()
- Fixed issue #59: tokens variable referenced before assignment
- Implemented feature request #56: line number information in PO entries
- Fixed issue #61: polib does not handle previous msgid on multines properly
- Fixed issue #43: improved check that determine if polib is dealing with a filepath or unicode content
- Fixed issue #44: polib now checks MO files revision number and throws an error if the number is unexpected
- Fixed issue #45: parse properly mo files with no header entry
- Fixed issue #47: added flags attribute for MOEntry to be consistant with POEntry
- Fixed issue #49: use integers rather than strings for msgstr_plural keys
- Fixed issue #51: if a PO file ends with a comment, polib adds a spurious empty entry at the end
- Fixed issue #52: bad magic number written on big endian platforms
- Fixed issue #53: added a __hash__() method to POEntry and MOEntry classes
- Fixed issue #54: use lowercase for state identifiers. This fixes issues with certain locales and string.lower()
- Fixed issue #58: use io.open() instead of codecs.open() because the latter doesn't handle very well universal line endings
- Make sure the mo file is closed at garbage collection, this prevents warnings on unclosed file when running tests with python >= 3.2
- Better way to test indianness
- polib download URL is now on Pypi
- Fixed issue #38: POFile.append() raised a duplicate exception when you tried to add a new entry with the same msgid and a different msgctxt (only when check_for_duplicates option is set to True)
- Fixed issue #39: Added __init__.py file for convenience
- Fixed issue #41: UnicodeDecodeError when running setup.py build on python3 with C locale
- polib is now fully PEP8 compliant
- Small improvements: remove unused "typ" var (thanks Rodrigo Silva), mproved Makefile, Make sure _BaseFile.__contains__ returns a boolean value
- allow empty comments, flags or occurences lines
- speed up POFile.merge method (thanks @encukou)
- allow comments starting with two '#' characters (thanks @goibhniu)
Yeah... after nearly 6 years, polib reaches the stable state :) Changes and fixes in this release :
- polib.pofile and polib.mofile functions can now return a custom class (thanks Craig Blaszczyk)
- polib now can find the metadata entry no matter where it is located (thanks François Poirotte)
- fixed issue #28 (IOError on reading obsolete "previous msgid" entries) (thanks James Ni)
This version adds support for python 3 (thanks to Vinay Sajip). polib now supports out-of-the-box any version of python ranging from 2.4 to latest 3.X version. polib is now 5 years old ;) so the 0.7.X branch will be the last before the 1.X stable branch.
- Better api, autodetected_encoding is no longer required to explicitely set the encoding (fixes issue #23),
- Fixed issue #24 Support indented PO files (thanks to François Poirotte).
- Fixed issue #19 (Disappearing newline characters due to textwrap module),
- ensure wrapping works as expected.
- Backported textwrap.TextWrapper._wrap_chunks that has support for the drop_whitespace parameter added in Python 2.6 (Fixes #18: broken compatibility with python 2.5, thanks @jezdez).
- fixed regression that prevented POFile initialization from data to work (issue #17).
- polib is now fully documented,
- switched from doctests to unit tests to keep the polib.py file clean,
- fixed issue #7 (wrapping issues, thanks @jezdez),
- added a __eq__ method to _BaseFile (thanks @kost BebiX),
- handle msgctxt correctly when compiling mo files,
- compiled mo files are now exactly the same as those compiled by msgfmt without using hash tables.
- Removed multiline handling code, it was a mess and was the source of potential bugs like issue #11,
- Fixed typo in README and CHANGELOG, fixes issue #13.
- fixed an issue with detect_encoding(), in some cases it could return an invalid charset.
- correctly unescape lines containing both \\n and \n (thanks to Martin Geisler),
- fixed issue #6: __str__() methods are returning unicode instead of str,
- fixed issue #8: POFile.merge error when an entry is obsolete in a .po, that this entry reappears in the .pot and that we merge the two,
- added support to instanciate POFile objects using data instead of file path (thanks to Diego Búrigo Zacarão),
- fixed issue #9: POFile.merge drop fuzzy attributes from translations (thanks to Tim Gerundt),
- fixed issue #10: Finding entries with the same msgid and different context (msgctxt).
- fixed issue #1: untranslated_entries() also show fuzzy message,
- write back the fuzzy header if present in the pofile,
- added support for previous msgctxt, previous msgid and previous msgid_plural comments (fixes issue #5),
- better handling of lines wrapping.
- fixed issue #0025: setup.py requires CHANGELOG but it's not present in polib-0.5.0-tar.gz
- fixed issue #0017: UnicodeDecodeError while writing a mo-file,
- fixed issue #0018: implemented support for msgctxt,
- fixed bug when compiling plural msgids/strs,
- API docs are no longer included, hopefully next release will ship with sphinx documentation,
- parse msg plural entries correctly when reading mo files,
- fixed issue #0020 and #0021: added ability to check for duplicate when adding entries to po/mo files, this is optional and not enabled by default because it slows down considerably the library,
- fixed issue #0022: unescaping code is insufficient,
- fixed issue #0023: encoding error when saving mo file as po file (thanks to sebastien.sable for the patch !).
- fixed issue #0007: use the codecs module to open files,
- fixed issue #0014: plural forms are not saved correctly in the mo file (thanks lorenzo.gil.sanchez for the patch),
- fixed issue #0015: no LICENSE file included in tarball,
- removed Version/Date from README,
- added test pot files to MANIFEST.in,
- performance improvment in find() method (thanks Thomas !).
- fixed issue #0006: plural msgstrs were saved unsorted,
- fixed issue #0008: long comment lines broke 'save()' method,
- removed performance shortcuts: they were in fact inefficient, I was misleaded by the python profile module, kudos to Thomas for making me realise that,
- fixed issue #0010: wrong polib version number,
- fixed issue #0011: occurrences parsing is now more robust and can handle weird references formats (like in eToys OLPC po files),
- fixed issue #0012: improved merge() method.
- fixed bug #0005: percent_translated divide by 0 on empty po files,
- fixed bug #0004: occurrences that have hiphens are wrapped when they should not,
- changes in how encoding is handled,
- remove deprecation warnings for typo on "occurrences",
- added POEntry.__cmp__() method to sort entries like gettext does,
- fixed POEntry.transalated(),
- added a merge() method to POFile class, that behaves like the gettext msgmerge utility,
- obsolete entries are now written at the end of the file and with only msgid/msgstr like gettext does,
- fixed some bugs in mo files parsing,
- renamed quote/unquote functions to escape/unescape,
- various cosmetic changes.
- fixed bug #0002: typo on "occurrences",
- fixed bug #0003: mismatch in exception instance names,
- removed deprecation warnings,
- removed unused charset() method in POFile/MOFile objects,
- fixed bug in multibytes string length (added regression tests),
- fixed a bug in detect_encoding(),
- added a find() method to _BaseFile class,
- proper handling of quoting and unquoting,
- proper handling of multiline strings in metadata
- speed improvements,
- polib can now compile mo files,
- unicode support,
- fixed bug #0001: global name 'sorted' is not defined" on python 2.3.
|File||Type||Python Version||Uploaded On||Downloads|
|polib-1.0.6.tar.gz||Source||Jan. 4, 2015||3,481|
|polib-1.0.6-py2.py3-none-any.whl||Wheel||2.7||Jan. 4, 2015||6,828|
|1.0.6||Jan. 4, 2015|
|1.0.5||Aug. 22, 2014|
|1.0.4||Feb. 19, 2014|
|1.0.3||Jan. 24, 2014|
|1.0.2||Jan. 24, 2014|
|1.0.1||Jan. 24, 2014|
|1.0.0||Jan. 24, 2014|
|0.7.0||Jan. 24, 2014|
|0.6.4||Jan. 24, 2014|
|0.6.3||Jan. 24, 2014|
|0.6.2||Jan. 24, 2014|
|0.6.1||Jan. 24, 2014|
|0.6.0||Jan. 24, 2014|
|0.5.5||Jan. 24, 2014|
|0.5.4||Feb. 1, 2015|
|0.5.3||Jan. 24, 2014|
|0.5.2||Jan. 24, 2014|
|0.5.1||Jan. 24, 2014|
|0.5.0||Feb. 1, 2015|
|0.4.2||Feb. 1, 2015|
|0.4.1||Feb. 1, 2015|
|0.4.0||Feb. 1, 2015|
|0.3.1||Dec. 13, 2007|
|0.3.0||Oct. 17, 2007|
|0.1.0||Aug. 9, 2006|
|Feb. 1, 2015, 9:23 p.m.||polib||0.3.0||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.5.5||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.5.4||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.5.3||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.5.2||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.5.1||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.5.0||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.4.2||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.4.0||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.4.1||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.6.4||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.7.0||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.6.0||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.6.1||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.6.2||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.6.3||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||0.1.0||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||1.0.3||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||1.0.2||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||1.0.1||Release Created|
|Feb. 1, 2015, 9:23 p.m.||polib||1.0.0||Release Created|
|Feb. 1, 2015, 9:22 p.m.||polib||0.3.1||Release Created|
|Feb. 1, 2015, 9:22 p.m.||polib||1.0.6||Release Created|
|Feb. 1, 2015, 9:22 p.m.||polib||1.0.5||Release Created|
|Feb. 1, 2015, 9:22 p.m.||polib||1.0.4||Release Created|
|Feb. 1, 2015, 9:22 p.m.||polib||Package Created|