mypy-boto3-s3vectors
mypy-boto3-s3vectors provides type annotations for the boto3 S3Vectors 1.42.3 service, enhancing development with static type checking and IDE auto-completion. It is automatically generated by mypy-boto3-builder 8.12.0. The project maintains an active release cadence, aligning with boto3 updates.
Warnings
- breaking Support for Python 3.8 has been removed in mypy-boto3-builder version 8.12.0. Users on Python 3.8 will need to upgrade to Python 3.9 or newer to use versions generated by this builder or the corresponding stubs.
- breaking The library has migrated to PEP 561 compliant packages as of mypy-boto3-builder 8.12.0. This change affects package structure and how type checkers locate stubs, potentially requiring updates to build configurations or older `mypy` versions.
- breaking Type Definition (TypeDef) names for packed method arguments have been shortened, and conflicting `Extra` postfixes have been moved as of mypy-boto3-builder 8.9.0. This is a breaking change for code explicitly importing or referencing these TypedDict names.
- deprecated If you were previously using older `mypy-boto3` packages (pre-`boto3-stubs` era), the legacy `mypy-boto3` system has been moved to a separate product in mypy-boto3-builder 8.9.0 and is no longer generated alongside `boto3-stubs`.
Install
-
pip install mypy-boto3-s3vectors -
pip install 'boto3-stubs[s3vectors]'
Imports
- S3VectorsClient
from mypy_boto3_s3vectors import S3VectorsClient
- ListIndexesPaginator
from mypy_boto3_s3vectors.paginator import ListIndexesPaginator
- DataTypeType
from mypy_boto3_s3vectors.literals import DataTypeType
- EncryptionConfigurationTypeDef
from mypy_boto3_s3vectors.type_defs import EncryptionConfigurationTypeDef
Quickstart
import boto3
from boto3.session import Session
from mypy_boto3_s3vectors import S3VectorsClient
from mypy_boto3_s3vectors.paginator import ListIndexesPaginator
from mypy_boto3_s3vectors.type_defs import CreateIndexRequestRequestTypeDef
def main():
session = Session(region_name="us-east-1") # Use a specific region
s3vectors_client: S3VectorsClient = session.client("s3vectors")
# Example client operation (dummy call for demonstration)
# Note: S3Vectors service methods should be referenced from AWS S3Vectors documentation
# This is a placeholder demonstrating type annotation usage.
try:
# Assuming 'list_indexes' is an available operation to demonstrate a paginator
list_indexes_paginator: ListIndexesPaginator = s3vectors_client.get_paginator("list_indexes")
print(f"Paginator for list_indexes created: {list_indexes_paginator}")
# Example of using a TypedDict for a request (assuming CreateIndex operation)
create_index_params: CreateIndexRequestRequestTypeDef = {
"Name": "my-test-index",
"VectorBucketName": "my-vector-bucket",
"VectorIndexConfig": {"VectorDimension": 1536},
# ... other required parameters for CreateIndex
}
# result = s3vectors_client.create_index(**create_index_params)
print(f"Example TypedDict for CreateIndex: {create_index_params}")
except Exception as e:
print(f"An error occurred (this is an example, actual S3Vectors operations may vary): {e}")
if __name__ == "__main__":
main()