svg-ultralight 0.45.6__tar.gz → 0.46.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.
Potentially problematic release.
This version of svg-ultralight might be problematic. Click here for more details.
- {svg_ultralight-0.45.6/src/svg_ultralight.egg-info → svg_ultralight-0.46.0}/PKG-INFO +1 -1
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/pyproject.toml +2 -2
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/image_ops.py +22 -4
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0/src/svg_ultralight.egg-info}/PKG-INFO +1 -1
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/.gitignore +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/.pre-commit-config.yaml +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/README.md +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/dev-requirements.txt +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/experiments/encode_fonts3.txt +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/experiments/font_css.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/setup.cfg +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/__init__.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/animate.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/attrib_hints.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/__init__.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/bound_helpers.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/padded_text_initializers.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/supports_bounds.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/type_bound_collection.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/type_bound_element.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/type_bounding_box.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/type_padded_text.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/constructors/__init__.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/constructors/new_element.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/font_tools/__init__.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/font_tools/comp_results.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/font_tools/font_info.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/font_tools/globs.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/inkscape.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/layout.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/main.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/metadata.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/nsmap.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/py.typed +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/query.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/root_elements.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/string_conversion.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/strings/__init__.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/strings/svg_strings.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/transformations.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/unit_conversion.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight.egg-info/SOURCES.txt +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight.egg-info/dependency_links.txt +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight.egg-info/requires.txt +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight.egg-info/top_level.txt +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/__init__.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/conftest.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/resources/arrow.svg +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_bound_element.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_bounding.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_inkscape.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_layout.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_matrices.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_metadata.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_new_element.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_padded_text_initializers.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_padding.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_queries.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_root_elements.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_string_conversion.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tests/test_svg_ultralight.py +0 -0
- {svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "svg-ultralight"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.46.0"
|
|
4
4
|
description = "a sensible way to create svg files with Python"
|
|
5
5
|
authors = [{ name = "Shay Hill", email = "shay_public@hotmail.com" }]
|
|
6
6
|
license = { text = "MIT" }
|
|
@@ -53,7 +53,7 @@ convention = "pep257"
|
|
|
53
53
|
|
|
54
54
|
[tool.commitizen]
|
|
55
55
|
name = "cz_conventional_commits"
|
|
56
|
-
version = "0.
|
|
56
|
+
version = "0.46.0"
|
|
57
57
|
tag_format = "$version"
|
|
58
58
|
version_files = ["pyproject.toml:^version"]
|
|
59
59
|
annotated_tag = true
|
|
@@ -32,6 +32,7 @@ from lxml import etree
|
|
|
32
32
|
|
|
33
33
|
from svg_ultralight import NSMAP
|
|
34
34
|
from svg_ultralight.bounding_boxes.bound_helpers import bbox_dict
|
|
35
|
+
from svg_ultralight.bounding_boxes.type_bound_element import BoundElement
|
|
35
36
|
from svg_ultralight.bounding_boxes.type_bounding_box import BoundingBox
|
|
36
37
|
from svg_ultralight.constructors import new_element
|
|
37
38
|
|
|
@@ -113,11 +114,11 @@ def _get_svg_embedded_image_str(image: ImageType) -> str:
|
|
|
113
114
|
return "data:image/png;base64," + base64_encoded_result_str
|
|
114
115
|
|
|
115
116
|
|
|
116
|
-
def
|
|
117
|
+
def new_image_blem(
|
|
117
118
|
filename: str | os.PathLike[str],
|
|
118
119
|
bbox: BoundingBox | None = None,
|
|
119
120
|
center: tuple[float, float] | None = None,
|
|
120
|
-
) ->
|
|
121
|
+
) -> BoundElement:
|
|
121
122
|
"""Create a new svg image element inside a bounding box.
|
|
122
123
|
|
|
123
124
|
:param filename: filename of source image
|
|
@@ -125,7 +126,7 @@ def new_image_elem_in_bbox(
|
|
|
125
126
|
:param center: center point for cropping. Proportions of image width and image
|
|
126
127
|
height, so the default value, (0.5, 0.5), is the true center of the image.
|
|
127
128
|
(0.4, 0.5) would crop 20% off the right side of the image.
|
|
128
|
-
:return:
|
|
129
|
+
:return: a BoundElement element with the cropped image embedded
|
|
129
130
|
"""
|
|
130
131
|
image = Image.open(filename)
|
|
131
132
|
if bbox is None:
|
|
@@ -135,4 +136,21 @@ def new_image_elem_in_bbox(
|
|
|
135
136
|
svg_image.set(
|
|
136
137
|
etree.QName(NSMAP["xlink"], "href"), _get_svg_embedded_image_str(image)
|
|
137
138
|
)
|
|
138
|
-
return svg_image
|
|
139
|
+
return BoundElement(svg_image, bbox)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def new_image_elem_in_bbox(
|
|
143
|
+
filename: str | os.PathLike[str],
|
|
144
|
+
bbox: BoundingBox | None = None,
|
|
145
|
+
center: tuple[float, float] | None = None,
|
|
146
|
+
) -> EtreeElement:
|
|
147
|
+
"""Create a new svg image element inside a bounding box.
|
|
148
|
+
|
|
149
|
+
:param filename: filename of source image
|
|
150
|
+
:param bbox: bounding box for the image
|
|
151
|
+
:param center: center point for cropping. Proportions of image width and image
|
|
152
|
+
height, so the default value, (0.5, 0.5), is the true center of the image.
|
|
153
|
+
(0.4, 0.5) would crop 20% off the right side of the image.
|
|
154
|
+
:return: an etree image element with the cropped image embedded
|
|
155
|
+
"""
|
|
156
|
+
return new_image_blem(filename, bbox, center).elem
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/__init__.py
RENAMED
|
File without changes
|
{svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/bound_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
{svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/bounding_boxes/supports_bounds.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/constructors/new_element.py
RENAMED
|
File without changes
|
|
File without changes
|
{svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight/font_tools/comp_results.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{svg_ultralight-0.45.6 → svg_ultralight-0.46.0}/src/svg_ultralight.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|