drawlib 0.1.36__tar.gz → 0.2.1__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 drawlib might be problematic. Click here for more details.

Files changed (65) hide show
  1. {drawlib-0.1.36 → drawlib-0.2.1}/PKG-INFO +33 -10
  2. {drawlib-0.1.36 → drawlib-0.2.1}/drawlib/__init__.py +1 -1
  3. {drawlib-0.1.36 → drawlib-0.2.1}/drawlib/__main__.py +1 -1
  4. {drawlib-0.1.36 → drawlib-0.2.1}/drawlib/apis.py +1 -1
  5. {drawlib-0.1.36/drawlib/assets/v0_1 → drawlib-0.2.1/drawlib/assets/v0_2}/__init__.py +1 -1
  6. {drawlib-0.1.36/drawlib/assets/v0_1 → drawlib-0.2.1/drawlib/assets/v0_2}/fonticons/__init__.py +1 -1
  7. {drawlib-0.1.36/drawlib/assets/v0_1 → drawlib-0.2.1/drawlib/assets/v0_2}/fonts/__init__.py +1 -1
  8. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/__init__.py +1 -1
  9. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/__main__.py +2 -2
  10. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/apis.py +12 -12
  11. drawlib-0.2.1/drawlib/v0_2/private/__init__.py +10 -0
  12. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/command.py +7 -7
  13. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/dimage.py +2 -2
  14. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/fonts.py +6 -4
  15. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/model.py +8 -8
  16. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/model_system_default.py +3 -3
  17. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/theme.py +9 -9
  18. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/theme_officials.py +3 -3
  19. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/theme_style_caches.py +7 -12
  20. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/util.py +6 -6
  21. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/base.py +7 -7
  22. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/canvas.py +10 -12
  23. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/image.py +8 -8
  24. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/line.py +5 -5
  25. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/original_arrow.py +6 -6
  26. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/original_polygon.py +6 -6
  27. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/patches.py +6 -6
  28. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/text.py +6 -6
  29. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/download.py +2 -2
  30. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/dutil/dutil_canvas.py +6 -6
  31. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/dutil/dutil_color.py +5 -5
  32. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/dutil/dutil_script.py +3 -3
  33. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/dutil/settings.py +1 -1
  34. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/icons/phosphor.py +3074 -3074
  35. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/icons/util.py +7 -7
  36. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/smartarts/bubblespeech.py +6 -6
  37. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/smartarts/dsart.py +2 -2
  38. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/smartarts/sourcecode.py +8 -8
  39. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/util.py +7 -7
  40. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/args.py +8 -8
  41. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/image.py +2 -2
  42. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/style.py +1 -1
  43. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/text.py +1 -1
  44. drawlib-0.2.1/pypi.md +77 -0
  45. {drawlib-0.1.36 → drawlib-0.2.1}/pyproject.toml +2 -8
  46. drawlib-0.1.36/drawlib/v0_1/private/__init__.py +0 -10
  47. drawlib-0.1.36/pypi.md +0 -54
  48. {drawlib-0.1.36 → drawlib-0.2.1}/LICENSE.txt +0 -0
  49. {drawlib-0.1.36 → drawlib-0.2.1}/drawlib/assets/__init__.py +0 -0
  50. {drawlib-0.1.36 → drawlib-0.2.1}/drawlib/py.typed +0 -0
  51. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/__init__.py +0 -0
  52. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core/colors.py +0 -0
  53. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/core_canvas/__init__.py +0 -0
  54. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/dutil/__init__.py +0 -0
  55. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/icons/__init__.py +0 -0
  56. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/logging.py +0 -0
  57. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/smartarts/__init__.py +0 -0
  58. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/__init__.py +0 -0
  59. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/color.py +0 -0
  60. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/coordinate.py +0 -0
  61. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/icon.py +0 -0
  62. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/line.py +0 -0
  63. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/shape.py +0 -0
  64. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/smartarts.py +0 -0
  65. {drawlib-0.1.36/drawlib/v0_1 → drawlib-0.2.1/drawlib/v0_2}/private/validators/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: drawlib
3
- Version: 0.1.36
3
+ Version: 0.2.1
4
4
  Summary: Python drawing library. Illustration as Code.
5
5
  Home-page: https://www.drawlib.com
6
6
  Author: Yuichi Ito
