hammad-python 0.0.10__tar.gz → 0.0.11__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.
Files changed (102) hide show
  1. {hammad_python-0.0.10 → hammad_python-0.0.11}/.gitignore +4 -0
  2. {hammad_python-0.0.10 → hammad_python-0.0.11}/PKG-INFO +14 -8
  3. hammad_python-0.0.11/hammad/__init__.py +67 -0
  4. hammad_python-0.0.11/hammad/based/__init__.py +52 -0
  5. hammad_python-0.0.11/hammad/based/fields.py +546 -0
  6. hammad_python-0.0.11/hammad/based/model.py +968 -0
  7. hammad_python-0.0.11/hammad/based/utils.py +455 -0
  8. hammad_python-0.0.11/hammad/cache/__init__.py +30 -0
  9. hammad_python-0.0.10/hammad/cache.py → hammad_python-0.0.11/hammad/cache/_cache.py +83 -12
  10. hammad_python-0.0.11/hammad/cli/__init__.py +25 -0
  11. hammad_python-0.0.11/hammad/cli/plugins/__init__.py +786 -0
  12. hammad_python-0.0.11/hammad/cli/styles/__init__.py +5 -0
  13. hammad_python-0.0.11/hammad/cli/styles/animations.py +548 -0
  14. hammad_python-0.0.11/hammad/cli/styles/settings.py +135 -0
  15. hammad_python-0.0.11/hammad/cli/styles/types.py +358 -0
  16. hammad_python-0.0.11/hammad/cli/styles/utils.py +480 -0
  17. hammad_python-0.0.11/hammad/data/__init__.py +51 -0
  18. hammad_python-0.0.11/hammad/data/collections/__init__.py +32 -0
  19. hammad_python-0.0.11/hammad/data/collections/base_collection.py +58 -0
  20. hammad_python-0.0.11/hammad/data/collections/collection.py +227 -0
  21. hammad_python-0.0.11/hammad/data/collections/searchable_collection.py +556 -0
  22. hammad_python-0.0.11/hammad/data/collections/vector_collection.py +497 -0
  23. hammad_python-0.0.11/hammad/data/databases/__init__.py +21 -0
  24. hammad_python-0.0.11/hammad/data/databases/database.py +551 -0
  25. hammad_python-0.0.11/hammad/data/types/__init__.py +33 -0
  26. hammad_python-0.0.11/hammad/data/types/files/__init__.py +1 -0
  27. hammad_python-0.0.11/hammad/data/types/files/audio.py +81 -0
  28. hammad_python-0.0.11/hammad/data/types/files/configuration.py +475 -0
  29. hammad_python-0.0.11/hammad/data/types/files/document.py +195 -0
  30. hammad_python-0.0.11/hammad/data/types/files/file.py +358 -0
  31. hammad_python-0.0.11/hammad/data/types/files/image.py +80 -0
  32. hammad_python-0.0.11/hammad/json/__init__.py +21 -0
  33. {hammad_python-0.0.10/hammad/utils → hammad_python-0.0.11/hammad}/json/converters.py +4 -1
  34. hammad_python-0.0.11/hammad/logging/__init__.py +27 -0
  35. hammad_python-0.0.11/hammad/logging/decorators.py +432 -0
  36. hammad_python-0.0.11/hammad/logging/logger.py +534 -0
  37. hammad_python-0.0.11/hammad/pydantic/__init__.py +43 -0
  38. {hammad_python-0.0.10/hammad/utils → hammad_python-0.0.11/hammad}/pydantic/converters.py +2 -1
  39. hammad_python-0.0.11/hammad/pydantic/models/__init__.py +28 -0
  40. hammad_python-0.0.11/hammad/pydantic/models/arbitrary_model.py +46 -0
  41. hammad_python-0.0.11/hammad/pydantic/models/cacheable_model.py +79 -0
  42. hammad_python-0.0.11/hammad/pydantic/models/fast_model.py +318 -0
  43. hammad_python-0.0.11/hammad/pydantic/models/function_model.py +176 -0
  44. hammad_python-0.0.11/hammad/pydantic/models/subscriptable_model.py +63 -0
  45. hammad_python-0.0.11/hammad/text/__init__.py +37 -0
  46. hammad_python-0.0.11/hammad/text/text.py +1068 -0
  47. hammad_python-0.0.11/hammad/text/utils/__init__.py +1 -0
  48. {hammad_python-0.0.10/hammad/utils/text → hammad_python-0.0.11/hammad/text/utils}/converters.py +2 -2
  49. hammad_python-0.0.11/hammad/text/utils/markdown/__init__.py +1 -0
  50. {hammad_python-0.0.10/hammad → hammad_python-0.0.11/hammad/text}/utils/markdown/converters.py +3 -3
  51. {hammad_python-0.0.10/hammad → hammad_python-0.0.11/hammad/text}/utils/markdown/formatting.py +1 -1
  52. hammad_python-0.0.10/hammad/utils/typing/utils.py → hammad_python-0.0.11/hammad/typing/__init__.py +75 -2
  53. hammad_python-0.0.11/hammad/web/__init__.py +42 -0
  54. hammad_python-0.0.11/hammad/web/http/__init__.py +1 -0
  55. hammad_python-0.0.11/hammad/web/http/client.py +944 -0
  56. hammad_python-0.0.11/hammad/web/openapi/client.py +740 -0
  57. hammad_python-0.0.11/hammad/web/search/__init__.py +1 -0
  58. hammad_python-0.0.11/hammad/web/search/client.py +936 -0
  59. hammad_python-0.0.11/hammad/web/utils.py +463 -0
  60. hammad_python-0.0.11/hammad/yaml/__init__.py +30 -0
  61. hammad_python-0.0.11/hammad/yaml/converters.py +19 -0
  62. {hammad_python-0.0.10 → hammad_python-0.0.11}/pyproject.toml +17 -12
  63. hammad_python-0.0.11/tests/based/test_core_based_fields.py +465 -0
  64. hammad_python-0.0.11/tests/based/test_core_based_model.py +837 -0
  65. hammad_python-0.0.10/tests/test_cache.py → hammad_python-0.0.11/tests/cache/test_cache_cache.py +1 -1
  66. hammad_python-0.0.11/tests/cli/test_cli_plugins_animate.py +77 -0
  67. hammad_python-0.0.11/tests/cli/test_cli_plugins_input.py +227 -0
  68. hammad_python-0.0.11/tests/cli/test_cli_plugins_print.py +181 -0
  69. hammad_python-0.0.11/tests/cli/test_cli_styles_utils.py +125 -0
  70. hammad_python-0.0.11/tests/data/test_data_collections_searchable_collection.py +308 -0
  71. hammad_python-0.0.11/tests/data/test_data_collections_vector_collection.py +256 -0
  72. hammad_python-0.0.11/tests/data/test_data_databases_database.py +306 -0
  73. hammad_python-0.0.10/tests/test_utils_json_converters.py → hammad_python-0.0.11/tests/json/test_json_converters.py +1 -1
  74. hammad_python-0.0.11/tests/logging/test_logging_decorators.py +230 -0
  75. hammad_python-0.0.11/tests/logging/test_logging_logger.py +237 -0
  76. hammad_python-0.0.11/tests/pydantic/test_pydantic_converters.py +269 -0
  77. hammad_python-0.0.11/tests/pydantic/test_pydantic_models.py +288 -0
  78. hammad_python-0.0.11/tests/text/test_text_text.py +523 -0
  79. hammad_python-0.0.10/tests/test_utils_text_converters.py → hammad_python-0.0.11/tests/text/test_text_utils_converters.py +1 -1
  80. hammad_python-0.0.10/tests/test_utils_markdown_converters.py → hammad_python-0.0.11/tests/text/test_text_utils_markdown_converters.py +1 -1
  81. hammad_python-0.0.10/tests/test_utils_typing_utils.py → hammad_python-0.0.11/tests/typing/test_typing_utils.py +1 -1
  82. hammad_python-0.0.11/tests/web/test_web_toolkits_http_toolkit.py +369 -0
  83. hammad_python-0.0.11/tests/web/test_web_toolkits_openapi_toolkit.py +586 -0
  84. hammad_python-0.0.11/tests/web/test_web_utils.py +364 -0
  85. {hammad_python-0.0.10 → hammad_python-0.0.11}/uv.lock +1623 -1694
  86. hammad_python-0.0.10/hammad/__init__.py +0 -13
  87. hammad_python-0.0.10/hammad/database.py +0 -447
  88. hammad_python-0.0.10/hammad/logger.py +0 -273
  89. hammad_python-0.0.10/hammad/types/color.py +0 -951
  90. hammad_python-0.0.10/hammad/utils/json/__init__.py +0 -0
  91. hammad_python-0.0.10/hammad/utils/markdown/__init__.py +0 -0
  92. hammad_python-0.0.10/hammad/utils/pydantic/__init__.py +0 -0
  93. hammad_python-0.0.10/hammad/utils/text/__init__.py +0 -0
  94. hammad_python-0.0.10/hammad/utils/typing/__init__.py +0 -0
  95. hammad_python-0.0.10/tests/test_database.py +0 -541
  96. hammad_python-0.0.10/tests/test_types_color.py +0 -158
  97. hammad_python-0.0.10/tests/test_utils_pydantic_converters.py +0 -314
  98. {hammad_python-0.0.10 → hammad_python-0.0.11}/.python-version +0 -0
  99. {hammad_python-0.0.10 → hammad_python-0.0.11}/LICENSE +0 -0
  100. {hammad_python-0.0.10 → hammad_python-0.0.11}/README.md +0 -0
  101. /hammad_python-0.0.10/hammad/types/__init__.py → /hammad_python-0.0.11/hammad/py.typed +0 -0
  102. {hammad_python-0.0.10/hammad/utils → hammad_python-0.0.11/hammad/web/openapi}/__init__.py +0 -0
