Skip to main content

Type annotations for boto3.Glacier 1.14.18 service, generated by mypy-boto3-buider 2.2.0

Project description

mypy-boto3-glacier

PyPI - mypy-boto3-glacier PyPI - Python Version Docs

Type annotations for boto3.Glacier 1.14.18 service compatible with mypy, VSCode, PyCharm and other tools.

Generated by mypy-boto3-buider 2.2.0.

More information can be found on boto3-stubs page.

How to install

Make sure you have mypy installed and activated in your IDE.

Install boto3-stubs for Glacier service.

python -m pip install boto3-stubs[glacier]

How to use

Client annotations

GlacierClient provides annotations for boto3.client("glacier").

import boto3

from mypy_boto3_glacier import GlacierClient, GlacierServiceResource
from mypy_boto3_glacier.paginator import (
    ListJobsPaginator,
    ListMultipartUploadsPaginator,
    ListPartsPaginator,
    ListVaultsPaginator,
)
from mypy_boto3_glacier.service_resource import (
    Account,
    Archive,
    Job,
    MultipartUpload,
    Notification,
    ServiceResourceVaultsCollection,
    Vault,
)
from mypy_boto3_glacier.type_defs import CSVInputTypeDef, ...
from mypy_boto3_glacier.waiter import VaultExistsWaiter, VaultNotExistsWaiter

client: GlacierClient = boto3.client("glacier")

# now client usage is checked by mypy and IDE should provide code auto-complete

# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: GlacierClient = session.client("glacier")

Paginators annotations

mypy_boto3_glacier.paginator module contains type annotations for all paginators.

client: GlacierClient = boto3.client("glacier")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
list_jobs_paginator: ListJobsPaginator = client.get_paginator("list_jobs")
list_multipart_uploads_paginator: ListMultipartUploadsPaginator = client.get_paginator("list_multipart_uploads")
list_parts_paginator: ListPartsPaginator = client.get_paginator("list_parts")
list_vaults_paginator: ListVaultsPaginator = client.get_paginator("list_vaults")

Waiters annotations

mypy_boto3_glacier.waiter module contains type annotations for all waiters.

client: GlacierClient = boto3.client("glacier")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
vault_exists_waiter: VaultExistsWaiter = client.get_waiter("vault_exists")
vault_not_exists_waiter: VaultNotExistsWaiter = client.get_waiter("vault_not_exists")

Service Resource annotations

GlacierServiceResource provides annotations for boto3.resource("glacier").

resource: GlacierServiceResource = boto3.resource("glacier")

# now resource usage is checked by mypy and IDE should provide code auto-complete

# works for session as well
session = boto3.session.Session(region="us-west-1")
session_resource: GlacierServiceResource = session.resource("glacier")

Other resources annotations

mypy_boto3_glacier.service_resource module contains type annotations for all resources.

resource: GlacierServiceResource = boto3.resource("glacier")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
my_account: Account = resource.Account(...)
my_archive: Archive = resource.Archive(...)
my_job: Job = resource.Job(...)
my_multipart_upload: MultipartUpload = resource.MultipartUpload(...)
my_notification: Notification = resource.Notification(...)
my_vault: Vault = resource.Vault(...)

Collections annotations

mypy_boto3_glacier.service_resource module contains type annotations for all GlacierServiceResource collections.

resource: GlacierServiceResource = boto3.resource("glacier")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
vaults: glacier_resources.ServiceResourceVaultsCollection = resource.vaults

Typed dictionations

mypy_boto3_glacier.type_defs module contains structures and shapes assembled to typed dictionaries for additional type checking.

def get_structure() -> CSVInputTypeDef:
    return {
      ...
    }

Dynamic type annotations

mypy_boto3 command generates boto3.client/resource type annotations for mypy_boto3_glacier and other installed services.

# Run this command after you add or remove service packages
python -m mypy_boto3

Generated type annotations provide overloads for boto3.client and boto3.resource, boto3.Session.client and boto3.Session.resource functions, so explicit type annotations are not needed.

  • mypy supports function overloads as expected
  • PyCharm also supports function overloads, but consumes a lot of RAM, use carefully if you have many services installed
  • VSCode does not currently support function overloads, use explicit type annotations
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("glacier")
resource = boto3.resource("glacier")

session_client = boto3.Session().client("glacier")
session_resource = boto3.Session().resource("glacier")

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mypy-boto3-glacier-1.14.18.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mypy_boto3_glacier-1.14.18.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file mypy-boto3-glacier-1.14.18.0.tar.gz.

File metadata

  • Download URL: mypy-boto3-glacier-1.14.18.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for mypy-boto3-glacier-1.14.18.0.tar.gz
Algorithm Hash digest
SHA256 ece9543ab4c975caaab7479d9a038f3a46df97ac5046e8c81bd49c37ea8109ba
MD5 62c1f833b4eae1bad1291560a3e7777e
BLAKE2b-256 7e5ec266147249058e79d740c0b9a184cd2bda0446b5702f680d73f35a238898

See more details on using hashes here.

File details

Details for the file mypy_boto3_glacier-1.14.18.0-py3-none-any.whl.

File metadata

  • Download URL: mypy_boto3_glacier-1.14.18.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for mypy_boto3_glacier-1.14.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7964eca7768e1988d86297ef996d676252c4cbb9643c2a49253c947e05995b0f
MD5 fa4a91ba5b05ba95b70ffe1d31f48b40
BLAKE2b-256 8b741669899059f5a37a4a95b44e974f532b00ad654ddf58c88611de24fe4723

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page