Ravenports generated: 04 Feb 2024 05:27
[ravenports.git] / bucket_4F / python-python-slugify
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-python-slugify
4 VERSION=                8.0.3
5 KEYWORDS=               python
6 VARIANTS=               v11 v12
7 SDESC[v11]=             Unicode-capable slug generator (3.11)
8 SDESC[v12]=             Unicode-capable slug generator (3.12)
9 HOMEPAGE=               https://github.com/un33k/python-slugify
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/f3/00/d1f681edfd12ba85259932ed08840dc672676e99ffdc8ff34911a8a5f477
14 DISTFILE[1]=            python_slugify-8.0.3-py2.py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[v11]=             single
17 SPKGS[v12]=             single
18
19 OPTIONS_AVAILABLE=      PY311 PY312
20 OPTIONS_STANDARD=       none
21 VOPTS[v11]=             PY311=ON PY312=OFF
22 VOPTS[v12]=             PY311=OFF PY312=ON
23
24 DISTNAME=               python_slugify-8.0.3.dist-info
25
26 GENERATED=              yes
27
28 [PY311].RUN_DEPENDS_ON=                 python-text-unidecode:single:v11
29 [PY311].USES_ON=                        python:v11,wheel
30
31 [PY312].RUN_DEPENDS_ON=                 python-text-unidecode:single:v12
32 [PY312].USES_ON=                        python:v12,wheel
33
34 [FILE:2863:descriptions/desc.single]
35 # Python Slugify
36
37 **A Python slugify application that handles unicode**.
38
39 [![status-image]][status-link]
40 [![version-image]][version-link]
41 [![coverage-image]][coverage-link]
42
43 # Overview
44
45 **Best attempt** to create slugs from unicode strings while keeping it
46 **DRY**.
47
48 # Notice
49
50 This module, by default installs and uses [text-unidecode] _(GPL & Perl
51 Artistic)_ for its decoding needs.
52
53 However, there is an alternative decoding package called [Unidecode]
54 _(GPL)_. It can be installed as `python-slugify[unidecode]` for those who
55 prefer it. `Unidecode` is believed to be more [advanced].
56
57 ### `Official` Support Matrix
58
59 | Python         | Slugify            |
60 | -------------- | ------------------ |
61 | `>= 2.7 < 3.6` | `< 5.0.0`          |
62 | `>= 3.6 < 3.7` | `>= 5.0.0 < 7.0.0` |
63 | `>= 3.7`       | `>= 7.0.0`         |
64
65 # How to install
66
67     easy_install python-slugify |OR| easy_install python-slugify[unidecode]
68     -- OR --
69     pip install python-slugify |OR| pip install python-slugify[unidecode]
70
71 # Options
72
73 ```python
74 def slugify(
75     text: str,
76     entities: bool = True,
77     decimal: bool = True,
78     hexadecimal: bool = True,
79     max_length: int = 0,
80     word_boundary: bool = False,
81     separator: str = DEFAULT_SEPARATOR,
82     save_order: bool = False,
83     stopwords: Iterable[str] = (),
84     regex_pattern: str | None = None,
85     lowercase: bool = True,
86     replacements: Iterable[Iterable[str]] = (),
87     allow_unicode: bool = False,
88 ) -> str:
89   """
90   Make a slug from the given text.
91   :param text (str): initial text
92   :param entities (bool): converts html entities to unicode (foo &amp; bar
93 -> foo-bar)
94   :param decimal (bool): converts html decimal to unicode (&#381; -> Ž ->
95 z)
96   :param hexadecimal (bool): converts html hexadecimal to unicode (&#x17D;
97 -> Ž -> z)
98   :param max_length (int): output string length
99   :param word_boundary (bool): truncates to end of full words (length may
100 be shorter than max_length)
101   :param save_order (bool): if parameter is True and max_length > 0 return
102 whole words in the initial order
103   :param separator (str): separator between words
104   :param stopwords (iterable): words to discount
105   :param regex_pattern (str): regex pattern for disallowed characters
106   :param lowercase (bool): activate case sensitivity by setting it to False
107   :param replacements (iterable): list of replacement rules e.g. [['|',
108 'or'], ['%', 'percent']]
109   :param allow_unicode (bool): allow unicode characters
110   :return (str): slugify text
111   """
112 ```
113
114 # How to use
115
116 ```python
117 from slugify import slugify
118
119 txt = "This is a test ---"
120 r = slugify(txt)
121 self.assertEqual(r, "this-is-a-test")
122
123 txt = '影師嗎'
124 r = slugify(txt)
125 self.assertEqual(r, "ying-shi-ma")
126
127 txt = '影師嗎'
128 r = slugify(txt, allow_unicode=True)
129 self.assertEqual(r, "影師嗎")
130
131 txt = 'C\'est déjà l\'été.'
132 r = slugify(txt)
133 self.assertEqual(r, "c-est-deja-l-ete")
134
135
136
137 [FILE:120:distinfo]
138 c71189c161e8c671f1b141034d9a56308a8a5978cd13d40446c879569212fdd1        10055 python_slugify-8.0.3-py2.py3-none-any.whl
139