Are there any standalonenish solutions for normalizing international unicode text to safe ids and filenames in Python?
E.g. turn My International Text: åäö
to my-international-text-aao
plone.i18n does really good job, but unfortunately it depends on zope.security
and zope.publisher
and some other packages making it fragile dependency.
What you want to do is also known as "slugify" a string. Here's a possible solution:
Usage:
You can also change the delimeter:
Source: Generating Slugs
For Python 3: pastebin.com/ft7Yb3KS (thanks @MrPoxipol).