unicode-slugify: A Robust Python Slugifier for Unicode Strings
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
unicode-slugify is a Python library developed by Mozilla, designed to generate URL-friendly slugs from strings containing Unicode characters. It offers powerful customization options, allowing users to control case, spaces, and allowed characters, making it suitable for diverse web development needs. This tool ensures that your slugs remain readable and functional across different languages.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
unicode-slugify is a versatile Python library created by Mozilla, specifically engineered to convert strings, including those with complex Unicode characters, into clean, URL-friendly slugs. This tool was initially developed for the Firefox Add-ons website, where it was crucial for generating slugs for add-ons and collections that frequently contained non-ASCII characters, requiring more sophisticated handling than simple transliteration.
Installation
To integrate unicode-slugify into your Python project, you can easily install it using pip:
pip install unicode-slugify
Examples
The library provides a straightforward API with flexible options to tailor the slug generation to your specific requirements. Here are some common usage patterns:
from slugify import slugify, SLUG_OK
# Default usage: lower, spaces replaced with "-", only alphanum and "-_~" chars, keeps unicode
slugify(u'Bän...g (bang)')
# u'bäng-bang'
# Keep capital letters and spaces
slugify(u'Bän...g (bang)', lower=False, spaces=True)
# u'Bäng bang'
# Replace non-ascii chars with their "best" representation
slugify(u'?? (capital of China)', only_ascii=True)
# u'bei-jing-capital-of-china'
# Allow some extra chars
slugify(u'?? (capital of China)', ok=SLUG_OK+'()', only_ascii=True)
# u'bei-jing-(capital-of-china)'
# "snake_case" example
def snake_case(s):
# As "-" is not in allowed Chars, first one (`_`) is used for space replacement
return slugify(s, ok='_', only_ascii=True)
snake_case(u'?? (capital of china)')
# u'bei_jing_capital_of_china'
# "CamelCase" example
def camel_case(s):
return slugify(s.title(), ok='', only_ascii=True, lower=False)
camel_case(u'?? (capital of china)')
# u'BeiJingCapitalOfChina'
Why Use unicode-slugify?
unicode-slugify stands out due to its robust handling of Unicode characters, a critical feature for applications dealing with international content. Unlike simpler slugifiers, it intelligently processes diverse character sets, ensuring that your slugs remain readable and functional across different languages. Its extensive customization options, including control over ASCII conversion, case, and allowed characters, provide developers with the flexibility needed to generate slugs that perfectly fit their application's specific URL or identifier requirements.
Links
Explore the unicode-slugify repository on GitHub for more details, to contribute, or to report issues:
Related repositories
Similar repositories that may be relevant next.

Maskit: Local Privacy Gateway for LLMs and AI Tools
September 20, 2026
Maskit is a local privacy desensitization gateway engineered for large language models and AI tools. It automatically masks sensitive data in requests sent to AI services and then seamlessly restores it in streaming responses, ensuring private information remains local. This innovative solution supports various AI assistants like Cursor and Claude Code, along with any tool offering a configurable Base URL.

CyberVerse: Self-Hosted Real-Time Digital Human Agent Platform
September 18, 2026
CyberVerse is an open-source, self-hosted platform for building real-time digital human agents. It leverages WebRTC, persona memory, tools, and RAG to create voice-first AI agents, with optional digital-human video capabilities. This powerful framework allows developers to create highly interactive and lifelike AI companions.

ctx-gate: LLM Context Gateway for Efficient Token Usage
September 16, 2026
ctx-gate is an LLM-agnostic context optimization proxy that reduces token consumption in AI interactions. It intelligently prunes conversation history and tool outputs, ensuring critical facts are retained without altering your workflow. Compatible with Anthropic and OpenAI APIs, ctx-gate helps developers manage LLM costs and maintain prompt fidelity.
Ferret MCP: AI-Powered Knowledge Extraction for Any Codebase
September 14, 2026
Ferret MCP is an MCP server designed to extract comprehensive knowledge from any codebase, combining static analysis with AI-powered deep interpretation. It provides detailed insights into architecture, patterns, dependencies, and API surface, delivering a senior engineer's analysis in seconds. This tool integrates seamlessly with various MCP clients, offering both free static analysis and advanced AI-driven reports.
Source repository
Open the original repository on GitHub.
18 counted GitHub visits