Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreikanter/python-urlify
Django's urlify.js ported to Python
https://github.com/dreikanter/python-urlify
Last synced: 15 days ago
JSON representation
Django's urlify.js ported to Python
- Host: GitHub
- URL: https://github.com/dreikanter/python-urlify
- Owner: dreikanter
- License: mit
- Created: 2013-07-25T19:21:26.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-08T10:25:06.000Z (almost 10 years ago)
- Last Synced: 2024-10-04T16:33:46.561Z (about 1 month ago)
- Language: Python
- Size: 154 KB
- Stars: 13
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-urlify
This library provides Django's [urlify.js](https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js) functionality ported to Python.
Python 2.7 and 3.3 versions are supported.
Installation:
```shell
pip install -e git+git://github.com/dreikanter/python-urlify#egg=python-urlify
```Some usage examples:
``` python
from urlify import urlifyurlify('"Fix, Schwyz!" quäkt Jürgen blöd vom Paß')
# 'fix-schwyz-quakt-jurgen-blod-vom-pass'urlify('Muļķa hipiji mēģina brīvi nogaršot celofāna žņaudzējčūsku')
# 'mulka-hipiji-megina-brivi-nogarsot-celofana-znaudzejcusk'urlify('Høj bly gom vandt fræk sexquiz på wc.')
# 'hoj-bly-gom-vandt-fraek-sexquiz-pa-wc'urlify('Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!')
# 'chuyesh-yih-docyu-ga-kumedna-zh-ti-proschajsya-bez-golfiv'urlify('Pack my box with five dozen liquor jugs.')
# 'pack-my-box-five-dozen-liquor-jugs'urlify('Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός')
# 'taxisth-alwph3-bafhs-pshmenh-gh-draskelizei-yper-nw8roy-kynos'urlify('Sveiki pasaulē!')
# 'sveiki-pasaule'urlify('Pójdźże, kiń tę chmurność w głąb flaszy!')
# 'pojdzze-kin-te-chmurnosc-w-glab-flaszy'urlify('Příšerně žluťoučký kůň úpěl ďábelské ódy.')
# 'priserne-zlutoucky-kun-upel-dabelske-ody'urlify('Põdur Zagrebi tšellomängija-följetonist Ciqo külmetas kehvas garaažis')
# 'podur-zagrebi-tsellomangija-foljetonist-ciqo-kulmetas-kehvas-garaazis'urlify('A grama é amarga')
# 'grama-e-amarga'
```Alternative implementations:
- https://gist.github.com/Paaskehare/3936118 — a very close implementation to the original JavaScript version.
- https://github.com/wuyuntao/pinyin-urlify — with chinese unicode characters to pinyin convertion.
- https://github.com/beastaugh/urlify — Ruby version.
- [urlify.js](https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js) — original JavaScript implementation released under GNU license.Copyright © 2014 by [Alex Musayev](http://alex.musayev.com).
License: [MIT](http://opensource.org/licenses/MIT).
Project home: [https://github.com/dreikanter/python-urlify](https://github.com/dreikanter/python-urlify).