tinyslugifier 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tinyslugifier-0.1.0/PKG-INFO +26 -0
- tinyslugifier-0.1.0/README.md +3 -0
- tinyslugifier-0.1.0/pyproject.toml +36 -0
- tinyslugifier-0.1.0/setup.cfg +4 -0
- tinyslugifier-0.1.0/src/tinyslugifier/__init__.py +12 -0
- tinyslugifier-0.1.0/src/tinyslugifier.egg-info/PKG-INFO +26 -0
- tinyslugifier-0.1.0/src/tinyslugifier.egg-info/SOURCES.txt +9 -0
- tinyslugifier-0.1.0/src/tinyslugifier.egg-info/dependency_links.txt +1 -0
- tinyslugifier-0.1.0/src/tinyslugifier.egg-info/requires.txt +5 -0
- tinyslugifier-0.1.0/src/tinyslugifier.egg-info/top_level.txt +1 -0
- tinyslugifier-0.1.0/tests/test_tinyslugifier.py +14 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tinyslugifier
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A tiny slugifier for URL-friendly strings
|
|
5
|
+
Author-email: Nuno Bispo <developer@developer-service.io>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nunombispo/tinyslugifier
|
|
8
|
+
Project-URL: Documentation, https://github.com/nunombispo/tinyslugifier#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/nunombispo/tinyslugifier
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/nunombispo/tinyslugifier/issues
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: build; extra == "dev"
|
|
21
|
+
Requires-Dist: twine; extra == "dev"
|
|
22
|
+
Requires-Dist: pytest; extra == "dev"
|
|
23
|
+
|
|
24
|
+
# tinyslugifier
|
|
25
|
+
|
|
26
|
+
A tiny slugifier for URL-friendly strings. Install with `pip install tinyslugifier`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tinyslugifier"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A tiny slugifier for URL-friendly strings"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
dependencies = []
|
|
12
|
+
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Nuno Bispo", email = "developer@developer-service.io" }
|
|
15
|
+
]
|
|
16
|
+
license = { text = "MIT" }
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.8",
|
|
20
|
+
"Programming Language :: Python :: 3.9",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/nunombispo/tinyslugifier"
|
|
28
|
+
Documentation = "https://github.com/nunombispo/tinyslugifier#readme"
|
|
29
|
+
Repository = "https://github.com/nunombispo/tinyslugifier"
|
|
30
|
+
"Bug Tracker" = "https://github.com/nunombispo/tinyslugifier/issues"
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = ["build", "twine", "pytest"]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
where = ["src"]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""A tiny slugifier for URL-friendly strings."""
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def slugify(text: str) -> str:
|
|
7
|
+
"""Convert text to a URL-friendly slug (lowercase, hyphens)."""
|
|
8
|
+
if not text:
|
|
9
|
+
return ""
|
|
10
|
+
s = text.lower().strip()
|
|
11
|
+
s = re.sub(r"[^a-z0-9]+", "-", s)
|
|
12
|
+
return s.strip("-")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tinyslugifier
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A tiny slugifier for URL-friendly strings
|
|
5
|
+
Author-email: Nuno Bispo <developer@developer-service.io>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nunombispo/tinyslugifier
|
|
8
|
+
Project-URL: Documentation, https://github.com/nunombispo/tinyslugifier#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/nunombispo/tinyslugifier
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/nunombispo/tinyslugifier/issues
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: build; extra == "dev"
|
|
21
|
+
Requires-Dist: twine; extra == "dev"
|
|
22
|
+
Requires-Dist: pytest; extra == "dev"
|
|
23
|
+
|
|
24
|
+
# tinyslugifier
|
|
25
|
+
|
|
26
|
+
A tiny slugifier for URL-friendly strings. Install with `pip install tinyslugifier`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/tinyslugifier/__init__.py
|
|
4
|
+
src/tinyslugifier.egg-info/PKG-INFO
|
|
5
|
+
src/tinyslugifier.egg-info/SOURCES.txt
|
|
6
|
+
src/tinyslugifier.egg-info/dependency_links.txt
|
|
7
|
+
src/tinyslugifier.egg-info/requires.txt
|
|
8
|
+
src/tinyslugifier.egg-info/top_level.txt
|
|
9
|
+
tests/test_tinyslugifier.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tinyslugifier
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import tinyslugifier
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_slugify_basic():
|
|
5
|
+
assert tinyslugifier.slugify("Hello World!") == "hello-world"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_slugify_empty():
|
|
9
|
+
assert tinyslugifier.slugify("") == ""
|
|
10
|
+
assert tinyslugifier.slugify(" ") == ""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_slugify_strips_hyphens():
|
|
14
|
+
assert tinyslugifier.slugify("--foo--") == "foo"
|