@@ -18,17 +18,32 @@ Description-Content-Type: text/markdown
18
18
 
19
19
  ## About
20
20
 
21
- Drawlib is a Python drawing library designed to achieve *Illustration as Code*.
21
+ Drawlib is a pure Python drawing library crafted to facilitate Illustration as Code rather than focusing solely on creating polished illustrations.
22
+ Witness Python code in action generating a circular image:
22
23
 
23
- ![Example](https://www.drawlib.com/readme_images/image1.png)
24
+ ![Example](https://www.drawlib.com/pypi_images/image1.png)
24
25
 
25
- In this example, we import drawlib APIs and call the `circle()` function. We provide XY coordinates, radius, and optional style. If a style is not provided, the default style (which you can manage) is applied.
26
+ In this example, we import drawlib APIs and call the `circle()` function.
27
+ We provide XY coordinates, radius, and optional style with `ShapeStyle` class.
28
+
29
+ Defining styles directly within the drawing object is straightforward, similar to writing styles within HTML tags.
30
+ However, just as HTML recommends using a separate CSS file, Drawlib recommends creating a separate styling code file and referencing it in multiple illustration codes.
31
+ Following this guide simplifies the above code.
32
+
33
+ ## Documentation
34
+
35
+ We have official documentation.
36
+ Please check it out if you're interested in Drawlib.
37
+
38
+ [Drawlib Official Documentation](https://www.drawlib.com/docs/)
39
+
40
+ ## API Design
26
41
 
27
42
  Drawlib offers a range of basic drawing features, including:
28
43
 
29
44
  - Icon
30
45
  - Image
31
- - Line and Arrow-line
46
+ - Line
32
47
  - Shape
33
48
  - Text
34
49
  - Others
@@ -37,18 +52,25 @@ All with a consistent syntax.
37
52
 
38
53
  Here is a brief overview of the library's API design.
39
54
 
40
- ![Example](https://www.drawlib.com/readme_images/image2.png)
55
+ ![Example](https://www.drawlib.com/pypi_images/image2.png)
41
56
 
42
57
  As you can see, the core drawing components rely on the same canvas and coordinate systems.
43
58
  Styling for each component is slightly different but mostly similar.
44
59
  If you require advanced use cases, many helper classes and functions can resolve the situation.
45
60
 
61
+ ## Good IDE Help and Python Ecosystem
62
+
46
63
  It's important to note that drawlib is a pure Python library. This means you can leverage the entire Python ecosystem, including:
47
64
 
48
65
  - Accessing library help and code completion via IDEs.
49
66
  - Using programming constructs such as creating functions for grouping drawing tasks and using loops.
50
67
 
51
- ## Why Illustration as Code
68
+ Here is a screenshot of my VS Code providing help for the `ShapeStyle` class when I point to it.
69
+ All other functions and classes are also well-documented, offering comprehensive help and intelligent code completion.
70
+
71
+ ![Example](https://www.drawlib.com/pypi_images/image3.png)
72
+
73
+ ## Good for Documentations and Books
52
74
 
53
75
  In today's world, many technical documents are managed using version control systems such as Git.
54
76
  However, managing illustrations poses a challenge as they are typically binary files rather than text-based.
@@ -56,12 +78,13 @@ Drawlib offers a solution by generating illustrations from pure Python code.
56
78
  This means that if you create your illustrations using Python and drawlib, you can manage them using version control systems too.
57
79
 
58
80
  Drawlib is optimized for drawing a large number of illustrations with a consistent style.
59
- You can easily achieve this by creating a theme file (which is simply Python code) and importing it into your illustration codes (also Python code).
81
+ You can easily achieve this by creating a style code and importing it into your illustration codes.
60
82
  Here is a typical use case of drawlib.
61
83
 
62
- ![Use Case](https://www.drawlib.com/readme_images/image3.png)
84
+ ![Use Case](https://www.drawlib.com/pypi_images/image4.png)
63
85
 
64
- We have provided examples of building Sphinx-based documentation with numerous drawlib images. If you're interested, please check out our documentation.
86
+ Integrating Drawlib into your workflow is straightforward and doesn’t significantly differ from managing markdown documents.
87
+ If you create your documentation using markdown or a similar format, you can easily adopt drawlib.
65
88
 
66
89
  ## Links
67
90
 
@@ -14,7 +14,7 @@ import sys
14
14
  from typing import Final, List
15
15
 
16
16
  # please update here when you release new version
17
- LIB_VERSION = "0.1.36"
17
+ LIB_VERSION = "0.2.1"
18
18
 
19
19
  # please list active main committers (1+ commits per month)
20
20
  AUTHORS: Final[List[str]] = [
@@ -9,7 +9,7 @@
9
9
 
10
10
  """Entry point of drawlib command."""
11
11
 
12
- from drawlib.v0_1.private.command import call
12
+ from drawlib.v0_2.private.command import call
13
13
 
14
14
 
15
15
  def main() -> None:
@@ -12,4 +12,4 @@
12
12
  """Latest API module."""
13
13
 
14
14
  # Purpose of this import is publishing APIs.
15
- from drawlib.v0_1.apis import *
15
+ from drawlib.v0_2.apis import *
@@ -7,4 +7,4 @@
7
7
  # express or implied, including but not limited to the warranties of
8
8
  # merchantability, fitness for a particular purpose and noninfringement.
9
9
 
10
- """Root of v0.1 asset package."""
10
+ """Root of v0.2 asset package."""
@@ -7,4 +7,4 @@
7
7
  # express or implied, including but not limited to the warranties of
8
8
  # merchantability, fitness for a particular purpose and noninfringement.
9
9
 
10
- """Root of v0.1 fonticon asset package."""
10
+ """Root of v0.2 fonticon asset package."""
@@ -7,4 +7,4 @@
7
7
  # express or implied, including but not limited to the warranties of
8
8
  # merchantability, fitness for a particular purpose and noninfringement.
9
9
 
10
- """Root of v0.1 font asset package."""
10
+ """Root of v0.2 font asset package."""
@@ -7,7 +7,7 @@
7
7
  # express or implied, including but not limited to the warranties of
8
8
  # merchantability, fitness for a particular purpose and noninfringement.
9
9
 
10
- """Root package of API v0.1"""
10
+ """Root package of API v0.2"""
11
11
 
12
12
  from typing import Final
13
13
 
@@ -7,9 +7,9 @@
7
7
  # express or implied, including but not limited to the warranties of
8
8
  # merchantability, fitness for a particular purpose and noninfringement.
9
9
 
10
- """Entry point of "python -m drawlib.v0_1" command."""
10
+ """Entry point of "python -m drawlib.v0_2" command."""
11
11
 
12
- from drawlib.v0_1.private.command import call
12
+ from drawlib.v0_2.private.command import call
13
13
 
14
14
  if __name__ == "__main__":
15
15
  call()
@@ -7,11 +7,11 @@
7
7
  # express or implied, including but not limited to the warranties of
8
8
  # merchantability, fitness for a particular purpose and noninfringement.
9
9
 
10
- """API v0.1 module."""
10
+ """Latest API module."""
11
11
 
12
12
  # ruff: noqa: F401
13
13
 
14
- from drawlib.v0_1.private.core.colors import (
14
+ from drawlib.v0_2.private.core.colors import (
15
15
  Colors,
16
16
  Colors140,
17
17
  ColorsBase,
@@ -19,10 +19,10 @@ from drawlib.v0_1.private.core.colors import (
19
19
  ColorsThemeEssentials,
20
20
  ColorsThemeMonochrome,
21
21
  )
22
- from drawlib.v0_1.private.core.dimage import (
22
+ from drawlib.v0_2.private.core.dimage import (
23
23
  Dimage,
24
24
  )
25
- from drawlib.v0_1.private.core.fonts import (
25
+ from drawlib.v0_2.private.core.fonts import (
26
26
  # fonts
27
27
  Font,
28
28
  FontArabic,
@@ -38,7 +38,7 @@ from drawlib.v0_1.private.core.fonts import (
38
38
  FontSourceCode,
39
39
  FontThai,
40
40
  )
41
- from drawlib.v0_1.private.core.model import (
41
+ from drawlib.v0_2.private.core.model import (
42
42
  IconStyle,
43
43
  ImageStyle,
44
44
  LineStyle,
@@ -46,10 +46,10 @@ from drawlib.v0_1.private.core.model import (
46
46
  ShapeTextStyle,
47
47
  TextStyle,
48
48
  )
49
- from drawlib.v0_1.private.core.theme import (
49
+ from drawlib.v0_2.private.core.theme import (
50
50
  dtheme,
51
51
  )
52
- from drawlib.v0_1.private.core_canvas.canvas import (
52
+ from drawlib.v0_2.private.core_canvas.canvas import (
53
53
  # shape patches
54
54
  arc,
55
55
  # shape original
@@ -88,20 +88,20 @@ from drawlib.v0_1.private.core_canvas.canvas import (
88
88
  triangle,
89
89
  wedge,
90
90
  )
91
- from drawlib.v0_1.private.dutil import (
91
+ from drawlib.v0_2.private.dutil import (
92
92
  dutil_canvas,
93
93
  dutil_color,
94
94
  dutil_script,
95
95
  )
96
- from drawlib.v0_1.private.dutil.settings import (
96
+ from drawlib.v0_2.private.dutil.settings import (
97
97
  dutil_settings,
98
98
  )
99
- from drawlib.v0_1.private.icons import (
99
+ from drawlib.v0_2.private.icons import (
100
100
  phosphor as icon_phosphor,
101
101
  )
102
- from drawlib.v0_1.private.icons.util import (
102
+ from drawlib.v0_2.private.icons.util import (
103
103
  icon,
104
104
  )
105
- from drawlib.v0_1.private.smartarts import (
105
+ from drawlib.v0_2.private.smartarts import (
106
106
  dsart,
107
107
  )
@@ -0,0 +1,10 @@
1
+ # Copyright (c) 2024 Yuichi Ito (yuichi@yuichi.com)
2
+ #
3
+ # This software is licensed under the Apache License, Version 2.0.
4
+ # For more information, please visit: https://github.com/yuichi110/drawlib
5
+ #
6
+ # This software is provided "as is", without warranty of any kind,
7
+ # express or implied, including but not limited to the warranties of
8
+ # merchantability, fitness for a particular purpose and noninfringement.
9
+
10
+ """Root package of API v0.2 implementation."""
@@ -19,12 +19,12 @@ import traceback
19
19
  from typing import List, Literal, Optional, Tuple
20
20
 
21
21
  import drawlib
22
- import drawlib.v0_1
23
- from drawlib.v0_1.private.core_canvas.canvas import clear
24
- from drawlib.v0_1.private.dutil.dutil_canvas import initialize
25
- from drawlib.v0_1.private.dutil.settings import dutil_settings
26
- from drawlib.v0_1.private.logging import logger
27
- from drawlib.v0_1.private.util import (
22
+ import drawlib.v0_2
23
+ from drawlib.v0_2.private.core_canvas.canvas import clear
24
+ from drawlib.v0_2.private.dutil.dutil_canvas import initialize
25
+ from drawlib.v0_2.private.dutil.settings import dutil_settings
26
+ from drawlib.v0_2.private.logging import logger
27
+ from drawlib.v0_2.private.util import (
28
28
  error_handler,
29
29
  get_script_relative_path,
30
30
  purge_font_cache,
@@ -48,7 +48,7 @@ def call() -> None:
48
48
  # show version
49
49
  if argparser.is_show_version():
50
50
  logger.critical(f"software={drawlib.VERSION}")
51
- logger.critical(f"api={drawlib.v0_1.VERSION}")
51
+ logger.critical(f"api={drawlib.v0_2.VERSION}")
52
52
  sys.exit(0)
53
53
 
54
54
  # purge font cache
@@ -23,11 +23,11 @@ from PIL import (
23
23
  ImageOps,
24
24
  )
25
25
 
26
- from drawlib.v0_1.private.util import (
26
+ from drawlib.v0_2.private.util import (
27
27
  error_handler,
28
28
  get_script_relative_path,
29
29
  )
30
- from drawlib.v0_1.private.validators.color import validate_color
30
+ from drawlib.v0_2.private.validators.color import validate_color
31
31
 
32
32
  list_ = list
33
33
 
@@ -15,8 +15,10 @@ from enum import Enum
15
15
  from typing import Tuple
16
16
  from urllib.parse import urljoin
17
17
 
18
- import drawlib.assets.v0_1.fonts
19
- from drawlib.v0_1.private.util import get_script_relative_path
18
+ import drawlib.assets.v0_2.fonts
19
+ from drawlib.v0_2.private.util import get_script_relative_path
20
+
21
+ ASSET_VERSION: str = "v0_2"
20
22
 
21
23
 
22
24
  def get_fontfile_tuple(path: str, md5_hash: str) -> Tuple[str, str, str]:
@@ -39,12 +41,12 @@ def get_fontfile_tuple(path: str, md5_hash: str) -> Tuple[str, str, str]:
39
41
  paths = [p for p in path.split("/") if p]
40
42
 
41
43
  # Construct the local font path
42
- dir_path = os.path.dirname(drawlib.assets.v0_1.fonts.__file__)
44
+ dir_path = os.path.dirname(drawlib.assets.v0_2.fonts.__file__)
43
45
  font_path = os.path.join(dir_path, *paths)
44
46
 
45
47
  # Construct the URL
46
48
  url = urljoin(
47
- "https://raw.githubusercontent.com/yuichi110/drawlib_assets/main/assets/v0_1/fonts/",
49
+ f"https://raw.githubusercontent.com/yuichi110/drawlib_assets/main/assets/{ASSET_VERSION}/fonts/",
48
50
  "/".join(paths),
49
51
  )
50
52
 
@@ -28,13 +28,13 @@ from typing import (
28
28
  Union,
29
29
  )
30
30
 
31
- import drawlib.v0_1.private.validators.color as color_validator
32
- import drawlib.v0_1.private.validators.coordinate as coordinate_validator
33
- import drawlib.v0_1.private.validators.icon as icon_validator
34
- import drawlib.v0_1.private.validators.line as line_validator
35
- import drawlib.v0_1.private.validators.text as text_validator
36
- import drawlib.v0_1.private.validators.types as types_validator
37
- from drawlib.v0_1.private.core.fonts import (
31
+ import drawlib.v0_2.private.validators.color as color_validator
32
+ import drawlib.v0_2.private.validators.coordinate as coordinate_validator
33
+ import drawlib.v0_2.private.validators.icon as icon_validator
34
+ import drawlib.v0_2.private.validators.line as line_validator
35
+ import drawlib.v0_2.private.validators.text as text_validator
36
+ import drawlib.v0_2.private.validators.types as types_validator
37
+ from drawlib.v0_2.private.core.fonts import (
38
38
  Font,
39
39
  FontArabic,
40
40
  FontBase,
@@ -48,7 +48,7 @@ from drawlib.v0_1.private.core.fonts import (
48
48
  FontSerif,
49
49
  FontSourceCode,
50
50
  )
51
- from drawlib.v0_1.private.util import error_handler
51
+ from drawlib.v0_2.private.util import error_handler
52
52
 
53
53
 
54
54
  @dataclasses.dataclass
@@ -9,9 +9,9 @@
9
9
 
10
10
  """Module for defining default parameter of styling models."""
11
11
 
12
- from drawlib.v0_1.private.core.colors import Colors
13
- from drawlib.v0_1.private.core.fonts import Font
14
- from drawlib.v0_1.private.core.model import (
12
+ from drawlib.v0_2.private.core.colors import Colors
13
+ from drawlib.v0_2.private.core.fonts import Font
14
+ from drawlib.v0_2.private.core.model import (
15
15
  IconStyle,
16
16
  ImageStyle,
17
17
  LineStyle,
@@ -14,12 +14,12 @@ from __future__ import annotations
14
14
 
15
15
  from typing import List, Literal, Optional, Tuple, Union
16
16
 
17
- import drawlib.v0_1.private.validators.color as color_validator
18
- import drawlib.v0_1.private.validators.text as text_validator
19
- import drawlib.v0_1.private.validators.types as types_validator
20
- from drawlib.v0_1.private.core import theme_officials
21
- from drawlib.v0_1.private.core.colors import Colors
22
- from drawlib.v0_1.private.core.fonts import (
17
+ import drawlib.v0_2.private.validators.color as color_validator
18
+ import drawlib.v0_2.private.validators.text as text_validator
19
+ import drawlib.v0_2.private.validators.types as types_validator
20
+ from drawlib.v0_2.private.core import theme_officials
21
+ from drawlib.v0_2.private.core.colors import Colors
22
+ from drawlib.v0_2.private.core.fonts import (
23
23
  Font,
24
24
  FontArabic,
25
25
  FontBase,
@@ -33,7 +33,7 @@ from drawlib.v0_1.private.core.fonts import (
33
33
  FontSerif,
34
34
  FontSourceCode,
35
35
  )
36
- from drawlib.v0_1.private.core.model import (
36
+ from drawlib.v0_2.private.core.model import (
37
37
  IconStyle,
38
38
  ImageStyle,
39
39
  LineStyle,
@@ -42,7 +42,7 @@ from drawlib.v0_1.private.core.model import (
42
42
  TextStyle,
43
43
  ThemeStyles,
44
44
  )
45
- from drawlib.v0_1.private.core.theme_style_caches import (
45
+ from drawlib.v0_2.private.core.theme_style_caches import (
46
46
  AbstractStyleCache,
47
47
  # Patch Styles
48
48
  ArcStyleCache,
@@ -92,7 +92,7 @@ from drawlib.v0_1.private.core.theme_style_caches import (
92
92
  WedgeStyleCache,
93
93
  WedgeTextStyleCache,
94
94
  )
95
- from drawlib.v0_1.private.util import error_handler
95
+ from drawlib.v0_2.private.util import error_handler
96
96
 
97
97
 
98
98
  class AllStyleModifier:
@@ -16,18 +16,18 @@ import dataclasses
16
16
  from copy import deepcopy
17
17
  from typing import List, Literal, Tuple, Union
18
18
 
19
- from drawlib.v0_1.private.core.colors import (
19
+ from drawlib.v0_2.private.core.colors import (
20
20
  Colors,
21
21
  ColorsThemeDefault,
22
22
  ColorsThemeEssentials,
23
23
  ColorsThemeMonochrome,
24
24
  )
25
- from drawlib.v0_1.private.core.fonts import (
25
+ from drawlib.v0_2.private.core.fonts import (
26
26
  Font,
27
27
  FontBase,
28
28
  FontSourceCode,
29
29
  )
30
- from drawlib.v0_1.private.core.model import (
30
+ from drawlib.v0_2.private.core.model import (
31
31
  IconStyle,
32
32
  ImageStyle,
33
33
  LineStyle,
@@ -7,17 +7,16 @@
7
7
  # express or implied, including but not limited to the warranties of
8
8
  # merchantability, fitness for a particular purpose and noninfringement.
9
9
 
10
-
11
10
  """dtheme's cache objects implementations. Auto generated codes."""
12
11
 
13
12
  from abc import ABC, abstractmethod
14
13
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
15
14
 
16
- import drawlib.v0_1.private.validators.color as color_validator
17
- import drawlib.v0_1.private.validators.style as style_validator
18
- import drawlib.v0_1.private.validators.types as type_validator
19
- from drawlib.v0_1.private.core.fonts import FontSourceCode
20
- from drawlib.v0_1.private.core.model import (
15
+ import drawlib.v0_2.private.validators.color as color_validator
16
+ import drawlib.v0_2.private.validators.style as style_validator
17
+ import drawlib.v0_2.private.validators.types as type_validator
18
+ from drawlib.v0_2.private.core.fonts import FontSourceCode
19
+ from drawlib.v0_2.private.core.model import (
21
20
  IconStyle,
22
21
  ImageStyle,
23
22
  LineStyle,
@@ -25,7 +24,7 @@ from drawlib.v0_1.private.core.model import (
25
24
  ShapeTextStyle,
26
25
  TextStyle,
27
26
  )
28
- from drawlib.v0_1.private.util import error_handler
27
+ from drawlib.v0_2.private.util import error_handler
29
28
 
30
29
  list_ = list
31
30
 
@@ -173,12 +172,9 @@ class BackgroundColorCache:
173
172
  Raises:
174
173
  ValueError: If the color format is invalid or if the name format is invalid.
175
174
  """
176
- # constant
177
- tuple_length_no_alpha = 3
178
-
179
175
  color_validator.validate_color("color", color)
180
176
  type_validator.validate_str("name", name)
181
- if len(color) == tuple_length_no_alpha:
177
+ if len(color) == 3:
182
178
  color = (color[0], color[1], color[2], 1.0)
183
179
  self._colors[name] = color
184
180
 
@@ -976,7 +972,6 @@ class TextStyleCache(AbstractStyleCache):
976
972
 
977
973
  This class provides methods to manage and manipulate TextStyle objects
978
974
  within a cache, implementing the AbstractStyleCache interface.
979
-
980
975
  """
981
976
 
982
977
  def __init__(
@@ -16,12 +16,12 @@ from typing import Any, Callable, Dict, Literal, Optional, Tuple, Union
16
16
  from matplotlib.font_manager import FontProperties
17
17
  from matplotlib.text import Text
18
18
 
19
- from drawlib.v0_1.private.core.colors import Colors
20
- from drawlib.v0_1.private.core.fonts import (
19
+ from drawlib.v0_2.private.core.colors import Colors
20
+ from drawlib.v0_2.private.core.fonts import (
21
21
  FontBase,
22
22
  FontFile,
23
23
  )
24
- from drawlib.v0_1.private.core.model import (
24
+ from drawlib.v0_2.private.core.model import (
25
25
  IconStyle,
26
26
  ImageStyle,
27
27
  LineStyle,
@@ -29,7 +29,7 @@ from drawlib.v0_1.private.core.model import (
29
29
  ShapeTextStyle,
30
30
  TextStyle,
31
31
  )
32
- from drawlib.v0_1.private.core.model_system_default import (
32
+ from drawlib.v0_2.private.core.model_system_default import (
33
33
  SYSTEM_DEFAULT_ICON_STYLE,
34
34
  SYSTEM_DEFAULT_IMAGE_STYLE,
35
35
  SYSTEM_DEFAULT_LINE_STYLE,
@@ -37,8 +37,8 @@ from drawlib.v0_1.private.core.model_system_default import (
37
37
  SYSTEM_DEFAULT_SHAPE_TEXT_STYLE,
38
38
  SYSTEM_DEFAULT_TEXT_STYLE,
39
39
  )
40
- from drawlib.v0_1.private.core.theme import dtheme
41
- from drawlib.v0_1.private.download import download_if_not_exist
40
+ from drawlib.v0_2.private.core.theme import dtheme
41
+ from drawlib.v0_2.private.download import download_if_not_exist
42
42
 
43
43
 
44
44
  class ColorUtil:
@@ -21,17 +21,17 @@ from matplotlib import pyplot
21
21
  from matplotlib.patches import PathPatch
22
22
  from matplotlib.path import Path
23
23
 
24
- import drawlib.v0_1.private.validators.args as validator
25
- from drawlib.v0_1.private.core.colors import Colors
26
- from drawlib.v0_1.private.core.dimage import Dimage
27
- from drawlib.v0_1.private.core.model import (
24
+ import drawlib.v0_2.private.validators.args as validator
25
+ from drawlib.v0_2.private.core.colors import Colors
26
+ from drawlib.v0_2.private.core.dimage import Dimage
27
+ from drawlib.v0_2.private.core.model import (
28
28
  LineStyle,
29
29
  ShapeStyle,
30
30
  ShapeTextStyle,
31
31
  )
32
- from drawlib.v0_1.private.core.theme import dtheme
33
- from drawlib.v0_1.private.core.util import ShapeUtil
34
- from drawlib.v0_1.private.util import (
32
+ from drawlib.v0_2.private.core.theme import dtheme
33
+ from drawlib.v0_2.private.core.util import ShapeUtil
34
+ from drawlib.v0_2.private.util import (
35
35
  error_handler,
36
36
  get_center_and_size,
37
37
  minus_2points,
@@ -15,23 +15,21 @@ from typing import Literal, Optional
15
15
 
16
16
  from matplotlib import pyplot
17
17
 
18
- import drawlib.v0_1.private.validators.args as validator
19
- from drawlib.v0_1.private.core.theme import dtheme
20
- from drawlib.v0_1.private.core.util import ColorUtil
21
- from drawlib.v0_1.private.core_canvas.image import CanvasImageFeature
22
- from drawlib.v0_1.private.core_canvas.line import CanvasLineFeature
23
- from drawlib.v0_1.private.core_canvas.original_arrow import CanvasOriginalArrowFeature
24
- from drawlib.v0_1.private.core_canvas.original_polygon import CanvasOriginalPolygonFeature
25
- from drawlib.v0_1.private.core_canvas.patches import CanvasPatchesFeature
26
- from drawlib.v0_1.private.core_canvas.text import CanvasTextFeature
27
- from drawlib.v0_1.private.util import (
18
+ import drawlib.v0_2.private.validators.args as validator
19
+ from drawlib.v0_2.private.core.theme import dtheme
20
+ from drawlib.v0_2.private.core.util import ColorUtil
21
+ from drawlib.v0_2.private.core_canvas.image import CanvasImageFeature
22
+ from drawlib.v0_2.private.core_canvas.line import CanvasLineFeature
23
+ from drawlib.v0_2.private.core_canvas.original_arrow import CanvasOriginalArrowFeature
24
+ from drawlib.v0_2.private.core_canvas.original_polygon import CanvasOriginalPolygonFeature
25
+ from drawlib.v0_2.private.core_canvas.patches import CanvasPatchesFeature
26
+ from drawlib.v0_2.private.core_canvas.text import CanvasTextFeature
27
+ from drawlib.v0_2.private.util import (
28
28
  error_handler,
29
29
  get_script_path,
30
30
  get_script_relative_path,
31
31
  )
32
32
 
33
- # import drawlib.v0_1.private.validators.types as types_validator
34
-
35
33
 
36
34
  class Canvas(
37
35
  CanvasImageFeature,
@@ -17,14 +17,14 @@ from matplotlib import offsetbox
17
17
  from numpy.typing import NDArray
18
18
  from PIL.Image import Image
19
19
 
20
- import drawlib.v0_1.private.validators.args as validator
21
- from drawlib.v0_1.private.core.colors import Colors
22
- from drawlib.v0_1.private.core.dimage import Dimage
23
- from drawlib.v0_1.private.core.model import ImageStyle, ShapeStyle
24
- from drawlib.v0_1.private.core.util import ImageUtil
25
- from drawlib.v0_1.private.core_canvas.base import CanvasBase
26
- from drawlib.v0_1.private.logging import logger
27
- from drawlib.v0_1.private.util import error_handler
20
+ import drawlib.v0_2.private.validators.args as validator
21
+ from drawlib.v0_2.private.core.colors import Colors
22
+ from drawlib.v0_2.private.core.dimage import Dimage
23
+ from drawlib.v0_2.private.core.model import ImageStyle, ShapeStyle
24
+ from drawlib.v0_2.private.core.util import ImageUtil
25
+ from drawlib.v0_2.private.core_canvas.base import CanvasBase
26
+ from drawlib.v0_2.private.logging import logger
27
+ from drawlib.v0_2.private.util import error_handler
28
28
 
29
29
 
30
30
  class CanvasImageFeature(CanvasBase):
@@ -16,11 +16,11 @@ from typing import List, Literal, Optional, Tuple, Union
16
16
  from matplotlib.patches import ConnectionStyle, FancyArrowPatch
17
17
  from matplotlib.path import Path
18
18
 
19
- import drawlib.v0_1.private.validators.args as validator
20
- from drawlib.v0_1.private.core.model import LineStyle
21
- from drawlib.v0_1.private.core.util import LineUtil
22
- from drawlib.v0_1.private.core_canvas.base import CanvasBase
23
- from drawlib.v0_1.private.util import error_handler
19
+ import drawlib.v0_2.private.validators.args as validator
20
+ from drawlib.v0_2.private.core.model import LineStyle
21
+ from drawlib.v0_2.private.core.util import LineUtil
22
+ from drawlib.v0_2.private.core_canvas.base import CanvasBase
23
+ from drawlib.v0_2.private.util import error_handler
24
24
 
25
25
 
26
26
  class CanvasLineFeature(CanvasBase):
@@ -12,12 +12,12 @@
12
12
 
13
13
  from typing import Literal, Optional, Tuple, Union
14
14
 
15
- import drawlib.v0_1.private.validators.args as validator
16
- from drawlib.v0_1.private.core.model import ShapeStyle, ShapeTextStyle
17
- from drawlib.v0_1.private.core.theme import dtheme
18
- from drawlib.v0_1.private.core.util import ShapeUtil
19
- from drawlib.v0_1.private.core_canvas.base import CanvasBase
20
- from drawlib.v0_1.private.util import (
15
+ import drawlib.v0_2.private.validators.args as validator
16
+ from drawlib.v0_2.private.core.model import ShapeStyle, ShapeTextStyle
17
+ from drawlib.v0_2.private.core.theme import dtheme
18
+ from drawlib.v0_2.private.core.util import ShapeUtil
19
+ from drawlib.v0_2.private.core_canvas.base import CanvasBase
20
+ from drawlib.v0_2.private.util import (
21
21
  error_handler,
22
22
  get_angle,
23
23
  get_distance,