decksmith 0.1.7__py3-none-any.whl → 0.1.9__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.
- decksmith/card_builder.py +3 -0
- decksmith/validate.py +7 -1
- {decksmith-0.1.7.dist-info → decksmith-0.1.9.dist-info}/METADATA +1 -1
- {decksmith-0.1.7.dist-info → decksmith-0.1.9.dist-info}/RECORD +6 -6
- {decksmith-0.1.7.dist-info → decksmith-0.1.9.dist-info}/WHEEL +0 -0
- {decksmith-0.1.7.dist-info → decksmith-0.1.9.dist-info}/entry_points.txt +0 -0
decksmith/card_builder.py
CHANGED
|
@@ -32,6 +32,9 @@ class CardBuilder:
|
|
|
32
32
|
self.card = Image.new("RGBA", (width, height), bg_color)
|
|
33
33
|
self.draw = ImageDraw.Draw(self.card, "RGBA")
|
|
34
34
|
self.element_positions = {}
|
|
35
|
+
# Store position if id is provided
|
|
36
|
+
if "id" in spec:
|
|
37
|
+
self.element_positions[self.spec["id"]] = (0, 0, width, height)
|
|
35
38
|
|
|
36
39
|
def _calculate_absolute_position(self, element: dict) -> tuple:
|
|
37
40
|
"""
|
decksmith/validate.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Python module for validating a dictionar
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
import pandas as pd
|
|
5
6
|
from jval import validate
|
|
6
7
|
|
|
7
8
|
ELEMENT_SPEC = {
|
|
@@ -75,6 +76,7 @@ SPECS_FOR_TYPE = {
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
CARD_SPEC = {
|
|
79
|
+
"?*id": "<?str>",
|
|
78
80
|
"*width": "<?int>",
|
|
79
81
|
"*height": "<?int>",
|
|
80
82
|
"?*background_color": ["<?int>"],
|
|
@@ -120,5 +122,9 @@ def transform_card(card):
|
|
|
120
122
|
"""
|
|
121
123
|
for element in card.get("elements", []):
|
|
122
124
|
if element.get("type") == "text" and "text" in element:
|
|
123
|
-
|
|
125
|
+
if pd.isna(element["text"]):
|
|
126
|
+
element["text"] = None
|
|
127
|
+
else:
|
|
128
|
+
element["text"] = str(element["text"])
|
|
129
|
+
|
|
124
130
|
return card
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
decksmith/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
decksmith/card_builder.py,sha256=
|
|
2
|
+
decksmith/card_builder.py,sha256=oXD6XvtbNaUW-WF47v6y7GjIyg_g2giu4SEEEqq8D_c,25521
|
|
3
3
|
decksmith/deck_builder.py,sha256=8YK4ds51-z9f-BUyQ8jyh15BY9f16UQBYFI6Z87yFfU,3415
|
|
4
4
|
decksmith/export.py,sha256=aMMoGdBDQ-Gr4QJ_ziiV3F673kEyXzM0phVq14uDDJg,6225
|
|
5
5
|
decksmith/main.py,sha256=AzDq1aXziQmYz2IWdWSoBFskUeAXfOmcfYnIQUNIYp0,3357
|
|
6
6
|
decksmith/templates/deck.csv,sha256=pNJebNxoDIfM8m0-aj05YrANHih1BTKOMry1kspIpPI,462
|
|
7
7
|
decksmith/templates/deck.json,sha256=BTTnmaFP5AkbbC_B7uMF6R4bOM7JizW6EATcsjjJrT4,695
|
|
8
8
|
decksmith/utils.py,sha256=XKSapVB1_zZvYcl3LgZcHAob4Pk5HUT9AnlAQBAdeTs,2833
|
|
9
|
-
decksmith/validate.py,sha256=
|
|
10
|
-
decksmith-0.1.
|
|
11
|
-
decksmith-0.1.
|
|
12
|
-
decksmith-0.1.
|
|
13
|
-
decksmith-0.1.
|
|
9
|
+
decksmith/validate.py,sha256=uqnNs8n6IeYfZcRrQKOaZzTMZM6gGP3MS_HPyWJ9vrQ,3578
|
|
10
|
+
decksmith-0.1.9.dist-info/entry_points.txt,sha256=-usRztjj2gnfmPubb8nFYHD22drzThAmSfM6geWI98Y,48
|
|
11
|
+
decksmith-0.1.9.dist-info/METADATA,sha256=Uq5NLeafcSXqufooG6g8GTcihnyPsci0VCB-kGWkbrs,2419
|
|
12
|
+
decksmith-0.1.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
13
|
+
decksmith-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|