python-python-slugify
Port variant py310
Summary Unicode-capable slug generator (3.10)
Package version 8.0.1
Homepage https://github.com/un33k/python-slugify
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v11
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 28 FEB 2023, 23:44:52 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. `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, 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")
Configuration Switches (platform-specific settings discarded)
PY310 ON Build using Python 3.10 PY311 OFF Build using Python 3.11
Package Dependencies by Type
Build (only) python-pip:single:py310
autoselect-python:single:standard
Build and Runtime python310:single:standard
Runtime (only) python-text-unidecode:single:py310
Download groups
main mirror://PYPIWHL/b4/85/6aa722a11307ec572682023b76cad4c52cda708dfc25fcb4b4a6051da7ab
Distribution File Information
70ca6ea68fe63ecc8fa4fcf00ae651fc8a5d02d93dcd12ae6d4fc7ca46c4d395 9710 python_slugify-8.0.1-py2.py3-none-any.whl
Ports that require python-python-slugify:py310
python-netbox-agent:py310 NetBox agent for server (3.10)
python-netbox-network-importer:py310 Tool to import network into Netbox (3.10)
python-netdoc:py310 Network documentation plugin for NetBox (3.10)