aws-sdk-python-usage

Write Python code using boto3 and botocore with correct AWS SDK patterns.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill aws-sdk-python-usage-sakicodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-sdk-python-usage
Source: https://github.com/sakicodes/BuildFestHackathon26/tree/main/.agents/skills/aws-sdk-python-usage
Command: npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill aws-sdk-python-usage-sakicodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires boto3, botocore, and includes references (resource) components.

What problem does it solve? Writing Python code against AWS services with boto3 often leads to subtle mistakes: wrong exception imports, manual pagination loops, raw AttributeValue dicts from DynamoDB, and unclosed S3 streaming bodies. This Skill provides authoritative patterns for clients, resources, sessions, error handling, pagination, waiters, and service-specific APIs so generated code follows AWS SDK best practices. ## Core Features & Use Cases - Client vs Resource Guidance: Choose between low-level clients and high-level resources, with correct session, credential, and profile configuration. - Error Handling & Resilience: Use typed client exceptions, botocore.config.Config retries and timeouts, paginators with JMESPath filtering, and waiters for resource state polling. - Service Deep Dives: Detailed references for S3 transfers and presigned URLs, and DynamoDB operations with automatic type marshalling via the resource interface. - Use Case: When asked to write a script that uploads files to S3 with progress callbacks and retries, or query a DynamoDB table with condition expressions, this Skill ensures the generated code uses upload_file with TransferConfig, Key/Attr condition builders, and proper exception handling. ## Quick Start Ask the assistant to write a Python script using boto3 that lists S3 objects with pagination and handles errors with typed exceptions.

Frequently Asked Questions about aws-sdk-python-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors with boto3 ClientError in Python?

Import ClientError from botocore.exceptions, not boto3. Prefer typed exceptions on the client such as client.exceptions.ResourceNotFoundException, and only catch exceptions when you have an actionable response like returning a fallback or retrying.

Should I use boto3 client or resource for DynamoDB?

Use the resource interface for DynamoDB because it auto-marshals Python types instead of returning AttributeValue dicts. If you need paginators, use boto3.resource("dynamodb").meta.client, which still auto-converts types.

How do I paginate AWS API results in boto3?

Use client.get_paginator(operation) instead of manually looping with NextToken. Call .search() with a JMESPath expression to extract and flatten specific fields across pages, or iterate pages directly for per-page control.

How do I generate a presigned URL for S3 with boto3?

Call s3.generate_presigned_url with the operation name such as get_object or put_object, a Params dict with Bucket and Key, and ExpiresIn in seconds. For browser form uploads, use generate_presigned_post with conditions and fields.

Why does my boto3 DynamoDB query return AttributeValue dicts?

You are using boto3.client("dynamodb"), which returns raw types like {"S": "value"}. Switch to the resource interface or the resource's meta.client to get plain Python types automatically.

How do I configure retries and timeouts for boto3 clients?

Pass a botocore.config.Config object to the client with retries settings such as total_max_attempts and mode, plus connect_timeout and read_timeout values. Configs can be merged and shared across multiple clients.