Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install pojson

How to install pojson

  1. Download and install ActivePython
  2. Buy and install the Business Edition license from account.activestate.com
  3. Open Command Prompt
  4. Type pypm install pojson

pojson contains builds that are only available via PyPM when you have a current ActivePython Business Edition subscription.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3
0.3 Available View build log
0.1 Available View build log
Windows (64-bit)
0.3
0.3 Failed View build log
0.1 Failed View build log
Mac OS X (10.5+)
0.3
0.3 Available View build log
0.1 Available View build log
Linux (32-bit)
0.3
0.3 Available View build log
0.1 Available View build log
Linux (64-bit)
0.3
0.3 Available View build log
0.1 Available View build log
 
License
BSD
Depended by
Imports

pojson

pojson is a tool that allows you to create JSON data files from PO files. These files are designed to be used with Obviel's i18n support.

The Javascript Gettext already provides a Perl-based tool (po2json) that is very similar, so this can be seen as a rewrite to Python. One difference is that pojson does not output domain information in the resulting datastructure - it is one level less deep. The domain information must instead be supplied when the file is loaded.

Basic use to generate a JSON file:

$ pojson <path/to/po>

Pretty-print output:

$ pojson -p <path/to/po>

Help:

$ pojson --help

Normally you would send the output to a file, such as:

$ pojson something.po > something.json

Normally pojson will try to guess the encoding of the .po file, but you can also explicitly supply an encoding:

$ pojson -e utf-8 something.po > something.json

Javascript Gettext: http://jsgettext.berlios.de/

CHANGES

0.4 (2012-06-20)
  • Totally break the command line interface to simplify options. We only want to generate those JSON files that Obviel i18n likes. Works with Obviel 1.0b2 and later.
0.3 (2011-06-02)
  • Actually got the output wrong so jsgettext couldn't work with it. Fixed.
  • Some sanity checking that the input file has the .po extension, as evidently polib accepts any file and still gives output...
0.2 (2011-06-02)
  • Error when referring to non-existent po file
0.1 (2011-05-04)
  • Initial release.

Subscribe to package updates

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.