hammad-python 0.0.13__py3-none-any.whl → 0.0.15__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.
Files changed (87) hide show
  1. hammad_python-0.0.15.dist-info/METADATA +184 -0
  2. hammad_python-0.0.15.dist-info/RECORD +4 -0
  3. hammad/__init__.py +0 -180
  4. hammad/_core/__init__.py +0 -1
  5. hammad/_core/_utils/__init__.py +0 -4
  6. hammad/_core/_utils/_import_utils.py +0 -182
  7. hammad/ai/__init__.py +0 -59
  8. hammad/ai/_utils.py +0 -142
  9. hammad/ai/completions/__init__.py +0 -44
  10. hammad/ai/completions/client.py +0 -729
  11. hammad/ai/completions/create.py +0 -686
  12. hammad/ai/completions/types.py +0 -711
  13. hammad/ai/completions/utils.py +0 -374
  14. hammad/ai/embeddings/__init__.py +0 -35
  15. hammad/ai/embeddings/client/__init__.py +0 -1
  16. hammad/ai/embeddings/client/base_embeddings_client.py +0 -26
  17. hammad/ai/embeddings/client/fastembed_text_embeddings_client.py +0 -200
  18. hammad/ai/embeddings/client/litellm_embeddings_client.py +0 -288
  19. hammad/ai/embeddings/create.py +0 -159
  20. hammad/ai/embeddings/types.py +0 -69
  21. hammad/base/__init__.py +0 -35
  22. hammad/base/fields.py +0 -546
  23. hammad/base/model.py +0 -1078
  24. hammad/base/utils.py +0 -280
  25. hammad/cache/__init__.py +0 -48
  26. hammad/cache/base_cache.py +0 -181
  27. hammad/cache/cache.py +0 -169
  28. hammad/cache/decorators.py +0 -261
  29. hammad/cache/file_cache.py +0 -80
  30. hammad/cache/ttl_cache.py +0 -74
  31. hammad/cli/__init__.py +0 -33
  32. hammad/cli/animations.py +0 -604
  33. hammad/cli/plugins.py +0 -781
  34. hammad/cli/styles/__init__.py +0 -55
  35. hammad/cli/styles/settings.py +0 -139
  36. hammad/cli/styles/types.py +0 -358
  37. hammad/cli/styles/utils.py +0 -480
  38. hammad/configuration/__init__.py +0 -35
  39. hammad/configuration/configuration.py +0 -564
  40. hammad/data/__init__.py +0 -39
  41. hammad/data/collections/__init__.py +0 -34
  42. hammad/data/collections/base_collection.py +0 -58
  43. hammad/data/collections/collection.py +0 -452
  44. hammad/data/collections/searchable_collection.py +0 -556
  45. hammad/data/collections/vector_collection.py +0 -603
  46. hammad/data/databases/__init__.py +0 -21
  47. hammad/data/databases/database.py +0 -902
  48. hammad/json/__init__.py +0 -21
  49. hammad/json/converters.py +0 -152
  50. hammad/logging/__init__.py +0 -35
  51. hammad/logging/decorators.py +0 -834
  52. hammad/logging/logger.py +0 -954
  53. hammad/multimodal/__init__.py +0 -24
  54. hammad/multimodal/audio.py +0 -96
  55. hammad/multimodal/image.py +0 -80
  56. hammad/multithreading/__init__.py +0 -304
  57. hammad/py.typed +0 -0
  58. hammad/pydantic/__init__.py +0 -43
  59. hammad/pydantic/converters.py +0 -623
  60. hammad/pydantic/models/__init__.py +0 -28
  61. hammad/pydantic/models/arbitrary_model.py +0 -46
  62. hammad/pydantic/models/cacheable_model.py +0 -79
  63. hammad/pydantic/models/fast_model.py +0 -318
  64. hammad/pydantic/models/function_model.py +0 -176
  65. hammad/pydantic/models/subscriptable_model.py +0 -63
  66. hammad/text/__init__.py +0 -82
  67. hammad/text/converters.py +0 -723
  68. hammad/text/markdown.py +0 -131
  69. hammad/text/text.py +0 -1066
  70. hammad/types/__init__.py +0 -11
  71. hammad/types/file.py +0 -358
  72. hammad/typing/__init__.py +0 -407
  73. hammad/web/__init__.py +0 -43
  74. hammad/web/http/__init__.py +0 -1
  75. hammad/web/http/client.py +0 -944
  76. hammad/web/models.py +0 -245
  77. hammad/web/openapi/__init__.py +0 -0
  78. hammad/web/openapi/client.py +0 -740
  79. hammad/web/search/__init__.py +0 -1
  80. hammad/web/search/client.py +0 -988
  81. hammad/web/utils.py +0 -472
  82. hammad/yaml/__init__.py +0 -30
  83. hammad/yaml/converters.py +0 -19
  84. hammad_python-0.0.13.dist-info/METADATA +0 -38
  85. hammad_python-0.0.13.dist-info/RECORD +0 -85
  86. {hammad_python-0.0.13.dist-info → hammad_python-0.0.15.dist-info}/WHEEL +0 -0
  87. {hammad_python-0.0.13.dist-info → hammad_python-0.0.15.dist-info}/licenses/LICENSE +0 -0