@@ -6,6 +6,10 @@
6
6
  .cursorrules
7
7
  .claude/
8
8
  .dev/
9
+ .__old__/
10
+ dev/
11
+ # For Dev
12
+ tester.py
9
13
 
10
14
  # Byte-compiled / optimized / DLL files
11
15
  __pycache__/
@@ -1,23 +1,29 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hammad-python
3
- Version: 0.0.10
3
+ Version: 0.0.11
4
4
  Summary: hammad - *Nightly* hyper-fast opinionated resources and modules built for quick development.
5
5
  Author-email: Hammad Saeed <hammadaidev@gmail.com>
6
6
  License-File: LICENSE
7
7
  Requires-Python: >=3.11
8
8
  Requires-Dist: docstring-parser>=0.16
9
- Requires-Dist: duckduckgo-search>=7.3.0
9
+ Requires-Dist: duckduckgo-search>=8.0.4
10
+ Requires-Dist: httpx>=0.28.1
10
11
  Requires-Dist: msgspec>=0.19.0
11
- Requires-Dist: platformdirs>=4.3.8
12
+ Requires-Dist: prompt-toolkit>=3.0.51
12
13
  Requires-Dist: pydantic>=2.11.5
13
- Requires-Dist: sqlalchemy>=2.0.41
14
+ Requires-Dist: python-dotenv>=1.1.0
15
+ Requires-Dist: pyyaml>=6.0.2
16
+ Requires-Dist: rich>=13.9.4
17
+ Requires-Dist: selectolax>=0.3.30
14
18
  Requires-Dist: tantivy>=0.24.0
