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.
- {hammad_python-0.0.10 → hammad_python-0.0.11}/.gitignore +4 -0
- {hammad_python-0.0.10 → hammad_python-0.0.11}/PKG-INFO +14 -8
- hammad_python-0.0.11/hammad/__init__.py +67 -0
- hammad_python-0.0.11/hammad/based/__init__.py +52 -0
- hammad_python-0.0.11/hammad/based/fields.py +546 -0
- hammad_python-0.0.11/hammad/based/model.py +968 -0
- hammad_python-0.0.11/hammad/based/utils.py +455 -0
- hammad_python-0.0.11/hammad/cache/__init__.py +30 -0
- hammad_python-0.0.10/hammad/cache.py → hammad_python-0.0.11/hammad/cache/_cache.py +83 -12
- hammad_python-0.0.11/hammad/cli/__init__.py +25 -0
- hammad_python-0.0.11/hammad/cli/plugins/__init__.py +786 -0
- hammad_python-0.0.11/hammad/cli/styles/__init__.py +5 -0
- hammad_python-0.0.11/hammad/cli/styles/animations.py +548 -0
- hammad_python-0.0.11/hammad/cli/styles/settings.py +135 -0
- hammad_python-0.0.11/hammad/cli/styles/types.py +358 -0
- hammad_python-0.0.11/hammad/cli/styles/utils.py +480 -0
- hammad_python-0.0.11/hammad/data/__init__.py +51 -0
- hammad_python-0.0.11/hammad/data/collections/__init__.py +32 -0
- hammad_python-0.0.11/hammad/data/collections/base_collection.py +58 -0
- hammad_python-0.0.11/hammad/data/collections/collection.py +227 -0
- hammad_python-0.0.11/hammad/data/collections/searchable_collection.py +556 -0
- hammad_python-0.0.11/hammad/data/collections/vector_collection.py +497 -0
- hammad_python-0.0.11/hammad/data/databases/__init__.py +21 -0
- hammad_python-0.0.11/hammad/data/databases/database.py +551 -0
- hammad_python-0.0.11/hammad/data/types/__init__.py +33 -0
- hammad_python-0.0.11/hammad/data/types/files/__init__.py +1 -0
- hammad_python-0.0.11/hammad/data/types/files/audio.py +81 -0
- hammad_python-0.0.11/hammad/data/types/files/configuration.py +475 -0
- hammad_python-0.0.11/hammad/data/types/files/document.py +195 -0
- hammad_python-0.0.11/hammad/data/types/files/file.py +358 -0
- hammad_python-0.0.11/hammad/data/types/files/image.py +80 -0
- hammad_python-0.0.11/hammad/json/__init__.py +21 -0
- {hammad_python-0.0.10/hammad/utils → hammad_python-0.0.11/hammad}/json/converters.py +4 -1
- hammad_python-0.0.11/hammad/logging/__init__.py +27 -0
- hammad_python-0.0.11/hammad/logging/decorators.py +432 -0
- hammad_python-0.0.11/hammad/logging/logger.py +534 -0
- hammad_python-0.0.11/hammad/pydantic/__init__.py +43 -0
- {hammad_python-0.0.10/hammad/utils → hammad_python-0.0.11/hammad}/pydantic/converters.py +2 -1
- hammad_python-0.0.11/hammad/pydantic/models/__init__.py +28 -0
- hammad_python-0.0.11/hammad/pydantic/models/arbitrary_model.py +46 -0
- hammad_python-0.0.11/hammad/pydantic/models/cacheable_model.py +79 -0
- hammad_python-0.0.11/hammad/pydantic/models/fast_model.py +318 -0
- hammad_python-0.0.11/hammad/pydantic/models/function_model.py +176 -0
- hammad_python-0.0.11/hammad/pydantic/models/subscriptable_model.py +63 -0
- hammad_python-0.0.11/hammad/text/__init__.py +37 -0
- hammad_python-0.0.11/hammad/text/text.py +1068 -0
- hammad_python-0.0.11/hammad/text/utils/__init__.py +1 -0
- {hammad_python-0.0.10/hammad/utils/text → hammad_python-0.0.11/hammad/text/utils}/converters.py +2 -2
- hammad_python-0.0.11/hammad/text/utils/markdown/__init__.py +1 -0
- {hammad_python-0.0.10/hammad → hammad_python-0.0.11/hammad/text}/utils/markdown/converters.py +3 -3
- {hammad_python-0.0.10/hammad → hammad_python-0.0.11/hammad/text}/utils/markdown/formatting.py +1 -1
- hammad_python-0.0.10/hammad/utils/typing/utils.py → hammad_python-0.0.11/hammad/typing/__init__.py +75 -2
- hammad_python-0.0.11/hammad/web/__init__.py +42 -0
- hammad_python-0.0.11/hammad/web/http/__init__.py +1 -0
- hammad_python-0.0.11/hammad/web/http/client.py +944 -0
- hammad_python-0.0.11/hammad/web/openapi/client.py +740 -0
- hammad_python-0.0.11/hammad/web/search/__init__.py +1 -0
- hammad_python-0.0.11/hammad/web/search/client.py +936 -0
- hammad_python-0.0.11/hammad/web/utils.py +463 -0
- hammad_python-0.0.11/hammad/yaml/__init__.py +30 -0
- hammad_python-0.0.11/hammad/yaml/converters.py +19 -0
- {hammad_python-0.0.10 → hammad_python-0.0.11}/pyproject.toml +17 -12
- hammad_python-0.0.11/tests/based/test_core_based_fields.py +465 -0
- hammad_python-0.0.11/tests/based/test_core_based_model.py +837 -0
- hammad_python-0.0.10/tests/test_cache.py → hammad_python-0.0.11/tests/cache/test_cache_cache.py +1 -1
- hammad_python-0.0.11/tests/cli/test_cli_plugins_animate.py +77 -0
- hammad_python-0.0.11/tests/cli/test_cli_plugins_input.py +227 -0
- hammad_python-0.0.11/tests/cli/test_cli_plugins_print.py +181 -0
- hammad_python-0.0.11/tests/cli/test_cli_styles_utils.py +125 -0
- hammad_python-0.0.11/tests/data/test_data_collections_searchable_collection.py +308 -0
- hammad_python-0.0.11/tests/data/test_data_collections_vector_collection.py +256 -0
- hammad_python-0.0.11/tests/data/test_data_databases_database.py +306 -0
- hammad_python-0.0.10/tests/test_utils_json_converters.py → hammad_python-0.0.11/tests/json/test_json_converters.py +1 -1
- hammad_python-0.0.11/tests/logging/test_logging_decorators.py +230 -0
- hammad_python-0.0.11/tests/logging/test_logging_logger.py +237 -0
- hammad_python-0.0.11/tests/pydantic/test_pydantic_converters.py +269 -0
- hammad_python-0.0.11/tests/pydantic/test_pydantic_models.py +288 -0
- hammad_python-0.0.11/tests/text/test_text_text.py +523 -0
- 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
- 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
- hammad_python-0.0.10/tests/test_utils_typing_utils.py → hammad_python-0.0.11/tests/typing/test_typing_utils.py +1 -1
- hammad_python-0.0.11/tests/web/test_web_toolkits_http_toolkit.py +369 -0
- hammad_python-0.0.11/tests/web/test_web_toolkits_openapi_toolkit.py +586 -0
- hammad_python-0.0.11/tests/web/test_web_utils.py +364 -0
- {hammad_python-0.0.10 → hammad_python-0.0.11}/uv.lock +1623 -1694
- hammad_python-0.0.10/hammad/__init__.py +0 -13
- hammad_python-0.0.10/hammad/database.py +0 -447
- hammad_python-0.0.10/hammad/logger.py +0 -273
- hammad_python-0.0.10/hammad/types/color.py +0 -951
- hammad_python-0.0.10/hammad/utils/json/__init__.py +0 -0
- hammad_python-0.0.10/hammad/utils/markdown/__init__.py +0 -0
- hammad_python-0.0.10/hammad/utils/pydantic/__init__.py +0 -0
- hammad_python-0.0.10/hammad/utils/text/__init__.py +0 -0
- hammad_python-0.0.10/hammad/utils/typing/__init__.py +0 -0
- hammad_python-0.0.10/tests/test_database.py +0 -541
- hammad_python-0.0.10/tests/test_types_color.py +0 -158
- hammad_python-0.0.10/tests/test_utils_pydantic_converters.py +0 -314
- {hammad_python-0.0.10 → hammad_python-0.0.11}/.python-version +0 -0
- {hammad_python-0.0.10 → hammad_python-0.0.11}/LICENSE +0 -0
- {hammad_python-0.0.10 → hammad_python-0.0.11}/README.md +0 -0
- /hammad_python-0.0.10/hammad/types/__init__.py → /hammad_python-0.0.11/hammad/py.typed +0 -0
- {hammad_python-0.0.10/hammad/utils → hammad_python-0.0.11/hammad/web/openapi}/__init__.py +0 -0
@@ -1,23 +1,29 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hammad-python
|
3
|
-
Version: 0.0.
|
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>=
|
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:
|
12
|
+
Requires-Dist: prompt-toolkit>=3.0.51
|
12
13
|
Requires-Dist: pydantic>=2.11.5
|
13
|
-
Requires-Dist:
|
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.
|
18
|
-
Requires-Dist: litellm; extra == 'ai'
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
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__)
|