{"name":"awesome-slugify: A Flexible Python Slugify Function","description":"awesome-slugify is a powerful and flexible Python library designed for converting text into clean, URL-friendly slugs. It offers extensive customization options, including separators, case conversion, and length limits. The library also supports unique slug generation and comes with predefined configurations for various languages and use cases.","github":"https://github.com/dimka665/awesome-slugify","url":"https://osrepos.com/repo/dimka665-awesome-slugify","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/dimka665-awesome-slugify","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/dimka665-awesome-slugify.md","json":"https://osrepos.com/repo/dimka665-awesome-slugify.json","topics":["Python","slugify","text-processing","url-generation","web-development","utility"],"keywords":["Python","slugify","text-processing","url-generation","web-development","utility"],"stars":null,"summary":"awesome-slugify is a powerful and flexible Python library designed for converting text into clean, URL-friendly slugs. It offers extensive customization options, including separators, case conversion, and length limits. The library also supports unique slug generation and comes with predefined configurations for various languages and use cases.","content":"## Introduction\n\nawesome-slugify is a highly flexible Python library designed for converting text into clean, URL-friendly slugs. It provides robust functionality to transform various text inputs into consistent formats, handling special characters, spaces, and case sensitivity with ease. This library is ideal for generating slugs for URLs, filenames, or any other context requiring sanitized string representations.\n\n## Installation\n\nInstalling awesome-slugify is straightforward using pip:\n\nbash\npip install awesome-slugify\n\n\n## Examples\n\nHere are some examples demonstrating the versatility of awesome-slugify:\n\npython\nfrom slugify import slugify, Slugify, UniqueSlugify\nfrom slugify import slugify_url, slugify_filename\nfrom slugify import slugify_ru, slugify_de\n\n# Basic usage\nslugify('Any text')  # 'Any-text'\n\n# Customization\nslugify('Any text', to_lower=True)  # 'any-text'\n\n# Using Slugify class for persistent options\ncustom_slugify = Slugify(to_lower=True)\ncustom_slugify('Any text')          # 'any-text'\ncustom_slugify.separator = '_'\ncustom_slugify('Any text')          # 'any_text'\n\n# Generating unique slugs\nunique_slug_gen = UniqueSlugify()\nunique_slug_gen('Any text')          # 'any-text'\nunique_slug_gen('Any text')          # 'any-text-1'\n\n# Predefined slugify functions\nslugify_filename('?r?ft ?2.txt')     # Draft_2.txt\nslugify_url('?r?ft ?2.txt')          # draft-2-txt\n\n# Custom pretranslation\nmy_slugify = Slugify()\nmy_slugify.separator = '.'\nmy_slugify.pretranslate = {'?': 'i', '?': 'love'}\nmy_slugify('? ? ????')                # I.love.borshch\n\n# Language-specific slugification\nslugify_ru('? ? ????')                # Ya-borsch\nslugify_de('ÜBER Über slugify')       # UEBER-Ueber-slugify\n\n\n## Why Use It\n\nawesome-slugify stands out due to its extensive customization options and powerful features:\n\n*   **Flexibility**: Offers fine-grained control over slug generation with parameters like `to_lower`, `max_length`, `separator`, `capitalize`, `pretranslate`, `safe_chars`, and `stop_words`.\n*   **Unique Slug Generation**: The `UniqueSlugify` class ensures that generated slugs are unique, which is crucial for database entries or file systems.\n*   **Predefined Configurations**: Comes with ready-to-use slugifiers for common scenarios, such as `slugify_url` and `slugify_filename`, and supports various languages like Russian, German, and Greek.\n*   **Custom Unique Checker**: Allows integration with external systems, such as databases, to verify slug uniqueness.\n*   **Easy Integration**: Simple API makes it easy to incorporate into any Python project.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/voronind/awesome-slugify](https://github.com/voronind/awesome-slugify){:target=\"_blank\"}\n*   **PyPI Package**: [https://pypi.python.org/pypi/awesome-slugify](https://pypi.python.org/pypi/awesome-slugify){:target=\"_blank\"}","metrics":{"detailViews":1,"githubClicks":0},"dates":{"published":null,"modified":"2026-07-31T19:55:27.000Z"}}