hammad-python 0.0.14__tar.gz → 0.0.15__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.14 → hammad_python-0.0.15}/.gitignore +0 -1
- hammad_python-0.0.15/PKG-INFO +184 -0
- hammad_python-0.0.15/README.md +136 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cli/plugins.py +0 -4
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/__init__.py +0 -2
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/collections/base_collection.py +1 -1
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/collections/collection.py +1 -1
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/collections/searchable_collection.py +8 -8
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/databases/database.py +27 -13
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/__init__.py +3 -14
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/types/__init__.py +0 -2
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/logging/logger.py +2 -2
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/collections/test_data_collections_searchable_collection.py +10 -10
- hammad_python-0.0.15/hammad/__init__.py +178 -0
- hammad_python-0.0.15/hammad/_internal.py +237 -0
- hammad_python-0.0.15/hammad/cache/__init__.py +40 -0
- hammad_python-0.0.15/hammad/cache/base_cache.py +181 -0
- hammad_python-0.0.15/hammad/cache/cache.py +169 -0
- hammad_python-0.0.15/hammad/cache/decorators.py +261 -0
- hammad_python-0.0.15/hammad/cache/file_cache.py +80 -0
- hammad_python-0.0.15/hammad/cache/ttl_cache.py +74 -0
- hammad_python-0.0.15/hammad/cli/__init__.py +35 -0
- hammad_python-0.0.15/hammad/cli/_runner.py +265 -0
- hammad_python-0.0.15/hammad/cli/animations.py +573 -0
- hammad_python-0.0.15/hammad/cli/plugins.py +836 -0
- hammad_python-0.0.15/hammad/cli/styles/__init__.py +55 -0
- hammad_python-0.0.15/hammad/cli/styles/settings.py +139 -0
- hammad_python-0.0.15/hammad/cli/styles/types.py +358 -0
- hammad_python-0.0.15/hammad/cli/styles/utils.py +626 -0
- hammad_python-0.0.15/hammad/data/__init__.py +83 -0
- hammad_python-0.0.15/hammad/data/collections/__init__.py +44 -0
- hammad_python-0.0.15/hammad/data/collections/collection.py +260 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/__init__.py +37 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/qdrant/__init__.py +1 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/qdrant/index.py +539 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/qdrant/settings.py +94 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/qdrant/utils.py +220 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/tantivy/__init__.py +1 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/tantivy/index.py +428 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/tantivy/settings.py +51 -0
- hammad_python-0.0.15/hammad/data/collections/indexes/tantivy/utils.py +200 -0
- hammad_python-0.0.15/hammad/data/configurations/__init__.py +35 -0
- hammad_python-0.0.15/hammad/data/configurations/configuration.py +564 -0
- hammad_python-0.0.15/hammad/data/models/__init__.py +55 -0
- hammad_python-0.0.15/hammad/data/models/extensions/__init__.py +4 -0
- hammad_python-0.0.15/hammad/data/models/extensions/pydantic/__init__.py +42 -0
- hammad_python-0.0.15/hammad/data/models/extensions/pydantic/converters.py +759 -0
- hammad_python-0.0.15/hammad/data/models/fields.py +546 -0
- hammad_python-0.0.15/hammad/data/models/model.py +1078 -0
- hammad_python-0.0.15/hammad/data/models/utils.py +280 -0
- hammad_python-0.0.15/hammad/data/sql/__init__.py +23 -0
- hammad_python-0.0.15/hammad/data/sql/database.py +578 -0
- hammad_python-0.0.15/hammad/data/sql/types.py +136 -0
- hammad_python-0.0.15/hammad/data/types/__init__.py +39 -0
- hammad_python-0.0.15/hammad/data/types/file.py +358 -0
- hammad_python-0.0.15/hammad/data/types/multimodal/__init__.py +24 -0
- hammad_python-0.0.15/hammad/data/types/multimodal/audio.py +96 -0
- hammad_python-0.0.15/hammad/data/types/multimodal/image.py +80 -0
- hammad_python-0.0.15/hammad/data/types/text.py +1066 -0
- hammad_python-0.0.15/hammad/formatting/__init__.py +20 -0
- hammad_python-0.0.15/hammad/formatting/json/__init__.py +27 -0
- hammad_python-0.0.15/hammad/formatting/json/converters.py +158 -0
- hammad_python-0.0.15/hammad/formatting/text/__init__.py +63 -0
- hammad_python-0.0.15/hammad/formatting/text/converters.py +723 -0
- hammad_python-0.0.15/hammad/formatting/text/markdown.py +131 -0
- hammad_python-0.0.15/hammad/formatting/yaml/__init__.py +26 -0
- hammad_python-0.0.15/hammad/formatting/yaml/converters.py +5 -0
- hammad_python-0.0.15/hammad/genai/__init__.py +45 -0
- hammad_python-0.0.15/hammad/genai/embedding_models/__init__.py +41 -0
- hammad_python-0.0.15/hammad/genai/embedding_models/embedding_model.py +193 -0
- hammad_python-0.0.15/hammad/genai/embedding_models/embedding_model_name.py +77 -0
- hammad_python-0.0.15/hammad/genai/embedding_models/embedding_model_request.py +65 -0
- hammad_python-0.0.15/hammad/genai/embedding_models/embedding_model_response.py +69 -0
- hammad_python-0.0.15/hammad/genai/embedding_models/run.py +161 -0
- hammad_python-0.0.15/hammad/genai/language_models/__init__.py +35 -0
- hammad_python-0.0.15/hammad/genai/language_models/_streaming.py +368 -0
- hammad_python-0.0.15/hammad/genai/language_models/_types.py +276 -0
- hammad_python-0.0.15/hammad/genai/language_models/_utils/__init__.py +31 -0
- hammad_python-0.0.15/hammad/genai/language_models/_utils/_completions.py +131 -0
- hammad_python-0.0.15/hammad/genai/language_models/_utils/_messages.py +89 -0
- hammad_python-0.0.15/hammad/genai/language_models/_utils/_requests.py +180 -0
- hammad_python-0.0.15/hammad/genai/language_models/_utils/_structured_outputs.py +122 -0
- hammad_python-0.0.15/hammad/genai/language_models/language_model.py +596 -0
- hammad_python-0.0.15/hammad/genai/language_models/language_model_request.py +122 -0
- hammad_python-0.0.15/hammad/genai/language_models/language_model_response.py +220 -0
- hammad_python-0.0.15/hammad/genai/language_models/language_model_response_chunk.py +53 -0
- hammad_python-0.0.15/hammad/genai/language_models/run.py +498 -0
- hammad_python-0.0.15/hammad/logging/__init__.py +35 -0
- hammad_python-0.0.15/hammad/logging/decorators.py +834 -0
- hammad_python-0.0.15/hammad/logging/logger.py +954 -0
- hammad_python-0.0.15/hammad/mcp/__init__.py +50 -0
- hammad_python-0.0.15/hammad/mcp/client/__init__.py +36 -0
- hammad_python-0.0.15/hammad/mcp/client/client.py +624 -0
- hammad_python-0.0.15/hammad/mcp/client/client_service.py +400 -0
- hammad_python-0.0.15/hammad/mcp/client/settings.py +178 -0
- hammad_python-0.0.15/hammad/mcp/servers/__init__.py +25 -0
- hammad_python-0.0.15/hammad/mcp/servers/launcher.py +1161 -0
- hammad_python-0.0.15/hammad/runtime/__init__.py +32 -0
- hammad_python-0.0.15/hammad/runtime/decorators.py +142 -0
- hammad_python-0.0.15/hammad/runtime/run.py +299 -0
- hammad_python-0.0.15/hammad/service/__init__.py +49 -0
- hammad_python-0.0.15/hammad/service/create.py +527 -0
- hammad_python-0.0.15/hammad/service/decorators.py +285 -0
- hammad_python-0.0.15/hammad/typing/__init__.py +435 -0
- hammad_python-0.0.15/hammad/web/__init__.py +43 -0
- hammad_python-0.0.15/hammad/web/http/__init__.py +1 -0
- hammad_python-0.0.15/hammad/web/http/client.py +944 -0
- hammad_python-0.0.15/hammad/web/models.py +277 -0
- hammad_python-0.0.15/hammad/web/openapi/__init__.py +1 -0
- hammad_python-0.0.15/hammad/web/openapi/client.py +740 -0
- hammad_python-0.0.15/hammad/web/search/__init__.py +1 -0
- hammad_python-0.0.15/hammad/web/search/client.py +1035 -0
- hammad_python-0.0.15/hammad/web/utils.py +472 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15}/pyproject.toml +47 -42
- {hammad_python-0.0.14 → hammad_python-0.0.15}/uv.lock +1503 -1887
- hammad_python-0.0.14/PKG-INFO +0 -70
- hammad_python-0.0.14/README.md +0 -34
- {hammad_python-0.0.14 → hammad_python-0.0.15}/.python-version +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15}/LICENSE +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/_utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/completions/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/completions/client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/completions/create.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/completions/settings.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/completions/types.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/completions/utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/embeddings/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/embeddings/client/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/embeddings/client/base_embeddings_client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/embeddings/client/fastembed_text_embeddings_client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/embeddings/client/litellm_embeddings_client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/embeddings/create.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/ai/embeddings/types.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cache/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cache/base_cache.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cache/cache.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cache/decorators.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cache/file_cache.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cache/ttl_cache.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cli/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cli/animations.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cli/styles/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cli/styles/settings.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cli/styles/types.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/cli/styles/utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/collections/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/collections/vector_collection.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/configurations/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/configurations/configuration.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/databases/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/base/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/base/fields.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/base/model.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/base/utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/models/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/models/arbitrary_model.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/models/cacheable_model.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/models/fast_model.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/models/function_model.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/models/pydantic/models/subscriptable_model.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/types/file.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/types/multimodal/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/types/multimodal/audio.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/types/multimodal/image.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/data/types/text.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/json/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/json/converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/text/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/text/converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/text/markdown.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/yaml/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/formatting/yaml/converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/logging/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/logging/decorators.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/mcp/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/mcp/client/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/mcp/client/client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/mcp/client/client_service.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/mcp/client/settings.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/mcp/servers/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/mcp/servers/launcher.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/performance/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/performance/imports.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/performance/runtime/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/performance/runtime/decorators.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/performance/runtime/run.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/py.typed +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/service/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/service/create.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/service/decorators.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/typing/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/http/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/http/client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/models.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/openapi/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/openapi/client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/search/__init__.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/search/client.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/hammad/web/utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/ai/completions/test_ai_completions_create.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/ai/completions/test_ai_completions_types.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/cache/test_performance_cache.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/cli/test_cli_plugins_animate.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/cli/test_cli_plugins_input.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/cli/test_cli_plugins_print.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/cli/test_cli_styles_utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/collections/test_data_collections_vector_collection.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/configuration/test_data_configuration.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/databases/test_data_databases_database.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/models/base/test_data_models_base_fields.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/models/base/test_data_models_base_model.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/models/pydantic/test_models_pydantic_converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/models/pydantic/test_models_pydantic_models.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/data/types/test_data_types_text.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/formatting/json/test_json_converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/formatting/text/test_text_utils_converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/formatting/text/test_text_utils_markdown_converters.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/logging/test_logging_decorators.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/logging/test_logging_logger.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/mcp/test_mcp_client_services.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/mcp/test_mcp_server_services.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/performance/runtime/test_performance_runtime_decorators.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/performance/runtime/test_performance_runtime_run.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/service/test_service_create_service.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/service/test_service_serve_decorator.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/service/test_service_serve_mcp_decorator.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/typing/test_typing_utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/web/test_web_toolkits_http_toolkit.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/web/test_web_toolkits_openapi_toolkit.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15/deprecated}/tests/web/test_web_utils.py +0 -0
- {hammad_python-0.0.14 → hammad_python-0.0.15}/mkdocs.yml +0 -0
@@ -0,0 +1,184 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: hammad-python
|
3
|
+
Version: 0.0.15
|
4
|
+
Author-email: Hammad Saeed <hammadaidev@gmail.com>
|
5
|
+
License: MIT License
|
6
|
+
|
7
|
+
Copyright (c) 2025 Hammad Saeed
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
17
|
+
copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25
|
+
SOFTWARE.
|
26
|
+
License-File: LICENSE
|
27
|
+
Requires-Python: >=3.11
|
28
|
+
Requires-Dist: ddgs>=9.0.0
|
29
|
+
Requires-Dist: httpx>=0.28.1
|
30
|
+
Requires-Dist: msgspec>=0.19.0
|
31
|
+
Requires-Dist: pydantic>=2.11.7
|
32
|
+
Requires-Dist: rich>=14.0.0
|
33
|
+
Requires-Dist: selectolax>=0.3.31
|
34
|
+
Requires-Dist: sqlalchemy>=2.0.41
|
35
|
+
Requires-Dist: tantivy>=0.24.0
|
36
|
+
Requires-Dist: tenacity>=9.1.2
|
37
|
+
Requires-Dist: typing-inspect>=0.9.0
|
38
|
+
Provides-Extra: ai
|
39
|
+
Requires-Dist: instructor>=1.9.0; extra == 'ai'
|
40
|
+
Requires-Dist: litellm>=1.73.6; extra == 'ai'
|
41
|
+
Requires-Dist: qdrant-client>=1.14.3; extra == 'ai'
|
42
|
+
Provides-Extra: mcp
|
43
|
+
Requires-Dist: mcp>=1.10.1; extra == 'mcp'
|
44
|
+
Provides-Extra: serve
|
45
|
+
Requires-Dist: fastapi>=0.115.6; extra == 'serve'
|
46
|
+
Requires-Dist: uvicorn>=0.34.0; extra == 'serve'
|
47
|
+
Description-Content-Type: text/markdown
|
48
|
+
|
49
|
+
## hammad-python
|
50
|
+
|
51
|
+
> __Happily Accelerated Micro-Modules (_for_) Application Development__
|
52
|
+
|
53
|
+
## Introduction
|
54
|
+
|
55
|
+
The `hammad-python` library, is a mix of a love letter and collection of mixed resources for
|
56
|
+
developing Python applications. This library is meant to be used for rapid prototyping and
|
57
|
+
development, and is focused on providing styled placeholder tools for common patterns, tasks
|
58
|
+
and workflows.
|
59
|
+
|
60
|
+
The package is currently built into the following structures:
|
61
|
+
|
62
|
+
- `hammad-python` : Contains most core functionality and resources.
|
63
|
+
- `hammad-python[ai]` : Contains easy to use resources for Generative AI related tasks such as
|
64
|
+
generating completions with language models, or creating embeddings.
|
65
|
+
- `hammad-python[serve]` : Contains FastAPI / Uvicorn based resources for serving and running applications.
|
66
|
+
|
67
|
+
## Installation
|
68
|
+
|
69
|
+
You can install the package using `pip` or `uv`:
|
70
|
+
|
71
|
+
```bash
|
72
|
+
pip install hammad-python
|
73
|
+
|
74
|
+
# or install the `ai` extension
|
75
|
+
# pip install 'hammad-python[ai]'
|
76
|
+
|
77
|
+
# or install the `serve` extension
|
78
|
+
# pip install 'hammad-python[serve]'
|
79
|
+
```
|
80
|
+
|
81
|
+
```bash
|
82
|
+
uv pip install hammad-python
|
83
|
+
|
84
|
+
# or install the `ai` extension
|
85
|
+
# uv pip install 'hammad-python[ai]'
|
86
|
+
|
87
|
+
# or install the `serve` extension
|
88
|
+
# uv pip install 'hammad-python[serve]'
|
89
|
+
```
|
90
|
+
|
91
|
+
## Basic Usage
|
92
|
+
|
93
|
+
### Data Structures, Databases and Other Data Related Resources
|
94
|
+
|
95
|
+
#### Collections
|
96
|
+
|
97
|
+
Using `hammad.data.collections` is a simple way to create searchable collections of
|
98
|
+
data using both `bm25` and `vector` based search.
|
99
|
+
|
100
|
+
```python
|
101
|
+
from hammad.data.collections import create_collection
|
102
|
+
|
103
|
+
# Create either a `vector` or `searchable` collection
|
104
|
+
col = create_collection(type = "searchable")
|
105
|
+
|
106
|
+
# add anything to the collection
|
107
|
+
col.add("This is some text")
|
108
|
+
col.add(5)
|
109
|
+
col.add({'text' : "this is a dictionary"})
|
110
|
+
|
111
|
+
# search the collection
|
112
|
+
print(col.query("text"))
|
113
|
+
```
|
114
|
+
|
115
|
+
#### Databases
|
116
|
+
|
117
|
+
Any collection can be either used as a standalone database, or can be added as one
|
118
|
+
of the collections within a database. Databases provide a unified interface for handling
|
119
|
+
both `Searchable` and `Vector` based collections.
|
120
|
+
|
121
|
+
```python
|
122
|
+
from hammad.data.collections import create_collection
|
123
|
+
from hammad.data.databases import Database
|
124
|
+
|
125
|
+
# Create either a `vector` or `searchable` collection
|
126
|
+
col = create_collection(type = "searchable")
|
127
|
+
|
128
|
+
col.add("This is some text")
|
129
|
+
|
130
|
+
# Databases can either be created on memory or using a path
|
131
|
+
db = Database(location = "memory")
|
132
|
+
|
133
|
+
db.add_collection(col)
|
134
|
+
|
135
|
+
# search globally or within a single collection
|
136
|
+
print(db.query("text"))
|
137
|
+
```
|
138
|
+
|
139
|
+
### Styling / Introspection Resources
|
140
|
+
|
141
|
+
The `hammad-python` package contains a variety of components that can be used
|
142
|
+
to easily style, or run introspection (logging) on your code.
|
143
|
+
|
144
|
+
```python
|
145
|
+
from hammad.cli import print, input, animate
|
146
|
+
|
147
|
+
# Use extended `rich` styling easily
|
148
|
+
print("Hello, World", bg_settings = {"title" : "This is a title"})
|
149
|
+
|
150
|
+
# Easily collect various forms of input in a single function
|
151
|
+
class User(BaseModel):
|
152
|
+
name : str
|
153
|
+
age : int
|
154
|
+
|
155
|
+
# TIP:
|
156
|
+
# you can style this the same way with `print`
|
157
|
+
user = input("Enter some information about yourself: ", schema = User)
|
158
|
+
|
159
|
+
# easily run a collection of prebuilt animations
|
160
|
+
animate("This is a rainbow!", type = "rainbow", duration = 2, refresh_rate = 20)
|
161
|
+
```
|
162
|
+
|
163
|
+
Using the various `hammad.logging` resources, you can both create custom & styled
|
164
|
+
loggers, as well as easily inspect various aspects of your code during runtime.
|
165
|
+
|
166
|
+
```python
|
167
|
+
from hammad.logging import Logger
|
168
|
+
|
169
|
+
# create standard / file based loggers easily
|
170
|
+
logger = Logger("hammad", level = "info", rich = Trues)
|
171
|
+
|
172
|
+
file_logger = Logger("hammad-file", level = "info", file = "hammad.log")
|
173
|
+
|
174
|
+
# log to the console
|
175
|
+
logger.info("This is an info message")
|
176
|
+
|
177
|
+
# Use the various `trace_` methods to run various introspection tasks
|
178
|
+
from hammad.logging import (
|
179
|
+
trace,
|
180
|
+
trace_cls,
|
181
|
+
trace_function,
|
182
|
+
trace_http
|
183
|
+
)
|
184
|
+
```
|
@@ -0,0 +1,136 @@
|
|
1
|
+
## hammad-python
|
2
|
+
|
3
|
+
> __Happily Accelerated Micro-Modules (_for_) Application Development__
|
4
|
+
|
5
|
+
## Introduction
|
6
|
+
|
7
|
+
The `hammad-python` library, is a mix of a love letter and collection of mixed resources for
|
8
|
+
developing Python applications. This library is meant to be used for rapid prototyping and
|
9
|
+
development, and is focused on providing styled placeholder tools for common patterns, tasks
|
10
|
+
and workflows.
|
11
|
+
|
12
|
+
The package is currently built into the following structures:
|
13
|
+
|
14
|
+
- `hammad-python` : Contains most core functionality and resources.
|
15
|
+
- `hammad-python[ai]` : Contains easy to use resources for Generative AI related tasks such as
|
16
|
+
generating completions with language models, or creating embeddings.
|
17
|
+
- `hammad-python[serve]` : Contains FastAPI / Uvicorn based resources for serving and running applications.
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
You can install the package using `pip` or `uv`:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
pip install hammad-python
|
25
|
+
|
26
|
+
# or install the `ai` extension
|
27
|
+
# pip install 'hammad-python[ai]'
|
28
|
+
|
29
|
+
# or install the `serve` extension
|
30
|
+
# pip install 'hammad-python[serve]'
|
31
|
+
```
|
32
|
+
|
33
|
+
```bash
|
34
|
+
uv pip install hammad-python
|
35
|
+
|
36
|
+
# or install the `ai` extension
|
37
|
+
# uv pip install 'hammad-python[ai]'
|
38
|
+
|
39
|
+
# or install the `serve` extension
|
40
|
+
# uv pip install 'hammad-python[serve]'
|
41
|
+
```
|
42
|
+
|
43
|
+
## Basic Usage
|
44
|
+
|
45
|
+
### Data Structures, Databases and Other Data Related Resources
|
46
|
+
|
47
|
+
#### Collections
|
48
|
+
|
49
|
+
Using `hammad.data.collections` is a simple way to create searchable collections of
|
50
|
+
data using both `bm25` and `vector` based search.
|
51
|
+
|
52
|
+
```python
|
53
|
+
from hammad.data.collections import create_collection
|
54
|
+
|
55
|
+
# Create either a `vector` or `searchable` collection
|
56
|
+
col = create_collection(type = "searchable")
|
57
|
+
|
58
|
+
# add anything to the collection
|
59
|
+
col.add("This is some text")
|
60
|
+
col.add(5)
|
61
|
+
col.add({'text' : "this is a dictionary"})
|
62
|
+
|
63
|
+
# search the collection
|
64
|
+
print(col.query("text"))
|
65
|
+
```
|
66
|
+
|
67
|
+
#### Databases
|
68
|
+
|
69
|
+
Any collection can be either used as a standalone database, or can be added as one
|
70
|
+
of the collections within a database. Databases provide a unified interface for handling
|
71
|
+
both `Searchable` and `Vector` based collections.
|
72
|
+
|
73
|
+
```python
|
74
|
+
from hammad.data.collections import create_collection
|
75
|
+
from hammad.data.databases import Database
|
76
|
+
|
77
|
+
# Create either a `vector` or `searchable` collection
|
78
|
+
col = create_collection(type = "searchable")
|
79
|
+
|
80
|
+
col.add("This is some text")
|
81
|
+
|
82
|
+
# Databases can either be created on memory or using a path
|
83
|
+
db = Database(location = "memory")
|
84
|
+
|
85
|
+
db.add_collection(col)
|
86
|
+
|
87
|
+
# search globally or within a single collection
|
88
|
+
print(db.query("text"))
|
89
|
+
```
|
90
|
+
|
91
|
+
### Styling / Introspection Resources
|
92
|
+
|
93
|
+
The `hammad-python` package contains a variety of components that can be used
|
94
|
+
to easily style, or run introspection (logging) on your code.
|
95
|
+
|
96
|
+
```python
|
97
|
+
from hammad.cli import print, input, animate
|
98
|
+
|
99
|
+
# Use extended `rich` styling easily
|
100
|
+
print("Hello, World", bg_settings = {"title" : "This is a title"})
|
101
|
+
|
102
|
+
# Easily collect various forms of input in a single function
|
103
|
+
class User(BaseModel):
|
104
|
+
name : str
|
105
|
+
age : int
|
106
|
+
|
107
|
+
# TIP:
|
108
|
+
# you can style this the same way with `print`
|
109
|
+
user = input("Enter some information about yourself: ", schema = User)
|
110
|
+
|
111
|
+
# easily run a collection of prebuilt animations
|
112
|
+
animate("This is a rainbow!", type = "rainbow", duration = 2, refresh_rate = 20)
|
113
|
+
```
|
114
|
+
|
115
|
+
Using the various `hammad.logging` resources, you can both create custom & styled
|
116
|
+
loggers, as well as easily inspect various aspects of your code during runtime.
|
117
|
+
|
118
|
+
```python
|
119
|
+
from hammad.logging import Logger
|
120
|
+
|
121
|
+
# create standard / file based loggers easily
|
122
|
+
logger = Logger("hammad", level = "info", rich = Trues)
|
123
|
+
|
124
|
+
file_logger = Logger("hammad-file", level = "info", file = "hammad.log")
|
125
|
+
|
126
|
+
# log to the console
|
127
|
+
logger.info("This is an info message")
|
128
|
+
|
129
|
+
# Use the various `trace_` methods to run various introspection tasks
|
130
|
+
from hammad.logging import (
|
131
|
+
trace,
|
132
|
+
trace_cls,
|
133
|
+
trace_function,
|
134
|
+
trace_http
|
135
|
+
)
|
136
|
+
```
|
@@ -32,7 +32,6 @@ __all__ = (
|
|
32
32
|
"read_configuration_from_os_vars",
|
33
33
|
"read_configuration_from_os_prefix",
|
34
34
|
"read_configuration_from_dotenv",
|
35
|
-
|
36
35
|
# hammad.data.collections
|
37
36
|
"Collection",
|
38
37
|
"BaseCollection",
|
@@ -41,7 +40,6 @@ __all__ = (
|
|
41
40
|
"SearchableCollection",
|
42
41
|
"SearchableCollectionSettings",
|
43
42
|
"create_collection",
|
44
|
-
|
45
43
|
# hammad.data.databases
|
46
44
|
"Database",
|
47
45
|
"create_database",
|
@@ -287,9 +287,9 @@ class SearchableCollection(BaseCollection, Generic[Object]):
|
|
287
287
|
|
288
288
|
def query(
|
289
289
|
self,
|
290
|
+
query: Optional[str] = None,
|
290
291
|
*,
|
291
292
|
filters: Optional[Filters] = None,
|
292
|
-
search: Optional[str] = None,
|
293
293
|
limit: Optional[int] = None,
|
294
294
|
offset: int = 0,
|
295
295
|
fields: Optional[List[str]] = None,
|
@@ -310,8 +310,8 @@ class SearchableCollection(BaseCollection, Generic[Object]):
|
|
310
310
|
Query items from the collection using tantivy search.
|
311
311
|
|
312
312
|
Args:
|
313
|
+
query: Search query string supporting boolean operators (AND, OR, NOT, +, -)
|
313
314
|
filters: Dictionary of filters to apply to results
|
314
|
-
search: Search query string supporting boolean operators (AND, OR, NOT, +, -)
|
315
315
|
limit: Maximum number of results to return
|
316
316
|
offset: Number of results to skip (for pagination)
|
317
317
|
fields: Specific fields to search in (defaults to content field)
|
@@ -336,7 +336,7 @@ class SearchableCollection(BaseCollection, Generic[Object]):
|
|
336
336
|
return self._storage_backend.query(
|
337
337
|
collection=self.name,
|
338
338
|
filters=filters,
|
339
|
-
search=
|
339
|
+
search=query,
|
340
340
|
limit=limit,
|
341
341
|
offset=offset,
|
342
342
|
fields=fields,
|
@@ -378,16 +378,16 @@ class SearchableCollection(BaseCollection, Generic[Object]):
|
|
378
378
|
self._tantivy_schema, fields[0] if fields else "content", regex_search
|
379
379
|
)
|
380
380
|
query_parts.append((tantivy.Occur.Must, search_query))
|
381
|
-
elif
|
381
|
+
elif query:
|
382
382
|
if phrase:
|
383
383
|
# Phrase query
|
384
|
-
words =
|
384
|
+
words = query.split()
|
385
385
|
search_query = tantivy.Query.phrase_query(
|
386
386
|
self._tantivy_schema, "content", words, slop=phrase_slop
|
387
387
|
)
|
388
388
|
elif fuzzy:
|
389
389
|
# Fuzzy query for each term
|
390
|
-
terms =
|
390
|
+
terms = query.split()
|
391
391
|
fuzzy_queries = []
|
392
392
|
for term in terms:
|
393
393
|
fuzzy_q = tantivy.Query.fuzzy_term_query(
|
@@ -405,13 +405,13 @@ class SearchableCollection(BaseCollection, Generic[Object]):
|
|
405
405
|
# Handle None boost_fields
|
406
406
|
if boost_fields:
|
407
407
|
search_query = self._index.parse_query(
|
408
|
-
|
408
|
+
query,
|
409
409
|
default_field_names=fields or ["content", "title"],
|
410
410
|
field_boosts=boost_fields,
|
411
411
|
)
|
412
412
|
else:
|
413
413
|
search_query = self._index.parse_query(
|
414
|
-
|
414
|
+
query, default_field_names=fields or ["content", "title"]
|
415
415
|
)
|
416
416
|
|
417
417
|
query_parts.append((tantivy.Occur.Must, search_query))
|
@@ -38,9 +38,8 @@ except ImportError:
|
|
38
38
|
from ..collections.base_collection import BaseCollection, Filters, Schema
|
39
39
|
from ..collections.collection import create_collection
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
from ..collections.vector_collection import VectorCollection
|
41
|
+
from ..collections.searchable_collection import SearchableCollection
|
42
|
+
from ..collections.vector_collection import VectorCollection
|
44
43
|
|
45
44
|
__all__ = ("Database",)
|
46
45
|
|
@@ -636,14 +635,22 @@ class Database(Generic[DatabaseEntryType]):
|
|
636
635
|
|
637
636
|
def query(
|
638
637
|
self,
|
638
|
+
query: Optional[str] = None,
|
639
639
|
*,
|
640
640
|
collection: str = "default",
|
641
641
|
filters: Optional[Filters] = None,
|
642
|
-
search: Optional[str] = None,
|
643
642
|
limit: Optional[int] = None,
|
644
643
|
**kwargs,
|
645
644
|
) -> List[DatabaseEntryType]:
|
646
|
-
"""Query items from any collection.
|
645
|
+
"""Query items from any collection.
|
646
|
+
|
647
|
+
Args:
|
648
|
+
query: Search query string supporting boolean operators (AND, OR, NOT, +, -)
|
649
|
+
filters: Dictionary of filters to apply to results
|
650
|
+
limit: Maximum number of results to return
|
651
|
+
offset: Number of results to skip (for pagination)
|
652
|
+
fields: List of fields to return
|
653
|
+
"""
|
647
654
|
# Check modern collections first
|
648
655
|
if collection in self._collections:
|
649
656
|
coll = self._collections[collection]
|
@@ -651,13 +658,13 @@ class Database(Generic[DatabaseEntryType]):
|
|
651
658
|
original_backend = coll._storage_backend
|
652
659
|
coll._storage_backend = None
|
653
660
|
try:
|
654
|
-
return coll.query(filters=filters,
|
661
|
+
return coll.query(filters=filters, query=query, limit=limit, **kwargs)
|
655
662
|
finally:
|
656
663
|
coll._storage_backend = original_backend
|
657
664
|
|
658
665
|
# File storage
|
659
666
|
if self.location == "file":
|
660
|
-
return self._query_from_file(collection, filters,
|
667
|
+
return self._query_from_file(collection, filters, query, limit)
|
661
668
|
|
662
669
|
# Traditional in-memory collection logic
|
663
670
|
if collection not in self._schemas:
|
@@ -676,9 +683,9 @@ class Database(Generic[DatabaseEntryType]):
|
|
676
683
|
continue
|
677
684
|
|
678
685
|
# Basic search implementation
|
679
|
-
if
|
686
|
+
if query:
|
680
687
|
item_text = str(item["value"]).lower()
|
681
|
-
if
|
688
|
+
if query.lower() not in item_text:
|
682
689
|
continue
|
683
690
|
|
684
691
|
results.append(item["value"])
|
@@ -687,6 +694,13 @@ class Database(Generic[DatabaseEntryType]):
|
|
687
694
|
|
688
695
|
return results
|
689
696
|
|
697
|
+
def add_collection(self, collection: BaseCollection) -> None:
|
698
|
+
"""Add a collection to the database."""
|
699
|
+
self._collections[collection.name] = collection
|
700
|
+
self._schemas[collection.name] = collection.schema
|
701
|
+
self._collection_ttls[collection.name] = collection.default_ttl
|
702
|
+
self._storage[collection.name] = {}
|
703
|
+
|
690
704
|
def __getitem__(self, collection_name: str) -> BaseCollection[DatabaseEntryType]:
|
691
705
|
"""Get a collection accessor with full IDE typing support."""
|
692
706
|
# Return modern collection if it exists
|
@@ -725,7 +739,7 @@ class Database(Generic[DatabaseEntryType]):
|
|
725
739
|
limit: Optional[int] = None,
|
726
740
|
) -> List[DatabaseEntryType]:
|
727
741
|
return self._database.query(
|
728
|
-
collection=self.name, filters=filters,
|
742
|
+
collection=self.name, filters=filters, query=search, limit=limit
|
729
743
|
)
|
730
744
|
|
731
745
|
return DatabaseCollectionAccessor(self, collection_name)
|
@@ -783,7 +797,7 @@ def create_database(
|
|
783
797
|
schema_builder: Optional[Any] = None,
|
784
798
|
writer_memory: Optional[int] = None,
|
785
799
|
reload_policy: Optional[str] = None,
|
786
|
-
) ->
|
800
|
+
) -> Database[SearchableCollection]: ...
|
787
801
|
|
788
802
|
|
789
803
|
@overload
|
@@ -799,7 +813,7 @@ def create_database(
|
|
799
813
|
prefer_grpc: Optional[bool] = None,
|
800
814
|
api_key: Optional[str] = None,
|
801
815
|
timeout: Optional[float] = None,
|
802
|
-
) ->
|
816
|
+
) -> Database[VectorCollection]: ...
|
803
817
|
|
804
818
|
|
805
819
|
def create_database(
|
@@ -822,7 +836,7 @@ def create_database(
|
|
822
836
|
prefer_grpc: Optional[bool] = None,
|
823
837
|
api_key: Optional[str] = None,
|
824
838
|
timeout: Optional[float] = None,
|
825
|
-
) ->
|
839
|
+
) -> Database:
|
826
840
|
"""
|
827
841
|
Create a database instance optimized for specific collection types.
|
828
842
|
|
@@ -8,18 +8,8 @@ from typing import TYPE_CHECKING
|
|
8
8
|
from ...performance.imports import create_getattr_importer
|
9
9
|
|
10
10
|
if TYPE_CHECKING:
|
11
|
-
from .base import
|
12
|
-
|
13
|
-
field,
|
14
|
-
validator,
|
15
|
-
is_field,
|
16
|
-
is_model,
|
17
|
-
model_settings
|
18
|
-
)
|
19
|
-
from .pydantic import (
|
20
|
-
convert_to_pydantic_model,
|
21
|
-
convert_to_pydantic_field
|
22
|
-
)
|
11
|
+
from .base import Model, field, validator, is_field, is_model, model_settings
|
12
|
+
from .pydantic import convert_to_pydantic_model, convert_to_pydantic_field
|
23
13
|
|
24
14
|
|
25
15
|
__all__ = (
|
@@ -30,7 +20,6 @@ __all__ = (
|
|
30
20
|
"is_field",
|
31
21
|
"is_model",
|
32
22
|
"model_settings",
|
33
|
-
|
34
23
|
# hammad.models.pydantic
|
35
24
|
"convert_to_pydantic_model",
|
36
25
|
"convert_to_pydantic_field",
|
@@ -41,4 +30,4 @@ __getattr__ = create_getattr_importer(__all__)
|
|
41
30
|
|
42
31
|
|
43
32
|
def __dir__() -> list[str]:
|
44
|
-
return list(__all__)
|
33
|
+
return list(__all__)
|
@@ -293,7 +293,7 @@ class Logger:
|
|
293
293
|
def __init__(
|
294
294
|
self,
|
295
295
|
name: Optional[str] = None,
|
296
|
-
level: Optional[Union[
|
296
|
+
level: Optional[Union[LoggerLevelName, int]] = None,
|
297
297
|
rich: bool = True,
|
298
298
|
display_all: bool = False,
|
299
299
|
level_styles: Optional[Dict[str, LoggerLevelSettings]] = None,
|
@@ -899,7 +899,7 @@ def create_logger_level(
|
|
899
899
|
|
900
900
|
def create_logger(
|
901
901
|
name: Optional[str] = None,
|
902
|
-
level: Optional[Union[
|
902
|
+
level: Optional[Union[LoggerLevelName, int]] = None,
|
903
903
|
rich: bool = True,
|
904
904
|
display_all: bool = False,
|
905
905
|
levels: Optional[Dict[LoggerLevelName, LoggerLevelSettings]] = None,
|