decksmith 0.1.7__tar.gz → 0.1.9__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.
- {decksmith-0.1.7 → decksmith-0.1.9}/PKG-INFO +1 -1
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/card_builder.py +3 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/validate.py +7 -1
- {decksmith-0.1.7 → decksmith-0.1.9}/pyproject.toml +2 -2
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/__init__.py +0 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/deck_builder.py +0 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/export.py +0 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/main.py +0 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/templates/deck.csv +0 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/templates/deck.json +0 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/decksmith/utils.py +0 -0
- {decksmith-0.1.7 → decksmith-0.1.9}/docs/README.md +0 -0
|
@@ -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
|
"""
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "decksmith"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.9"
|
|
4
4
|
description = "A command-line application to dynamically generate decks of cards from a JSON specification and a CSV data file, inspired by nandeck."
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Julio Cabria", email = "juliocabria@tutanota.com"},
|
|
@@ -24,7 +24,7 @@ dev = [
|
|
|
24
24
|
|
|
25
25
|
[tool.poetry]
|
|
26
26
|
name = "decksmith"
|
|
27
|
-
version = "0.1.
|
|
27
|
+
version = "0.1.9"
|
|
28
28
|
description = "A command-line application to dynamically generate decks of cards from a JSON specification and a CSV data file, inspired by nandeck."
|
|
29
29
|
authors = ["Julio Cabria <juliocabria@tutanota.com>"]
|
|
30
30
|
license = "GPL-2.0-only"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|