19
+ Requires-Dist: tenacity>=9.0.0
15
20
  Requires-Dist: typing-inspect>=0.9.0
21
+ Requires-Dist: uvloop>=0.21.0
16
22
  Provides-Extra: ai
17
- Requires-Dist: instructor>=1.8.3; extra == 'ai'
18
- Requires-Dist: litellm; extra == 'ai'
19
- Requires-Dist: memvid; extra == 'ai'
20
- Requires-Dist: openai-agents; extra == 'ai'
23
+ Requires-Dist: instructor>=1.9.0; extra == 'ai'
24
+ Requires-Dist: litellm>=1.72.4; extra == 'ai'
25
+ Requires-Dist: openai-agents>=0.0.19; extra == 'ai'
26
+ Requires-Dist: qdrant-client>=1.14.3; extra == 'ai'
21
27
  Provides-Extra: serve
22
28
  Requires-Dist: fastapi>=0.115.8; extra == 'serve'
23
29
  Requires-Dist: python-multipart>=0.0.19; extra == 'serve'
@@ -0,0 +1,67 @@
1
+ """hammad-python
2
+
3
+ A collection of rapid, opinionated, cookie-cutter like resources for
4
+ Python applications and development."""
5
+
6
+ # NOTE:
7
+ # all resources imported to the top level are lazy loaded within their
8
+ # respective modules.
9
+
10
+ # `hammad.based`
11
+ from .based import (
12
+ BasedModel,
13
+ basedfield,
14
+ based_validator,
15
+ create_basedmodel,
16
+ )
17
+ from .based.utils import install, is_basedfield, is_basedmodel
18
+
19
+ # `hammad.cache`
20
+ from .cache import cached, auto_cached, create_cache
21
+
22
+ # `hammad.cli`
23
+ from .cli import input, print, animate
24
+
25
+ # `hammad.data`
26
+ from .data import create_collection, create_database
27
+
28
+ # `hammad.json`
29
+ from .json import convert_to_json_schema
30
+
31
+ # `hammad.logging`
32
+ from .logging import (
33
+ create_logger,
34
+ create_logger_level,
35
+ # NOTE: decorators
36
+ trace,
37
+ trace_cls,
38
+ trace_function,
39
+ )
40
+
41
+ # `hammad.pydantic`
42
+ from .pydantic import (
43
+ convert_to_pydantic_model,
44
+ convert_to_pydantic_field,
45
+ create_confirmation_pydantic_model,
46
+ create_selection_pydantic_model,
47
+ )
48
+
49
+ # `hammad.text`
50
+ from .text import (
51
+ convert_docstring_to_text,
52
+ convert_to_text,
53
+ convert_type_to_text,
54
+ )
55
+
56
+ # `hammad.web`
57
+ from .web import (
58
+ create_http_client,
59
+ create_openapi_client,
60
+ create_search_client,
61
+ read_web_page,
62
+ read_web_pages,
63
+ run_web_request,
64
+ search_news,
65
+ search_web,
66
+ extract_page_links,
67
+ )
@@ -0,0 +1,52 @@
1
+ """hammad.core.base
2
+
3
+ Contains resources that build the `BasedModel` & `basedfield` components.
4
+ This system is built to 'mock' a Pydantic Model, using `msgspec` for faster
5
+ serialization as well as extended functionality through the model."""
6
+
7
+ from typing import TYPE_CHECKING
8
+ from .utils import auto_create_lazy_loader
9
+
10
+ if TYPE_CHECKING:
11
+ from .fields import (
12
+ basedfield,
13
+ str_basedfield,
14
+ int_basedfield,
15
+ float_basedfield,
16
+ list_basedfield,
17
+ BasedFieldInfo,
18
+ BasedField,
19
+ )
20
+ from .model import BasedModel
21
+ from .utils import (
22
+ create_basedmodel,
23
+ get_field_info,
24
+ is_basedfield,
25
+ is_basedmodel,
26
+ based_validator,
27
+ )
28
+
29
+
30
+ __all__ = (
31
+ "basedfield",
32
+ "str_basedfield",
33
+ "int_basedfield",
34
+ "float_basedfield",
35
+ "list_basedfield",
36
+ "BasedFieldInfo",
37
+ "BasedField",
38
+ "BasedModel",
39
+ "create_basedmodel",
40
+ "get_field_info",
41
+ "is_basedfield",
42
+ "is_basedmodel",
43
+ "based_validator",
44
+ )
45
+
46
+
47
+ __getattr__ = auto_create_lazy_loader(__all__)
48
+
49
+
50
+ def __dir__() -> list[str]:
51
+ """Get the attributes of the based module."""
52
+ return list(__all__)