# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-python-slugify VERSION= 8.0.4 KEYWORDS= python VARIANTS= v11 v12 SDESC[v11]= Unicode-capable slug generator (3.11) SDESC[v12]= Unicode-capable slug generator (3.12) HOMEPAGE= https://github.com/un33k/python-slugify CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/a4/62/02da182e544a51a5c3ccf4b03ab79df279f9c60c5e82d5e8bec7ca26ac11 DISTFILE[1]= python_slugify-8.0.4-py2.py3-none-any.whl:main DF_INDEX= 1 SPKGS[v11]= single SPKGS[v12]= single OPTIONS_AVAILABLE= PY311 PY312 OPTIONS_STANDARD= none VOPTS[v11]= PY311=ON PY312=OFF VOPTS[v12]= PY311=OFF PY312=ON DISTNAME= python_slugify-8.0.4.dist-info GENERATED= yes [PY311].RUN_DEPENDS_ON= python-text-unidecode:single:v11 [PY311].USES_ON= python:v11,wheel [PY312].RUN_DEPENDS_ON= python-text-unidecode:single:v12 [PY312].USES_ON= python:v12,wheel [FILE:2863:descriptions/desc.single] # Python Slugify **A Python slugify application that handles unicode**. [![status-image]][status-link] [![version-image]][version-link] [![coverage-image]][coverage-link] # Overview **Best attempt** to create slugs from unicode strings while keeping it **DRY**. # Notice This module, by default installs and uses [text-unidecode] _(GPL & Perl Artistic)_ for its decoding needs. However, there is an alternative decoding package called [Unidecode] _(GPL)_. It can be installed as `python-slugify[unidecode]` for those who prefer it. `Unidecode` is believed to be more [advanced]. ### `Official` Support Matrix | Python | Slugify | | -------------- | ------------------ | | `>= 2.7 < 3.6` | `< 5.0.0` | | `>= 3.6 < 3.7` | `>= 5.0.0 < 7.0.0` | | `>= 3.7` | `>= 7.0.0` | # How to install easy_install python-slugify |OR| easy_install python-slugify[unidecode] -- OR -- pip install python-slugify |OR| pip install python-slugify[unidecode] # Options ```python def slugify( text: str, entities: bool = True, decimal: bool = True, hexadecimal: bool = True, max_length: int = 0, word_boundary: bool = False, separator: str = DEFAULT_SEPARATOR, save_order: bool = False, stopwords: Iterable[str] = (), regex_pattern: str | None = None, lowercase: bool = True, replacements: Iterable[Iterable[str]] = (), allow_unicode: bool = False, ) -> str: """ Make a slug from the given text. :param text (str): initial text :param entities (bool): converts html entities to unicode (foo & bar -> foo-bar) :param decimal (bool): converts html decimal to unicode (Ž -> Ž -> z) :param hexadecimal (bool): converts html hexadecimal to unicode (Ž -> Ž -> z) :param max_length (int): output string length :param word_boundary (bool): truncates to end of full words (length may be shorter than max_length) :param save_order (bool): if parameter is True and max_length > 0 return whole words in the initial order :param separator (str): separator between words :param stopwords (iterable): words to discount :param regex_pattern (str): regex pattern for disallowed characters :param lowercase (bool): activate case sensitivity by setting it to False :param replacements (iterable): list of replacement rules e.g. [['|', 'or'], ['%', 'percent']] :param allow_unicode (bool): allow unicode characters :return (str): slugify text """ ``` # How to use ```python from slugify import slugify txt = "This is a test ---" r = slugify(txt) self.assertEqual(r, "this-is-a-test") txt = '影師嗎' r = slugify(txt) self.assertEqual(r, "ying-shi-ma") txt = '影師嗎' r = slugify(txt, allow_unicode=True) self.assertEqual(r, "影師嗎") txt = 'C\'est déjà l\'été.' r = slugify(txt) self.assertEqual(r, "c-est-deja-l-ete") [FILE:120:distinfo] 276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8 10051 python_slugify-8.0.4-py2.py3-none-any.whl