# awesome-slugify: A Flexible Python Slugify Function

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/dimka665-awesome-slugify
Generated for open source discovery and AI-assisted research.

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
OSRepos URL: https://osrepos.com/repo/dimka665-awesome-slugify

## 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.

## Topics

- Python
- slugify
- text-processing
- url-generation
- web-development
- utility

## Repository Information

Last analyzed by OSRepos: Fri Jul 31 2026 20:55:27 GMT+0100 (Western European Summer Time)
Detail views: 1
GitHub clicks: 0

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

awesome-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.

## Installation

Installing awesome-slugify is straightforward using pip:

bash
pip install awesome-slugify


## Examples

Here are some examples demonstrating the versatility of awesome-slugify:

python
from slugify import slugify, Slugify, UniqueSlugify
from slugify import slugify_url, slugify_filename
from slugify import slugify_ru, slugify_de

# Basic usage
slugify('Any text')  # 'Any-text'

# Customization
slugify('Any text', to_lower=True)  # 'any-text'

# Using Slugify class for persistent options
custom_slugify = Slugify(to_lower=True)
custom_slugify('Any text')          # 'any-text'
custom_slugify.separator = '_'
custom_slugify('Any text')          # 'any_text'

# Generating unique slugs
unique_slug_gen = UniqueSlugify()
unique_slug_gen('Any text')          # 'any-text'
unique_slug_gen('Any text')          # 'any-text-1'

# Predefined slugify functions
slugify_filename('?r?ft ?2.txt')     # Draft_2.txt
slugify_url('?r?ft ?2.txt')          # draft-2-txt

# Custom pretranslation
my_slugify = Slugify()
my_slugify.separator = '.'
my_slugify.pretranslate = {'?': 'i', '?': 'love'}
my_slugify('? ? ????')                # I.love.borshch

# Language-specific slugification
slugify_ru('? ? ????')                # Ya-borsch
slugify_de('ÜBER Über slugify')       # UEBER-Ueber-slugify


## Why Use It

awesome-slugify stands out due to its extensive customization options and powerful features:

*   **Flexibility**: Offers fine-grained control over slug generation with parameters like `to_lower`, `max_length`, `separator`, `capitalize`, `pretranslate`, `safe_chars`, and `stop_words`.
*   **Unique Slug Generation**: The `UniqueSlugify` class ensures that generated slugs are unique, which is crucial for database entries or file systems.
*   **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.
*   **Custom Unique Checker**: Allows integration with external systems, such as databases, to verify slug uniqueness.
*   **Easy Integration**: Simple API makes it easy to incorporate into any Python project.

## Links

*   **GitHub Repository**: [https://github.com/voronind/awesome-slugify](https://github.com/voronind/awesome-slugify){:target="_blank"}
*   **PyPI Package**: [https://pypi.python.org/pypi/awesome-slugify](https://pypi.python.org/pypi/awesome-slugify){:target="_blank"}