Slugger iconSlugger 0.1

Slugging done right. Tries to support close to 300 languages.
Slugger is a Python tool that solves the "simple" problem of turning a title like *Headless body in topless bar* into a slug: *headless-body-in-topless-bar*.

Criterias of what makes a good slug vary, but most often they are required to have a maximum length a reduced character set that is highly URL-friendly.


Detailed docs are still missing. Here is a quick example::

    from slugger import Slugger

    s = Slugger('de', hanlang='ja')
    print s.sluggify(u'Hellö & Wörld 漢字')

This will print ``helloe-und-woerld-kan-ji``. The Slugger class itself supports a number of construction options, see ``slugger/`` for details.

You should not rely on Slugger generating the same slug across different versions, as the goal of this library is to steadily improve, either through better underlying libraries or fixes in Slugger itself.


You cannot use Slugger straight from a checkout of the repository, as *glibc*-localedata has to be parsed and pickled first. When installing a release from PyPi, this data is already included.

last updated on:
March 19th, 2012, 9:22 GMT
developed by:
Marc Brinkmann
license type:
LGPL (GNU Lesser General Public License) 
ROOT \ Programming \ Internationalization


In a hurry? Add it to your Download Basket!

user rating



Add your review!