Registry / devops / awesome-slugify

awesome-slugify

JSON →
library1.6.5pypypi✓ verified 84d ago

Python flexible slugify function that supports transliteration, custom transformations, and multiple output types (lowercase, uppercase, camelcase). Version 1.6.5 is the last release; the library has been in maintenance mode since 2018 and is largely superseded by python-slugify.

pip install awesome-slugify
INSTALL
IMPORT
SIG · AWESOME-SLUGIFY
A
awesome-slugify
devopspythonv1.6.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

slugify
from slugify import slugify
from awesome_slugify import slugify
Package name has an underscore in path; best practice is to import from 'slugify', though 'awesome_slugify' also works.
UniqueSlugify
from slugify import UniqueSlugify

Basic usage: converts a string into an ASCII slug.

from slugify import slugify text = "Hello World!" result = slugify(text) print(result) # hello-world
Debug
Known issues
deprecatedLibrary is in maintenance mode with no new releases since 2018. Consider using python-slugify for active support and Unicode handling.
fix
Switch to 'python-slugify' library: pip install python-slugify and use from slugify import slugify.
affects: >=1.6.5
gotchaThe 'slugify' function by default lowers output and replaces spaces with hyphens, but does not strip leading/trailing hyphens. This can result in unexpected slugs like "-hello-".
fix
Manually strip hyphens: slugify(text).strip('-')
affects: all
gotchaInstallation via pip install awesome-slugify installs the package with name 'awesome-slugify', but the import module is 'slugify'. This mismatch often causes confusion.
fix
Import as 'from slugify import slugify' (not 'from awesome_slugify').
affects: all
Errors
Common errors & fixes
ImportError: No module named 'slugify'
Package installed as 'awesome-slugify', but import expects 'slugify'. Sometimes the module is not correctly exposed because of an older pip version or broken installation.
fix
Run: pip install --upgrade awesome-slugify
Then use: from slugify import slugify
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
slugify expects bytes input or unicode; input string might need explicit encoding.
fix
Pass Unicode strings: slugify(u'café') or decode bytes: slugify(b'caf\xc3\xa9'.decode('utf-8'))
Upgrade
Version history
1.6.5latest on PyPI · released Jun 5, 2015
Audit
Dependencies
regexrequiredused for internal regex operations
Unidecoderequiredsupport for transliteration from Unicode to ASCII
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
awesome-slugify — pip install awesome-slugify · libregistry