python-python-slugify
Port variant py311
Summary Unicode-capable slug generator (3.11)
Package version 7.0.0
Homepage https://github.com/un33k/python-slugify
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py310
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 07 JAN 2023, 04:18:24 UTC
Port created 07 JAN 2023, 04:18:24 UTC
Subpackage Descriptions
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. ### Python Versions & `Official` Support - Python `2.7` <-> python-slugify `< 5.0.0` - Python `3.6+` <-> python-slugify `>= 5.0.0` - Python `3.7+` <-> python-slugify `>= 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, entities=True, decimal=True, hexadecimal=True, max_length=0, word_boundary=False, separator='-', save_order=False, stopwords=(), regex_pattern=None, lowercase=True, replacements=(), allow_unicode=False ): """ 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") txt = 'Nín hǎo. Wǒ shì zhōng guó rén' r = slugify(txt)
Configuration Switches (platform-specific settings discarded)
PY310 OFF Build using Python 3.10 PY311 ON Build using Python 3.11
Package Dependencies by Type
Build (only) python-pip:single:py311
autoselect-python:single:standard
Build and Runtime python311:single:standard
Runtime (only) python-text-unidecode:single:py311
Download groups
main mirror://PYPIWHL/63/65/d0d7c085964fdf0cb294299663b407c38e2c8e8dd13bafcf5681798c12db
Distribution File Information
003aee64f9fd955d111549f96c4b58a3f40b9319383c70fad6277a4974bbf570 9446 python_slugify-7.0.0-py2.py3-none-any.whl
Ports that require python-python-slugify:py311
python-netbox-network-importer:py311 Tool to import network into Netbox (3.11)
python-netdoc:py311 Network Documentation plugin for NetBox (3.11)