Debian Codegraph @

third_party/python/polib/polib-1.2.0.dist-info/METADATA

raw
1 Metadata-Version: 2.1
2 Name: polib
3 Version: 1.2.0
4 Summary: A library to manipulate gettext files (po and mo files).
5 Home-page: https://github.com/izimobil/polib/
6 Author: David Jean Louis
7 Author-email: [email protected]
8 Maintainer: David Jean Louis
9 Maintainer-email: [email protected]
10 License: MIT
11 Download-URL: https://pypi.python.org/packages/source/p/polib/polib-1.2.0.tar.gz
12 Platform: posix
13 Classifier: Development Status :: 5 - Production/Stable
14 Classifier: Environment :: Console
15 Classifier: Environment :: Web Environment
16 Classifier: Intended Audience :: Developers
17 Classifier: Intended Audience :: System Administrators
18 Classifier: License :: OSI Approved :: MIT License
19 Classifier: Operating System :: OS Independent
20 Classifier: Programming Language :: Python
21 Classifier: Programming Language :: Python :: 2
22 Classifier: Programming Language :: Python :: 2.7
23 Classifier: Programming Language :: Python :: 3
24 Classifier: Programming Language :: Python :: 3.6
25 Classifier: Programming Language :: Python :: 3.7
26 Classifier: Programming Language :: Python :: 3.8
27 Classifier: Programming Language :: Python :: 3.9
28 Classifier: Programming Language :: Python :: 3.10
29 Classifier: Programming Language :: Python :: 3.11
30 Classifier: Programming Language :: Python :: Implementation :: PyPy
31 Classifier: Topic :: Software Development :: Libraries :: Python Modules
32 Classifier: Topic :: Software Development :: Internationalization
33 Classifier: Topic :: Software Development :: Localization
34 Classifier: Topic :: Text Processing :: Linguistic
35
36
37 =====
38 polib
39 =====
40
41 |pypi-version| |pypi-stats| |build-status-image| |codecov-image| |documentation-status-image| |py-versions|
42
43 Overview
44 --------
45
46 polib is a library to manipulate, create, modify gettext files (pot, po and mo
47 files). You can load existing files, iterate through it's entries, add, modify
48 entries, comments or metadata, etc... or create new po files from scratch.
49
50 polib supports out of the box any version of python ranging from 2.7 to latest
51 3.X version.
52
53 polib is pretty stable now and is used by many
54 `opensource projects <http://polib.readthedocs.org/en/latest/projects.html>`_.
55
56 The project code and bugtracker is hosted on
57 `Github <https://github.com/izimobil/polib/>`_.
58
59 polib is generously documented, you can `browse the documentation online
60 <http://polib.readthedocs.org/>`_, a good start is to read
61 `the quickstart guide <http://polib.readthedocs.org/en/latest/quickstart.html>`_.
62
63
64 Installation
65 ~~~~~~~~~~~~
66
67 Just use ``pip``:
68
69 .. code:: bash
70
71 $ pip install polib
72
73
74 Basic example
75 ~~~~~~~~~~~~~
76
77 .. code:: python
78
79 import polib
80
81 pofile = polib.pofile('/path/to/pofile.po')
82
83 for entry in pofile:
84 print(entry.msgid, entry.msgstr)
85
86
87 .. |build-status-image| image:: https://api.travis-ci.com/izimobil/polib.svg?branch=master
88 :target: https://app.travis-ci.com/github/izimobil/polib
89 :alt: Travis build
90
91 .. |codecov-image| image:: https://codecov.io/gh/izimobil/polib/branch/master/graph/badge.svg
92 :target: https://codecov.io/gh/izimobil/polib
93
94 .. |pypi-version| image:: https://img.shields.io/pypi/v/polib.svg
95 :target: https://pypi.python.org/pypi/polib
96 :alt: Pypi version
97
98 .. |pypi-stats| image:: https://img.shields.io/pypi/dm/polib.svg
99 :target: https://pypistats.org/packages/polib
100 :alt: Pypi downloads
101
102 .. |documentation-status-image| image:: https://readthedocs.org/projects/polib/badge/?version=latest
103 :target: http://polib.readthedocs.io/en/latest/?badge=latest
104 :alt: Documentation Status
105
106 .. |py-versions| image:: https://img.shields.io/pypi/pyversions/polib.svg
107 :target: https://img.shields.io/pypi/pyversions/polib.svg
108 :alt: Python versions
109
110
111 =========
112 Changelog
113 =========
114
115 Version 1.2.0 (2023/02/23)
116 --------------------------
117 - Added setter for the fuzzy property
118 - Escape/unescape \v, \b and \f
119 - Added path to error message processing parser symbols
120 - Ensure empty previous values for msgid and msgstr are properly saved
121 - Fixed relative ordering of comments and translator comments
122 - Do not count obsolete entries in fuzzy() method
123 - Close files properly
124 - Fixed support for loading mo files from bytes object
125 - Fixed msgstr_plural comparison
126 - Simplified python version check
127 - Updated docs
128
129 Version 1.1.1 (2021/03/26)
130 --------------------------
131 - Strip UTF-16 BOM (U+FEFF) from start of file
132 - Message context (msgctxt) support for MO files
133 - Dropped Python < 2.7 support
134 - Updated docs and README after switch from Bitbucket to Github
135
136 Version 1.1.0 (2017/11/27)
137 --------------------------
138 - Fixed entries sorting when generating mo file (Fixes #78)
139 - Fixed find method (Fixes #84)
140 - Refactored POEntry.__cmp__ method (this should fix issues #60, #65 and #79)
141 - Fixed duplicated entries when merging po file with pot file (fixes #68)
142 - Fixed "None" string being outputted when polib deals with syntax error in string (Fixes issue #66)
143 - Added a fuzzy property to entries (Fixes #76)
144 - Take into account the message context when comparing entries
145 - Leave occurence untouched if line number is not a number (fixes #80 and #90)
146 - Fixed test for mo files that was failing because since gettext version 0.19.8.1, msgfmt skips the "POT-Creation-Date" metadata entry (Fixes #86)
147 - Fixed major revision number comparison
148 - Dropped python 2.4 support
149
150 Version 1.0.8 (2016/11/21)
151 --------------------------
152 - Fixed issue #70 (occurrences parsing for windows pathes)
153 - Fixed issue #71 (tcomment and flags not saved for obsolete entries)
154 - Fixed issue #72 (wrong metadata ordering)
155 - Fixed issue #73 (can't always unpickle POFile)
156 - Use natural sorting for additional headers (metadata)
157 - Fixed typos in various documents
158
159 Version 1.0.7 (2015/07/08)
160 --------------------------
161 - Fixed bad parsing of indented msgstr_plural
162 - Fixed ordering of "Language" metadata entry
163 - Removed space after "#" in header if comment line is empty (like gettext tools)
164 - Fixed typos / grammar errors (thanks Jakub Wilk)
165 - Take into account msgid_plural if needed when comparing entries (thanks Leonardo Constantino Oliveira)
166 - Fixed issue #63 (str() on a bytes instance when using python3) (thanks Jakub Wilk)
167
168 Version 1.0.6 (2015/01/04)
169 --------------------------
170 - Wheel support
171 - Add missing 'Language' and 'Plural-Forms' to metadata ordering
172 - More accurate float operation for POFile.percent_translated()
173
174 Version 1.0.5 (2014/08/22)
175 --------------------------
176 - Fixed issue #59: tokens variable referenced before assignment
177 - Implemented feature request #56: line number information in PO entries
178 - Fixed issue #61: polib does not handle previous msgid on multilines properly
179
180 Version 1.0.4 (2014/02/19)
181 --------------------------
182 - Fixed issue #43: improved check that determine if polib is dealing with a filepath or unicode content
183 - Fixed issue #44: polib now checks MO files revision number and throws an error if the number is unexpected
184 - Fixed issue #45: parse properly mo files with no header entry
185 - Fixed issue #47: added flags attribute for MOEntry to be consistent with POEntry
186 - Fixed issue #49: use integers rather than strings for msgstr_plural keys
187 - Fixed issue #51: if a PO file ends with a comment, polib adds a spurious empty entry at the end
188 - Fixed issue #52: bad magic number written on big endian platforms
189 - Fixed issue #53: added a __hash__() method to POEntry and MOEntry classes
190 - Fixed issue #54: use lowercase for state identifiers. This fixes issues with certain locales and string.lower()
191 - Fixed issue #58: use io.open() instead of codecs.open() because the latter doesn't handle very well universal line endings
192 - Make sure the mo file is closed at garbage collection, this prevents warnings on unclosed file when running tests with python >= 3.2
193 - Better way to test endianness
194 - polib download URL is now on Pypi
195
196 Version 1.0.3 (2013/02/09)
197 --------------------------
198 - 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)
199 - Fixed issue #39: Added __init__.py file for convenience
200 - Fixed issue #41: UnicodeDecodeError when running setup.py build on python3 with C locale
201 - polib is now fully PEP8 compliant
202 - Small improvements: remove unused "typ" var (thanks Rodrigo Silva), improved Makefile, Make sure _BaseFile.__contains__ returns a boolean value
203
204 Version 1.0.2 (2012/10/23)
205 --------------------------
206 - allow empty comments, flags or occurrences lines
207
208 Version 1.0.1 (2012/09/11)
209 --------------------------
210 - speed up POFile.merge method (thanks @encukou)
211 - allow comments starting with two '#' characters (thanks @goibhniu)
212
213 Version 1.0.0 (2012/06/08)
214 --------------------------
215 Yeah... after nearly 6 years, polib reaches the stable state :)
216 Changes and fixes in this release :
217
218 - polib.pofile and polib.mofile functions can now return a custom class (thanks Craig Blaszczyk)
219 - polib now can find the metadata entry no matter where it is located (thanks François Poirotte)
220 - fixed issue #28 (IOError on reading obsolete "previous msgid" entries) (thanks James Ni)
221
222 Version 0.7.0 (2011/07/14)
223 --------------------------
224 This version adds support for python 3 (thanks to Vinay Sajip).
225 polib now supports out-of-the-box any version of python ranging from 2.4 to latest 3.X version.
226 polib is now 5 years old ;) so the 0.7.X branch will be the last before the 1.X stable branch.
227
228 Version 0.6.4 (2011/07/13)
229 --------------------------
230 - Better api, autodetected_encoding is no longer required to explicitly set the encoding (fixes issue #23),
231 - Fixed issue #24 Support indented PO files (thanks to François Poirotte).
232
233 Version 0.6.3 (2011/02/19)
234 --------------------------
235 - Fixed issue #19 (Disappearing newline characters due to textwrap module),
236 - ensure wrapping works as expected.
237
238 Version 0.6.2 (2011/02/09)
239 --------------------------
240 - 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).
241
242 Version 0.6.1 (2011/02/09)
243 --------------------------
244 - fixed regression that prevented POFile initialization from data to work (issue #17).
245
246 Version 0.6.0 (2011/02/07)
247 --------------------------
248 - polib is now `fully documented <http://polib.readthedocs.org>`_,
249 - switched from doctests to unit tests to keep the polib.py file clean,
250 - fixed issue #7 (wrapping issues, thanks @jezdez),
251 - added a __eq__ method to _BaseFile (thanks @kost BebiX),
252 - handle msgctxt correctly when compiling mo files,
253 - compiled mo files are now exactly the same as those compiled by msgfmt without using hash tables.
254
255 Version 0.5.5 (2010/10/30)
256 --------------------------
257 - Removed multiline handling code, it was a mess and was the source of potential bugs like issue #11,
258 - Fixed typo in README and CHANGELOG, fixes issue #13.
259
260 Version 0.5.4 (2010/10/02)
261 --------------------------
262 - fixed an issue with detect_encoding(), in some cases it could return an invalid charset.
263
264 Version 0.5.3 (2010/08/29)
265 --------------------------
266 - correctly unescape lines containing both \\\\n and \\n (thanks to Martin Geisler),
267 - fixed issue #6: __str__() methods are returning unicode instead of str,
268 - 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,
269 - added support to instantiate POFile objects using data instead of file path (thanks to Diego Búrigo Zacarão),
270 - fixed issue #9: POFile.merge drop fuzzy attributes from translations (thanks to Tim Gerundt),
271 - fixed issue #10: Finding entries with the same msgid and different context (msgctxt).
272
273 Version 0.5.2 (2010/06/09)
274 --------------------------
275 - fixed issue #1: untranslated_entries() also show fuzzy message,
276 - write back the fuzzy header if present in the pofile,
277 - added support for previous msgctxt, previous msgid and previous msgid_plural comments (fixes issue #5),
278 - better handling of lines wrapping.
279
280 Version 0.5.1 (2009/12/14)
281 --------------------------
282 - fixed issue #0025: setup.py requires CHANGELOG but it's not present in polib-0.5.0-tar.gz
283
284 Version 0.5.0 (2009/12/13)
285 --------------------------
286 - fixed issue #0017: UnicodeDecodeError while writing a mo-file,
287 - fixed issue #0018: implemented support for msgctxt,
288 - fixed bug when compiling plural msgids/strs,
289 - API docs are no longer included, hopefully next release will ship with sphinx documentation,
290 - parse msg plural entries correctly when reading mo files,
291 - 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,
292 - fixed issue #0022: unescaping code is insufficient,
293 - fixed issue #0023: encoding error when saving mo file as po file (thanks to sebastien.sable for the patch !).
294
295 Version 0.4.2 (2009/06/05)
296 --------------------------
297 - fixed issue #0007: use the codecs module to open files,
298 - fixed issue #0014: plural forms are not saved correctly in the mo file (thanks lorenzo.gil.sanchez for the patch),
299 - fixed issue #0015: no LICENSE file included in tarball,
300 - removed Version/Date from README,
301 - added test pot files to MANIFEST.in,
302 - performance improvement in find() method (thanks Thomas !).
303
304 Version 0.4.1 (2009/03/04)
305 --------------------------
306 - fixed issue #0006: plural msgstrs were saved unsorted,
307 - fixed issue #0008: long comment lines broke 'save()' method,
308 - removed performance shortcuts: they were in fact inefficient, I was mislead by the python profile module, kudos to Thomas for making me realise that,
309 - fixed issue #0010: wrong polib version number,
310 - fixed issue #0011: occurrences parsing is now more robust and can handle weird references formats (like in eToys OLPC po files),
311 - fixed issue #0012: improved merge() method.
312
313 Version 0.4.0 (2008/11/26)
314 --------------------------
315 - fixed bug #0005: percent_translated divide by 0 on empty po files,
316 - fixed bug #0004: occurrences that have hyphens are wrapped when they should not,
317 - changes in how encoding is handled,
318 - remove deprecation warnings for typo on "occurrences",
319 - added POEntry.__cmp__() method to sort entries like gettext does,
320 - fixed POEntry.transalated(),
321 - added a merge() method to POFile class, that behaves like the gettext msgmerge utility,
322 - obsolete entries are now written at the end of the file and with only msgid/msgstr like gettext does,
323 - fixed some bugs in mo files parsing,
324 - renamed quote/unquote functions to escape/unescape,
325 - various cosmetic changes.
326
327 Version 0.3.1 (2007/12/13)
328 --------------------------
329 - fixed bug #0002: typo on "occurrences",
330 - fixed bug #0003: mismatch in exception instance names,
331 - removed deprecation warnings,
332 - removed unused charset() method in POFile/MOFile objects,
333 - fixed bug in multibytes string length (added regression tests),
334 - fixed a bug in detect_encoding(),
335 - added a find() method to _BaseFile class,
336 - proper handling of quoting and unquoting,
337 - proper handling of multiline strings in metadata
338
339 Version 0.3.0 (2007/10/17)
340 --------------------------
341 - speed improvements,
342 - polib can now compile mo files,
343 - unicode support,
344 - fixed bug #0001: global name 'sorted' is not defined" on python 2.3.
345
346 Version 0.1.0 (2006-08-08)
347 --------------------------
348 Initial release
349
350
351