python-slugify
A Python slugify application that also handles Unicode
Decision gist · record as of 2026-08-14
Yes. Mature, actively maintained library with zero vulnerabilities, low install friction, and a single stable dependency. MIT license is permissive. Use it when you need reliable unicode-to-slug conversion; the API is straightforward and the command-line tool adds utility for scripting.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with a single runtime dependency (text-unidecode).
- Active maintenance with recent commits and stable production status.
License · maintenance · safety
MIT (permissive) — MIT license (permissive). Default dependency text-unidecode is GPL/Artistic dual-licensed, but the package itself remains MIT and is not considered a derivative work; optional unidecode alternative available.
last release 2024-02-08 (918 days) · last repo commit 2026-04-27 · 1,622 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 89,240,435 downloads/mo, #378 on PyPI
Alternatives
Verify before relying
pip install python-slugify
from slugify import slugify
result = slugify('C\'est déjà l\'été.')
print(result) # 'c-est-deja-l-ete'- Performance characteristics with very large input strings or high-volume batch processing
- Behavior differences between text-unidecode and optional unidecode backends in edge cases
What it is and what it does
python-slugify converts arbitrary text—including unicode characters, HTML entities, accented letters, and emoji—into clean, URL-safe slugs. It handles the messy work of normalizing text: stripping accents, converting HTML entities like & and Ž, removing special characters, and joining words with a separator (hyphen by default). The package wraps text-unidecode for character decoding and offers fine-grained control via options like max_length, word_boundary truncation, stopword filtering, custom regex patterns, and character replacements.
It's used wherever URLs or identifiers need to be generated from user-supplied or multilingual text: blog post titles, product slugs, search-friendly URLs, and data normalization pipelines. The package includes both a Python API and a command-line tool, supports modern Python versions (3.7+), and has been actively maintained since 2012. No known security vulnerabilities and low installation friction make it a straightforward addition to projects that need reliable slug generation.
Use it for
- Generate URL-safe slugs from blog post titles or product names containing accents, emoji, or special characters.
- Normalize multilingual text (Chinese, Cyrillic, etc.) into ASCII-compatible identifiers for database keys or URLs.
- Truncate long titles to a maximum length while respecting word boundaries for readable slugs.
- Filter out common stopwords from slugs to keep them concise and meaningful.
- Apply custom character replacements (e.g., '|' → 'or', '%' → 'percent') before slug generation.
- Process HTML-encoded content by automatically converting entities and decimal/hex codes to readable text.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Mature, actively maintained library with zero vulnerabilities, low install friction, and a single stable dependency. MIT license is permissive. Use it when you need reliable unicode-to-slug conversion; the API is straightforward and the command-line tool adds utility for scripting.
Install
python-slugify on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency (text-unidecode). Active maintenance with recent commits and stable production status.
License in practice
MIT license (permissive). Default dependency text-unidecode is GPL/Artistic dual-licensed, but the package itself remains MIT and is not considered a derivative work; optional unidecode alternative available.
Quickstart
pip install python-slugify
from slugify import slugify
result = slugify('C\'est déjà l\'été.')
print(result) # 'c-est-deja-l-ete'
Verify before relying
- Performance characteristics with very large input strings or high-volume batch processing
- Behavior differences between text-unidecode and optional unidecode backends in edge cases
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetext-unidecode |
| Maintenance | Actively maintained 918 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 89,240,435 / month, #378 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: python_slugify-8.0.4-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “url-safe text conversion”
- python-slugifyConverts text strings—including unicode, HTML entities, and special…
- cutletCutlet converts Japanese text to romaji (Latin characters) using…
- slugifyConverts text strings into URL-safe slugs by removing accents,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also clean-text · normality · slugify · unicode-slugify · django-autoslug · escapism · Unidecode · anyascii · python-string-utils · text-unidecode