iconkit 1.0.0__py3-none-any.whl
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.
- iconkit/__init__.py +29 -0
- iconkit/_data.py +3042 -0
- iconkit/manifest.json +94044 -0
- iconkit-1.0.0.dist-info/LICENSE +21 -0
- iconkit-1.0.0.dist-info/METADATA +52 -0
- iconkit-1.0.0.dist-info/RECORD +8 -0
- iconkit-1.0.0.dist-info/WHEEL +4 -0
- iconkit-1.0.0.dist-info/top_level.txt +1 -0
iconkit/__init__.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""IconKit — iconos SVG. iconkit.svg("home", mode="solid", size=20, color="#e05b4c")"""
|
|
2
|
+
from ._data import ICONS
|
|
3
|
+
|
|
4
|
+
_OUTLINE = 'fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"'
|
|
5
|
+
_SOLID = 'fill="currentColor" stroke="none"'
|
|
6
|
+
|
|
7
|
+
def names():
|
|
8
|
+
return sorted(ICONS.keys())
|
|
9
|
+
|
|
10
|
+
def svg(name, mode="outline", size=24, color="currentColor"):
|
|
11
|
+
rec = ICONS.get(name)
|
|
12
|
+
if rec is None:
|
|
13
|
+
raise KeyError(f"icono desconocido: {name}")
|
|
14
|
+
solid = mode == "solid" and rec[1] is not None
|
|
15
|
+
inner = rec[1] if solid else rec[0]
|
|
16
|
+
if solid:
|
|
17
|
+
wrap = f'fill="{color}" stroke="none"'
|
|
18
|
+
else:
|
|
19
|
+
wrap = f'fill="none" stroke="{color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"'
|
|
20
|
+
return (f'<svg xmlns="http://www.w3.org/2000/svg" width="{size}" height="{size}" '
|
|
21
|
+
f'viewBox="0 0 24 24" {wrap} aria-hidden="true">{inner}</svg>')
|
|
22
|
+
|
|
23
|
+
__version__ = "1.0.0"
|
|
24
|
+
|
|
25
|
+
def manifest():
|
|
26
|
+
"""Return the full icon manifest (icons, categories, keywords, aliases) as a dict."""
|
|
27
|
+
import json, os
|
|
28
|
+
with open(os.path.join(os.path.dirname(__file__), "manifest.json"), encoding="utf-8") as f:
|
|
29
|
+
return json.load(f)
|