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
hammad/text/markdown.py DELETED
@@ -1,131 +0,0 @@
1
- """hammad.text.utils.markdown"""
2
-
3
- from typing import (
4
- List,
5
- Literal,
6
- Optional,
7
- )
8
-
9
- __all__ = (
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
- )
22
-
23
-
24
- def markdown_bold(text: str) -> str:
25
- """Format text as bold in Markdown."""
26
- return f"**{text}**"
27
-
28
-
29
- def markdown_italic(text: str) -> str:
30
- """Format text as italic in Markdown."""
31
- return f"*{text}*"
32
-
33
-
34
- def markdown_code(text: str) -> str:
35
- """Format text as inline code in Markdown."""
36
- return f"`{text}`"
37
-
38
-
39
- def markdown_code_block(text: str, language: str = "") -> str:
40
- """Format text as a code block in Markdown."""
41
- return f"```{language}\n{text}\n```"
42
-
43
-
44
- def markdown_heading(text: str, level: int = 1) -> str:
45
- """Format text as a heading in Markdown."""
46
- if not 1 <= level <= 6:
47
- level = 1
48
- return f"{'#' * level} {text}"
49
-
50
-
51
- def markdown_link(text: str, url: str) -> str:
52
- """Format text as a link in Markdown."""
53
- return f"[{text}]({url})"
54
-
55
-
56
- def markdown_list_item(
57
- text: str, level: int = 0, ordered: bool = False, index: int = 1
58
- ) -> str:
59
- """Format text as a list item in Markdown."""
60
- indent = " " * level
61
- marker = f"{index}." if ordered else "-"
62
- return f"{indent}{marker} {text}"
63
-
64
-
65
- def markdown_table_row(cells: List[str], is_header: bool = False) -> str:
66
- """Format a table row in Markdown."""
67
- row = "| " + " | ".join(cells) + " |"
68
- if is_header:
69
- separator = "|" + "|".join([" --- " for _ in cells]) + "|"
70
- return f"{row}\n{separator}"
71
- return row
72
-
73
-
74
- def markdown_blockquote(text: str, level: int = 1) -> str:
75
- """Format text as a blockquote in Markdown."""
76
- prefix = ">" * level + " "
77
- lines = text.split("\n")
78
- return "\n".join(f"{prefix}{line}" for line in lines)
79
-
80
-
81
- def markdown_horizontal_rule() -> str:
82
- """Create a horizontal rule in Markdown."""
83
- return "---"
84
-
85
-
86
- def markdown_table(
87
- headers: List[str],
88
- rows: List[List[str]],
89
- alignment: Optional[List[Literal["left", "center", "right"]]] = None,
90
- ) -> str:
91
- """
92
- Create a Markdown table from headers and rows.
93
-
94
- Args:
95
- headers: List of header strings
96
- rows: List of row data (each row is a list of strings)
97
- alignment: Optional list of alignments for each column
98
-
99
- Returns:
100
- Formatted Markdown table
101
- """
102
- if not headers:
103
- return ""
104
-
105
- parts = []
106
-
107
- # Add header
108
- parts.append("| " + " | ".join(headers) + " |")
109
-
110
- # Add separator with alignment
111
- separators = []
112
- for i, header in enumerate(headers):
113
- if alignment and i < len(alignment):
114
- align = alignment[i]
115
- if align == "center":
116
- separators.append(" :---: ")
117
- elif align == "right":
118
- separators.append(" ---: ")
119
- else:
120
- separators.append(" --- ")
121
- else:
122
- separators.append(" --- ")
123
- parts.append("|" + "|".join(separators) + "|")
124
-
125
- # Add rows
126
- for row in rows:
127
- # Ensure row has same number of columns as headers
128
- padded_row = row + [""] * (len(headers) - len(row))
129
- parts.append("| " + " | ".join(padded_row[: len(headers)]) + " |")
130
-
131
- return "\n".join(parts)