From a0e65ff2fff80e206421853cef4786d5ea480ba1 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 8 Dec 2016 15:15:29 +0100 Subject: [PATCH] Add Python3 slugify article --- _posts/2016-12-08-slugify-in-python3.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 _posts/2016-12-08-slugify-in-python3.md diff --git a/_posts/2016-12-08-slugify-in-python3.md b/_posts/2016-12-08-slugify-in-python3.md new file mode 100644 index 0000000..45a315d --- /dev/null +++ b/_posts/2016-12-08-slugify-in-python3.md @@ -0,0 +1,20 @@ +--- +layout: post +title: "Slugify in Python 3" +date: 2016-12-08 12:54:19 +tags: [development, python] +published: true +author: + name: Gergely Polonkai + email: gergely@polonkai.eu +--- + +Today I needed a function to create a slug (an ASCII-only representation of +a string). I went Googling a bit, and found an +excellend [Flask snippet](http://flask.pocoo.org/snippets/5/). Problem is, +it is designed for Python 2, so I came up with a Python 3 version. + +{% gist gergelypolonkai/1866fd363f75f4da5f86103952e387f6 slugify.py %} + +As I don’t really like the transliteration done in the first example +(e.g. converting ü to ue), I went with the second example.