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 translitcodec

How to install translitcodec

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install translitcodec
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
Windows (64-bit)
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
Mac OS X (10.5+)
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3 Failed View build log
0.2 Failed View build log
Linux (32-bit)
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3 Failed View build log
0.2 Failed View build log
Linux (64-bit)
0.3 Available View build log
0.2 Available View build log
0.1 Available View build log
0.3 Failed View build log
0.2 Failed View build log
0.3 Failed View build log
 
License
MIT License
Imports
Lastest release
version 0.3 on Feb 14th, 2012

Unicode to 8-bit charset transliteration codec.

This package contains codecs for transliterating ISO 10646 texts into best-effort representations using smaller coded character sets (ASCII, ISO 8859, etc.). The translation tables used by the codecs are from the transtab collection by Markus Kuhn.

Three types of transliterating codecs are provided:

"long", using as many characters as needed to make a natural replacement. For example, u00e4 LATIN SMALL LETTER A WITH DIAERESIS ä will be replaced with ae.

"short", using the minimum number of characters to make a replacement. For example, u00e4 LATIN SMALL LETTER A WITH DIAERESIS ä will be replaced with a.

"one", only performing single character replacements. Characters that can not be transliterated with a single character are passed through unchanged. For example, u2639 WHITE FROWNING FACE will be passed through unchanged.

Using the codecs is simple:

>>> import translitcodec
>>> u'fácil € ☺'.encode('translit/long')

System Message: ERROR/3 (<string>, line 27)

Inconsistent literal block quoting.

u'facil EUR :-)' >>> u'fácil € ☺'.encode('translit/short') u'facil E :-)'

The codecs return Unicode by default. To receive a bytestring back, either chain the output of encode() to another codec, or append the name of the desired byte encoding to the codec name:

>>> u'fácil € ☺'.encode('translit/one').encode('ascii', 'replace')

System Message: ERROR/3 (<string>, line 36)

Inconsistent literal block quoting.

'facil E ?' >>> u'fácil € ☺'.encode('translit/one/ascii', 'replace') 'facil E ?'

The package also supplies a 'transliterate' codec, an alias for 'translit/long'.

translitcodec Changes

0.3

Released on February 14, 2011

  • Fixes to the transtab table rebuilding tool.
  • Added translitcodec.__version__
0.2

Released on January 27, 2011

  • Resolves issue of "TypeError: character mapping must return integer,

System Message: WARNING/2 (<string>, line 61)

Bullet list ends without a blank line; unexpected unindent.

None or unicode" when a blank value (eg: N{ZERO WIDTH SPACE} u200B) was encoded. Unicode blanks are now returned.

  • Characters in the ASCII range are no longer included in the translation

System Message: WARNING/2 (<string>, line 65)

Bullet list ends without a blank line; unexpected unindent.

tables.

0.1

Released on December 28, 2008

  • Initial packaged release.

Subscribe to package updates

Last updated Feb 14th, 2012

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.