Skip to content

Examples#

Index > finspace > Examples

Auto-generated documentation for finspace type annotations stubs module mypy-boto3-finspace.

Client#

Implicit type annotations#

Can be used with boto3-stubs[finspace] package installed.

Write your finspace code as usual, type checking and code completion should work out of the box.

# finspaceClient usage example

from boto3.session import Session


session = Session()

client = session.client("finspace")  # (1)
result = client.create_environment()  # (2)
  1. client: finspaceClient
  2. result: CreateEnvironmentResponseTypeDef
# ListKxEnvironmentsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("finspace")  # (1)

paginator = client.get_paginator("list_kx_environments")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: finspaceClient
  2. paginator: ListKxEnvironmentsPaginator
  3. item: ListKxEnvironmentsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[finspace] or a standalone mypy_boto3_finspace package, you have to explicitly specify client: finspaceClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

# finspaceClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_finspace.client import finspaceClient
from mypy_boto3_finspace.type_defs import CreateEnvironmentResponseTypeDef
from mypy_boto3_finspace.type_defs import CreateEnvironmentRequestRequestTypeDef


session = Session()

client: finspaceClient = session.client("finspace")

kwargs: CreateEnvironmentRequestRequestTypeDef = {...}
result: CreateEnvironmentResponseTypeDef = client.create_environment(**kwargs)
# ListKxEnvironmentsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_finspace.client import finspaceClient
from mypy_boto3_finspace.paginator import ListKxEnvironmentsPaginator
from mypy_boto3_finspace.type_defs import ListKxEnvironmentsResponseTypeDef


session = Session()
client: finspaceClient = session.client("finspace")

paginator: ListKxEnvironmentsPaginator = client.get_paginator("list_kx_environments")
for item in paginator.paginate(...):
    item: ListKxEnvironmentsResponseTypeDef
    print(item)