@@ -1,55 +0,0 @@
1
- """hammad.cli.styles
2
-
3
- Contains resources, types and other utilities in context of
4
- styling rendered content in the CLI. Most resources within this
5
- submodule are not meant for direct use."""
6
-
7
- from typing import TYPE_CHECKING
8
- from ..._core._utils._import_utils import _auto_create_getattr_loader
9
-
10
- if TYPE_CHECKING:
11
- from .settings import (
12
- CLIStyleRenderableSettings,
13
- CLIStyleLiveSettings,
14
- CLIStyleBackgroundSettings,
15
- )
16
- from .types import (
17
- CLIStyleBackgroundType,
18
- CLIStyleBoxName,
19
- CLIStyleColorName,
20
- CLIStyleError,
21
- CLIStyleJustifyMethod,
22
- CLIStyleOverflowMethod,
23
- CLIStyleStyleName,
24
- CLIStyleType,
25
- CLIStyleVerticalOverflowMethod,
26
- )
27
- from .utils import live_render, style_renderable
28
-
29
-
30
- __all__ = (
31
- # hammad.cli.styles.settings
32
- "CLIStyleRenderableSettings",
33
- "CLIStyleLiveSettings",
34
- "CLIStyleBackgroundSettings",
35
- # hammad.cli.styles.types
36
- "CLIStyleBackgroundType",
37
- "CLIStyleBoxName",
38
- "CLIStyleColorName",
39
- "CLIStyleError",
40
- "CLIStyleJustifyMethod",
41
- "CLIStyleOverflowMethod",
42
- "CLIStyleStyleName",
43
- "CLIStyleType",
44
- "CLIStyleVerticalOverflowMethod",
45
- # hammad.cli.styles.utils
46
- "live_render",
47
- "style_renderable",
48
- )
49
-
50
-
51
- __getattr__ = _auto_create_getattr_loader(__all__)
52
-
53
-
54
- def __dir__() -> list[str]:
55
- return list(__all__)
@@ -1,139 +0,0 @@
1
- """hammad.cli.styles.settings"""
2
-
3
- from typing import Any
4
- from typing_extensions import TypedDict, NotRequired
5
-
6
- from .types import (
7
- CLIStyleColorName,
8
- CLIStyleBoxName,
9
- CLIStyleJustifyMethod,
10
- CLIStyleOverflowMethod,
11
- CLIStyleVerticalOverflowMethod,
12
- )
13
-
14
- __all__ = (
15
- "CLIStyleRenderableSettings",
16
- "CLIStyleBackgroundSettings",
17
- "CLIStyleLiveSettings",
18
- )
19
-
20
-
21
- class CLIStyleRenderableSettings(TypedDict, total=False):
22
- """Extended dictionary definition of settings that can be
23
- applied to style various renderable content. These settings
24
- extend the settings within `rich.text.Text` and
25
- `rich.style.Style`.
26
-
27
- When using various stylable modules in the `hammad` package,
28
- you can either define the `style` parameter with a rich string
29
- tag with a color / style name. or apply the `style_settings`
30
- parameter with these settings."""
31
-
32
- color: NotRequired[CLIStyleColorName]
33
- """The color of the renderable output or content."""
34
-
35
- # rich.text
36
-
37
- justify: NotRequired[CLIStyleJustifyMethod]
38
- """The justification of the renderable output or content."""
39
- overflow: NotRequired[CLIStyleOverflowMethod | int]
40
- """The overflow method of the renderable output or content."""
41
- no_wrap: NotRequired[bool]
42
- """Whether the renderable output or content should be wrapped."""
43
- end: NotRequired[str]
44
- """The end character of the renderable output or content."""
45
- tab_size: NotRequired[int]
46
- """The tab size of the renderable output or content."""
47
- spans: NotRequired[list[Any]]
48
- """The spans of the renderable output or content."""
49
-
50
- # rich.style
51
-
52
- bold: NotRequired[bool]
53
- """Whether the renderable output or content should be bold."""
54
- dim: NotRequired[bool]
55
- """Whether the renderable output or content should be dimmed."""
56
- italic: NotRequired[bool]
57
- """Whether the renderable output or content should be italicized."""
58
- underline: NotRequired[bool]
59
- """Whether the renderable output or content should be underlined."""
60
- blink: NotRequired[bool]
61
- """Whether the renderable output or content should blink."""
62
- blink2: NotRequired[bool]
63
- """Whether the renderable output or content should blink twice."""
64
- reverse: NotRequired[bool]
65
- """Whether the renderable output or content should be reversed."""
66
- conceal: NotRequired[bool]
67
- """Whether the renderable output or content should be concealed."""
68
- strike: NotRequired[bool]
69
- """Whether the renderable output or content should be struck through."""
70
- underline2: NotRequired[bool]
71
- """Whether the renderable output or content should be underlined twice."""
72
- frame: NotRequired[bool]
73
- """Whether the renderable output or content should be framed."""
74
- encircle: NotRequired[bool]
75
- """Whether the renderable output or content should be encircled."""
76
- overline: NotRequired[bool]
77
- """Whether the renderable output or content should be overlined."""
78
- link: NotRequired[str]
79
- """The link to be applied to the renderable output or content."""
80
-
81
-
82
- class CLIStyleBackgroundSettings(TypedDict, total=False):
83
- """Extended dictionary definition of settings that can be
84
- applied to style various background content. These settings
85
- extend the settings within `rich.box.Box` and `rich.panel.Panel`.
86
-
87
- When using various stylable modules in the `hammad` package,
88
- you can either define the `bg` parameter with a rich string
89
- tag with a color / style name. or apply the `bg_settings`
90
- parameter with these settings."""
91
-
92
- box: NotRequired[CLIStyleBoxName]
93
- """The box style to be applied to the background."""
94
- title: NotRequired[str]
95
- """The title of the background."""
96
- subtitle: NotRequired[str]
97
- """The subtitle of the background."""
98
- title_align: NotRequired[CLIStyleJustifyMethod]
99
- """The alignment of the title."""
100
- subtitle_align: NotRequired[CLIStyleJustifyMethod]
101
- """The alignment of the subtitle."""
102
- safe_box: NotRequired[bool]
103
- """Whether the box should be safe."""
104
- expand: NotRequired[bool]
105
- """Whether the box should be expanded."""
106
- style: NotRequired[CLIStyleRenderableSettings]
107
- """The style of the background."""
108
- border_style: NotRequired[CLIStyleRenderableSettings]
109
- """The style of the border."""
110
- width: NotRequired[int]
111
- """The width of the background."""
112
- height: NotRequired[int]
113
- """The height of the background."""
114
- padding: NotRequired[int]
115
- """The padding of the background."""
116
- highlight: NotRequired[bool]
117
- """Whether the background should be highlighted."""
118
-
119
-
120
- class CLIStyleLiveSettings(TypedDict, total=False):
121
- """Dictionary definition of settings for content rendered
122
- with `rich.live.Live`."""
123
-
124
- screen: NotRequired[bool]
125
- """Whether the live renderable should be displayed in a screen."""
126
- duration: NotRequired[float]
127
- """The duration of the live renderable."""
128
- refresh_rate: NotRequired[int]
129
- """The refresh rate of the live renderable."""
130
- auto_refresh: NotRequired[bool]
131
- """Whether the live renderable should be automatically refreshed."""
132
- transient: NotRequired[bool]
133
- """Whether the live renderable should be transient."""
134
- redirect_stdout: NotRequired[bool]
135
- """Whether the live renderable should redirect stdout."""
136
- redirect_stderr: NotRequired[bool]
137
- """Whether the live renderable should redirect stderr."""
138
- vertical_overflow: NotRequired[CLIStyleVerticalOverflowMethod]
139
- """The vertical overflow method of the live renderable."""
@@ -1,358 +0,0 @@
1
- """hammad.cli.styles.types"""
2
-
3
- from typing import Literal, Union
4
- from typing_extensions import TypeAliasType
5
-
6
- __all__ = (
7
- "CLIStyleError",
8
- "CLIStyleVerticalOverflowMethod",
9
- "CLIStyleJustifyMethod",
10
- "CLIStyleOverflowMethod",
11
- "CLIStyleColorName",
12
- "CLIStyleStyleName",
13
- "CLIStyleBoxName",
14
- "CLIStyleType",
15
- "CLIStyleBackgroundType",
16
- )
17
-
18
-
19
- class CLIStyleError(Exception):
20
- """Exception raised for any errors related to the
21
- rich styling of some rendered content."""
22
-
23
- def __init__(self, message: str) -> None:
24
- self.message = message
25
- super().__init__(self.message)
26
-
27
-
28
- CLIStyleVerticalOverflowMethod = TypeAliasType(
29
- "CLIStyleVerticalOverflowMethod",
30
- Literal[
31
- "crop",
32
- "ellipsis",
33
- "visible",
34
- ],
35
- )
36
- """Literal helper alias providing type hinting for the various compatible
37
- vertical overflow methods within the `rich` library."""
38
-
39
-
40
- CLIStyleJustifyMethod = TypeAliasType(
41
- "CLIStyleJustifyMethod",
42
- Literal[
43
- "left",
44
- "center",
45
- "right",
46
- ],
47
- )
48
- """Literal helper alias providing type hinting for the various compatible
49
- justify methods within the `rich` library."""
50
-
51
-
52
- CLIStyleOverflowMethod = TypeAliasType(
53
- "CLIStyleOverflowMethod",
54
- Literal[
55
- "crop",
56
- "fold",
57
- "ellipsis",
58
- "ignore",
59
- ],
60
- )
61
- """Literal helper alias providing type hinting for the various compatible
62
- overflow methods within the `rich` library."""
63
-
64
-
65
- CLIStyleColorName = TypeAliasType(
66
- "CLIStyleColorName",
67
- Literal[
68
- "black",
69
- "red",
70
- "green",
71
- "yellow",
72
- "blue",
73
- "magenta",
74
- "cyan",
75
- "white",
76
- "bright_black",
77
- "bright_red",
78
- "bright_green",
79
- "bright_yellow",
80
- "bright_blue",
81
- "bright_magenta",
82
- "bright_cyan",
83
- "bright_white",
84
- "grey0",
85
- "navy_blue",
86
- "dark_blue",
87
- "blue3",
88
- "blue1",
89
- "dark_green",
90
- "deep_sky_blue4",
91
- "dodger_blue3",
92
- "dodger_blue2",
93
- "green4",
94
- "spring_green4",
95
- "turquoise4",
96
- "deep_sky_blue3",
97
- "dodger_blue1",
98
- "dark_cyan",
99
- "light_sea_green",
100
- "deep_sky_blue2",
101
- "deep_sky_blue1",
102
- "green3",
103
- "spring_green3",
104
- "cyan3",
105
- "dark_turquoise",
106
- "turquoise2",
107
- "green1",
108
- "spring_green2",
109
- "spring_green1",
110
- "medium_spring_green",
111
- "cyan2",
112
- "cyan1",
113
- "purple4",
114
- "purple3",
115
- "blue_violet",
116
- "grey37",
117
- "medium_purple4",
118
- "slate_blue3",
119
- "royal_blue1",
120
- "chartreuse4",
121
- "pale_turquoise4",
122
- "steel_blue",
123
- "steel_blue3",
124
- "cornflower_blue",
125
- "dark_sea_green4",
126
- "cadet_blue",
127
- "sky_blue3",
128
- "chartreuse3",
129
- "sea_green3",
130
- "aquamarine3",
131
- "medium_turquoise",
132
- "steel_blue1",
133
- "sea_green2",
134
- "sea_green1",
135
- "dark_slate_gray2",
136
- "dark_red",
137
- "dark_magenta",
138
- "orange4",
139
- "light_pink4",
140
- "plum4",
141
- "medium_purple3",
142
- "slate_blue1",
143
- "wheat4",
144
- "grey53",
145
- "light_slate_grey",
146
- "medium_purple",
147
- "light_slate_blue",
148
- "yellow4",
149
- "dark_sea_green",
150
- "light_sky_blue3",
151
- "sky_blue2",
152
- "chartreuse2",
153
- "pale_green3",
154
- "dark_slate_gray3",
155
- "sky_blue1",
156
- "chartreuse1",
157
- "light_green",
158
- "aquamarine1",
159
- "dark_slate_gray1",
160
- "deep_pink4",
161
- "medium_violet_red",
162
- "dark_violet",
163
- "purple",
164
- "medium_orchid3",
165
- "medium_orchid",
166
- "dark_goldenrod",
167
- "rosy_brown",
168
- "grey63",
169
- "medium_purple2",
170
- "medium_purple1",
171
- "dark_khaki",
172
- "navajo_white3",
173
- "grey69",
174
- "light_steel_blue3",
175
- "light_steel_blue",
176
- "dark_olive_green3",
177
- "dark_sea_green3",
178
- "light_cyan3",
179
- "light_sky_blue1",
180
- "green_yellow",
181
- "dark_olive_green2",
182
- "pale_green1",
183
- "dark_sea_green2",
184
- "pale_turquoise1",
185
- "red3",
186
- "deep_pink3",
187
- "magenta3",
188
- "dark_orange3",
189
- "indian_red",
190
- "hot_pink3",
191
- "hot_pink2",
192
- "orchid",
193
- "orange3",
194
- "light_salmon3",
195
- "light_pink3",
196
- "pink3",
197
- "plum3",
198
- "violet",
199
- "gold3",
200
- "light_goldenrod3",
201
- "tan",
202
- "misty_rose3",
203
- "thistle3",
204
- "plum2",
205
- "yellow3",
206
- "khaki3",
207
- "light_yellow3",
208
- "grey84",
209
- "light_steel_blue1",
210
- "yellow2",
211
- "dark_olive_green1",
212
- "dark_sea_green1",
213
- "honeydew2",
214
- "light_cyan1",
215
- "red1",
216
- "deep_pink2",
217
- "deep_pink1",
218
- "magenta2",
219
- "magenta1",
220
- "orange_red1",
221
- "indian_red1",
222
- "hot_pink",
223
- "medium_orchid1",
224
- "dark_orange",
225
- "salmon1",
226
- "light_coral",
227
- "pale_violet_red1",
228
- "orchid2",
229
- "orchid1",
230
- "orange1",
231
- "sandy_brown",
232
- "light_salmon1",
233
- "light_pink1",
234
- "pink1",
235
- "plum1",
236
- "gold1",
237
- "light_goldenrod2",
238
- "navajo_white1",
239
- "misty_rose1",
240
- "thistle1",
241
- "yellow1",
242
- "light_goldenrod1",
243
- "khaki1",
244
- "wheat1",
245
- "cornsilk1",
246
- "grey100",
247
- "grey3",
248
- "grey7",
249
- "grey11",
250
- "grey15",
251
- "grey19",
252
- "grey23",
253
- "grey27",
254
- "grey30",
255
- "grey35",
256
- "grey39",
257
- "grey42",
258
- "grey46",
259
- "grey50",
260
- "grey54",
261
- "grey58",
262
- "grey62",
263
- "grey66",
264
- "grey70",
265
- "grey74",
266
- "grey78",
267
- "grey82",
268
- "grey85",
269
- "grey89",
270
- "grey93",
271
- "default",
272
- ],
273
- )
274
- """Literal helper alias providing type hinting for the various compatible color names
275
- within the `rich` library."""
276
-
277
-
278
- CLIStyleStyleName = TypeAliasType(
279
- "CLIStyleStyleName",
280
- Literal[
281
- "dim",
282
- "d",
283
- "bold",
284
- "b",
285
- "italic",
286
- "i",
287
- "underline",
288
- "u",
289
- "blink",
290
- "blink2",
291
- "reverse",
292
- "r",
293
- "conceal",
294
- "c",
295
- "strike",
296
- "s",
297
- "underline2",
298
- "uu",
299
- "frame",
300
- "encircle",
301
- "overline",
302
- "o",
303
- "on",
304
- "not",
305
- "link",
306
- "none",
307
- ],
308
- )
309
- """Literal helper alias providing type hinting for the various compatible
310
- style names within the `rich` library."""
311
-
312
-
313
- CLIStyleBoxName = TypeAliasType(
314
- "StyleBoxName",
315
- Literal[
316
- "ascii",
317
- "ascii2",
318
- "ascii_double_head",
319
- "square",
320
- "square_double_head",
321
- "minimal",
322
- "minimal_heavy_head",
323
- "minimal_double_head",
324
- "simple",
325
- "simple_head",
326
- "simple_heavy",
327
- "horizontals",
328
- "rounded",
329
- "heavy",
330
- "heavy_edge",
331
- "heavy_head",
332
- "double",
333
- "double_edge",
334
- "markdown",
335
- ],
336
- )
337
- """Literal helper alias providing type hinting for the various compatible
338
- box names within the `rich` library."""
339
-
340
-
341
- # ------------------------------------------------------------
342
- # 'Exported' (Hinted) Typed
343
-
344
-
345
- CLIStyleType = TypeAliasType(
346
- "CLIStyleType", Union[str | CLIStyleStyleName, CLIStyleColorName]
347
- )
348
- """Union helper alias for the accepted inputs within modules
349
- that incorporate the `style` parameter within the
350
- `hammad` package."""
351
-
352
-
353
- CLIStyleBackgroundType = TypeAliasType(
354
- "CLIStyleBackgroundType", Union[str | CLIStyleBoxName, CLIStyleColorName]
355
- )
356
- """Union helper alias for the accepted inputs within modules
357
- that incorporate the `bg` parameter within the
358
- `hammad` package."""