尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗sluggi — A Python library and CLI for turning any text into clean, URL-safe slugs. 20,000 strings in 0.74 seconds on the included benchmark, no runtime dependencies.
Inspired by slugify, rebuilt for Unicode and parallel batch processing. The first box out of blipbox, where agents draft and an engineer signs every release.
sluggi is the first box out of blipbox, the open-source software factory run by nimbous.
emoji extra.sluggi processes text through a modular pipeline of single-responsibility functions, making the codebase more readable, maintainable, and extensible. Each step in the pipeline performs a distinct transformation, allowing for easy customization and extension.
The steps below are the pipeline that SlugPipeline.default_pipeline() builds,
in the order they actually run.
Pipeline Steps:
pre stage, before anything else touches the text.é) and decimal/hexadecimal character references.Café becomes Cafe. Skipped for pure-ASCII input.process_transliteration=False.emoji extra and process_emoji=True (it is off by default).lowercase=True. Note this happens before words are extracted, so a custom word_regex sees text that is already lowercased.post stage, once the slug is otherwise final.Processing Flow:
Input Text
↓
pre-stage replacements
↓
decode_html_entities_and_refs
↓
normalize_unicode
↓
transliterate_text
↓
convert_emojis
↓
to_lowercase
↓
extract_words
↓
filter_stopwords
↓
join_words
↓
strip_separators
↓
truncate_slug
↓
post-stage replacements
↓
Final Slug
Replacements are staged, not a single step. A rule carries a stage of
"pre", "post", or "both", and the pipeline runs the matching rules at the
two points shown above.
The custom_map argument is converted with stage="both", so a custom mapping
is applied twice — once before normalization and once after the slug is
assembled. That is why a mapping can rewrite the separator, which only exists
after join_words:
>>> from sluggi import slugify
>>> slugify("hello world", custom_map={"-": "+"})
'hello+world'
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