Registry / type-stubs / mypy-boto3-mturk

mypy-boto3-mturk

JSON →
library1.43.0pypypi✓ verified 22d ago

mypy-boto3-mturk provides comprehensive type annotations for the Amazon Mechanical Turk (MTurk) service client within the `boto3` library. It enables static type checking with tools like MyPy, improving code quality and developer experience by offering auto-completion and early error detection. The library is actively maintained, with versions typically synchronized with `boto3` releases and generated by `mypy-boto3-builder`.

pip install boto3 mypy-boto3-mturk
INSTALL
IMPORT
SIG · MYPY-BOTO3-MTURK
M
mypy-boto3-mturk
type-stubspythonv1.43.0
Install
3.9s avg
Import
581ms
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.596s · 52MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.9s · import 0.566s · 53MB
50MB installed
● package 50MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MTurkClient
from mypy_boto3_mturk.client import MTurkClient
from mypy_boto3_mturk import MTurkClient
Client types are typically located in the `.client` submodule for `mypy-boto3` packages.
MTurkServiceName
from mypy_boto3_mturk.literals import MTurkServiceName
Literals for service names are useful for explicit type hinting in `boto3.client` calls.

This quickstart demonstrates how to obtain a type-hinted `MTurkClient` using `boto3` and the `mypy-boto3-mturk` stubs. It uses a `TYPE_CHECKING` guard to ensure the type import is only active during static analysis, preventing runtime import errors if `mypy-boto3-mturk` is not installed in the production environment.

import boto3 from typing import TYPE_CHECKING if TYPE_CHECKING: from mypy_boto3_mturk.client import MTurkClient def get_mturk_client() -> MTurkClient: """Returns a type-hinted MTurk client.""" # boto3.client returns botocore.client.BaseClient at runtime, # but mypy will correctly infer MTurkClient type from the annotation. client: MTurkClient = boto3.client('mturk') return client # Example usage: mturk_client = get_mturk_client() # Now mturk_client has type hints for MTurk service methods # For example, mturk_client.list_hits() will have correct type signatures. # This is a runnable example, but it requires valid AWS credentials # and an active MTurk environment for actual API calls. # print(mturk_client.list_hits()) # Uncomment to run actual API call
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Consequently, `mypy-boto3-mturk` versions generated with this builder (including 1.42.3) and newer require Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >=8.12.0, mypy-boto3-mturk >=1.42.3
breakingIn `mypy-boto3-builder` 8.9.0, there were breaking changes to TypeDef naming conventions, particularly for packed method arguments and conflicting names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).
fix
Review your code for TypeDef imports and update names according to the new conventions. Consult the `mypy-boto3-builder` release notes for specific changes.
affects: mypy-boto3-builder >=8.9.0, mypy-boto3-mturk built with these versions
gotcha`mypy-boto3-mturk` provides *only type annotations*. It does not include the `boto3` library itself. You must install `boto3` separately to use the AWS SDK at runtime.
fix
Ensure `pip install boto3` is executed in your environment alongside `mypy-boto3-mturk`.
affects: All versions
gotchaWhen using standalone `mypy-boto3-*` packages or `boto3-stubs-lite`, explicit type annotations for `boto3.client` and `boto3.resource` calls are often required for optimal type inference.
fix
Always add explicit type hints like `client: MTurkClient = boto3.client('mturk')`.
affects: All versions
gotchaPyCharm users might experience slow performance with `Literal` overloads. It is recommended to use the `boto3-stubs-lite` packages or generate custom stubs locally with `mypy-boto3-builder` to mitigate this issue.
fix
Consider `pip install boto3-stubs-lite[mturk]` or use custom generated stubs for improved IDE performance.
affects: All versions (specifically with PyCharm IDE)
gotchaFor `pylint` compatibility, especially when `mypy-boto3-mturk` is not a runtime dependency, use a `TYPE_CHECKING` guard around type imports and assign `object` to types in the `else` block to avoid `undefined variable` errors from `pylint`.
fix
Implement `if TYPE_CHECKING: from mypy_boto3_mturk.client import MTurkClient else: MTurkClient = object`.
affects: All versions (when using pylint without runtime stub dependency)
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
pythonrequiredRequired Python version.
boto3requiredProvides the AWS SDK for Python; this library only provides type annotations.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources