hammad-python 0.0.10__py3-none-any.whl → 0.0.12__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 (96) hide show
  1. hammad/__init__.py +177 -10
  2. hammad/_core/__init__.py +1 -0
  3. hammad/_core/_utils/__init__.py +4 -0
  4. hammad/_core/_utils/_import_utils.py +182 -0
  5. hammad/ai/__init__.py +59 -0
  6. hammad/ai/_utils.py +142 -0
  7. hammad/ai/completions/__init__.py +44 -0
  8. hammad/ai/completions/client.py +729 -0
  9. hammad/ai/completions/create.py +686 -0
  10. hammad/ai/completions/types.py +711 -0
  11. hammad/ai/completions/utils.py +374 -0
  12. hammad/ai/embeddings/__init__.py +35 -0
  13. hammad/ai/embeddings/client/__init__.py +1 -0
  14. hammad/ai/embeddings/client/base_embeddings_client.py +26 -0
  15. hammad/ai/embeddings/client/fastembed_text_embeddings_client.py +200 -0
  16. hammad/ai/embeddings/client/litellm_embeddings_client.py +288 -0
  17. hammad/ai/embeddings/create.py +159 -0
  18. hammad/ai/embeddings/types.py +69 -0
  19. hammad/base/__init__.py +35 -0
  20. hammad/base/fields.py +546 -0
  21. hammad/base/model.py +1078 -0
  22. hammad/base/utils.py +280 -0
  23. hammad/cache/__init__.py +48 -0
  24. hammad/cache/base_cache.py +181 -0
  25. hammad/cache/cache.py +169 -0
  26. hammad/cache/decorators.py +261 -0
  27. hammad/cache/file_cache.py +80 -0
  28. hammad/cache/ttl_cache.py +74 -0
  29. hammad/cli/__init__.py +33 -0
  30. hammad/cli/animations.py +604 -0
  31. hammad/cli/plugins.py +781 -0
  32. hammad/cli/styles/__init__.py +55 -0
  33. hammad/cli/styles/settings.py +139 -0
  34. hammad/cli/styles/types.py +358 -0
  35. hammad/cli/styles/utils.py +480 -0
  36. hammad/configuration/__init__.py +35 -0
  37. hammad/configuration/configuration.py +564 -0
  38. hammad/data/__init__.py +39 -0
  39. hammad/data/collections/__init__.py +34 -0
  40. hammad/data/collections/base_collection.py +58 -0
  41. hammad/data/collections/collection.py +452 -0
  42. hammad/data/collections/searchable_collection.py +556 -0
  43. hammad/data/collections/vector_collection.py +603 -0
  44. hammad/data/databases/__init__.py +21 -0
  45. hammad/data/databases/database.py +902 -0
  46. hammad/json/__init__.py +21 -0
  47. hammad/{utils/json → json}/converters.py +4 -1
  48. hammad/logging/__init__.py +35 -0
  49. hammad/logging/decorators.py +834 -0
  50. hammad/logging/logger.py +954 -0
  51. hammad/multimodal/__init__.py +24 -0
  52. hammad/multimodal/audio.py +96 -0
  53. hammad/multimodal/image.py +80 -0
  54. hammad/multithreading/__init__.py +304 -0
  55. hammad/pydantic/__init__.py +43 -0
  56. hammad/{utils/pydantic → pydantic}/converters.py +2 -1
  57. hammad/pydantic/models/__init__.py +28 -0
  58. hammad/pydantic/models/arbitrary_model.py +46 -0
  59. hammad/pydantic/models/cacheable_model.py +79 -0
  60. hammad/pydantic/models/fast_model.py +318 -0
  61. hammad/pydantic/models/function_model.py +176 -0
  62. hammad/pydantic/models/subscriptable_model.py +63 -0
  63. hammad/text/__init__.py +82 -0
  64. hammad/text/converters.py +723 -0
  65. hammad/{utils/markdown/formatting.py → text/markdown.py} +25 -23
  66. hammad/text/text.py +1066 -0
  67. hammad/types/__init__.py +11 -0
  68. hammad/types/file.py +358 -0
  69. hammad/{utils/typing/utils.py → typing/__init__.py} +142 -15
  70. hammad/web/__init__.py +43 -0
  71. hammad/web/http/__init__.py +1 -0
  72. hammad/web/http/client.py +944 -0
  73. hammad/web/models.py +245 -0
  74. hammad/web/openapi/client.py +740 -0
  75. hammad/web/search/__init__.py +1 -0
  76. hammad/web/search/client.py +988 -0
  77. hammad/web/utils.py +472 -0
  78. hammad/yaml/__init__.py +30 -0
  79. hammad/yaml/converters.py +19 -0
  80. {hammad_python-0.0.10.dist-info → hammad_python-0.0.12.dist-info}/METADATA +16 -7
  81. hammad_python-0.0.12.dist-info/RECORD +85 -0
  82. hammad/cache.py +0 -675
  83. hammad/database.py +0 -447
  84. hammad/logger.py +0 -273
  85. hammad/types/color.py +0 -951
  86. hammad/utils/markdown/__init__.py +0 -0
  87. hammad/utils/markdown/converters.py +0 -506
  88. hammad/utils/pydantic/__init__.py +0 -0
  89. hammad/utils/text/__init__.py +0 -0
  90. hammad/utils/text/converters.py +0 -229
  91. hammad/utils/typing/__init__.py +0 -0
  92. hammad_python-0.0.10.dist-info/RECORD +0 -22
  93. /hammad/{utils/__init__.py → py.typed} +0 -0
  94. /hammad/{utils/json → web/openapi}/__init__.py +0 -0
  95. {hammad_python-0.0.10.dist-info → hammad_python-0.0.12.dist-info}/WHEEL +0 -0
  96. {hammad_python-0.0.10.dist-info → hammad_python-0.0.12.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
1
- """hammad.utils.markdown.formatting"""
1
+ """hammad.text.utils.markdown"""
2
2
 
3
3
  from typing import (
4
4
  List,
@@ -7,60 +7,62 @@ from typing import (
7
7
  )
8
8
 
9
9
  __all__ = (
10
- "bold",
11
- "italic",
12
- "code",
13
- "code_block",
14
- "heading",
15
- "link",
16
- "list_item",
17
- "table_row",
18
- "blockquote",
19
- "horizontal_rule",
20
- "table",
10
+ "markdown_bold",
11
+ "markdown_italic",
12
+ "markdown_code",
13
+ "markdown_code_block",
14
+ "markdown_heading",
15
+ "markdown_link",
16
+ "markdown_list_item",
17
+ "markdown_table_row",
18
+ "markdown_blockquote",
19
+ "markdown_horizontal_rule",
20
+ "markdown_table",
21
21
  )
22
22
 
23
23
 
24
- def bold(text: str) -> str:
24
+ def markdown_bold(text: str) -> str:
25
25
  """Format text as bold in Markdown."""
26
26
  return f"**{text}**"
27
27
 
28
28
 
29
- def italic(text: str) -> str:
29
+ def markdown_italic(text: str) -> str:
30
30
  """Format text as italic in Markdown."""
31
31
  return f"*{text}*"
32
32
 
33
33
 
34
- def code(text: str) -> str:
34
+ def markdown_code(text: str) -> str:
35
35
  """Format text as inline code in Markdown."""
36
36
  return f"`{text}`"
37
37
 
38
38
 
39
- def code_block(text: str, language: str = "") -> str:
39
+ def markdown_code_block(text: str, language: str = "") -> str:
40
40
  """Format text as a code block in Markdown."""
41
41
  return f"```{language}\n{text}\n```"
42
42
 
43
43
 
44
- def heading(text: str, level: int = 1) -> str:
44
+ def markdown_heading(text: str, level: int = 1) -> str:
45
45
  """Format text as a heading in Markdown."""
46
46
  if not 1 <= level <= 6:
47
47
  level = 1
48
48
  return f"{'#' * level} {text}"
49
49
 
50
50
 
51
- def link(text: str, url: str) -> str:
51
+ def markdown_link(text: str, url: str) -> str:
52
52
  """Format text as a link in Markdown."""
53
53
  return f"[{text}]({url})"
54
54
 
55
55
 
56
- def list_item(text: str, level: int = 0, ordered: bool = False, index: int = 1) -> str:
56
+ def markdown_list_item(
57
+ text: str, level: int = 0, ordered: bool = False, index: int = 1
58
+ ) -> str:
57
59
  """Format text as a list item in Markdown."""
58
60
  indent = " " * level
59
61
  marker = f"{index}." if ordered else "-"
60
62
  return f"{indent}{marker} {text}"
61
63
 
62
64
 
63
- def table_row(cells: List[str], is_header: bool = False) -> str:
65
+ def markdown_table_row(cells: List[str], is_header: bool = False) -> str:
64
66
  """Format a table row in Markdown."""
65
67
  row = "| " + " | ".join(cells) + " |"
66
68
  if is_header:
@@ -69,19 +71,19 @@ def table_row(cells: List[str], is_header: bool = False) -> str:
69
71
  return row
70
72
 
71
73
 
72
- def blockquote(text: str, level: int = 1) -> str:
74
+ def markdown_blockquote(text: str, level: int = 1) -> str:
73
75
  """Format text as a blockquote in Markdown."""
74
76
  prefix = ">" * level + " "
75
77
  lines = text.split("\n")
76
78
  return "\n".join(f"{prefix}{line}" for line in lines)
77
79
 
78
80
 
79
- def horizontal_rule() -> str:
81
+ def markdown_horizontal_rule() -> str:
80
82
  """Create a horizontal rule in Markdown."""
81
83
  return "---"
82
84
 
83
85
 
84
- def table(
86
+ def markdown_table(
85
87
  headers: List[str],
86
88
  rows: List[List[str]],
87
89
  alignment: Optional[List[Literal["left", "center", "right"]]] = None,