boto3-assume
Easily create boto3 assume role sessions with automatic credential refreshing.
Decision gist · record as of 2026-08-14
Yes, if you regularly assume AWS IAM roles in boto3 applications. The package eliminates credential-refresh boilerplate and is lightweight (two dependencies). The aging maintenance status (211 days since last release) is a minor concern for a stable, narrow-scope utility, but check whether your Python version (3.10+) and boto3 version are compatible. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a boto3 Session with automatic credential refreshing already configured; credentials must have permission to assume the target role.
- Low install friction with only two runtime dependencies (boto3, botocore).
- Maintenance status is aging—last release was 211 days ago, though the repository remains active with a recent commit on 2026-01-15.
License · maintenance · safety
Apache License 2.0 (permissive) — Apache License 2.0 is permissive, allowing commercial use, modification, and distribution with minimal restrictions beyond attribution and liability disclaimers.
last release 2026-01-15 (211 days) · last repo commit 2026-01-15 · 3 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 216,159 downloads/mo, #9,385 on PyPI
Alternatives
Verify before relying
pip install boto3-assume
import boto3
from boto3_assume import assume_role
assume_session = assume_role(
source_session=boto3.Session(),
assume_role_kwargs={
"RoleArn": "arn:aws:iam::123412341234:role/my_role",
"RoleSessionName": "my-role-session"
}
)
sts_client = assume_session.client("sts", region_name="us-east-1")- Whether automatic refresh happens transparently on every client call or only when credentials expire.
- Performance overhead compared to creating a standard boto3 session with assume-role credentials.
- Support for cross-account and cross-partition role assumptions beyond standard AWS partitions.
What it is and what it does
boto3-assume is a thin wrapper around boto3 that simplifies the creation of assume-role sessions with built-in credential refreshing. Instead of manually managing STS AssumeRole calls and credential expiration, you pass a source boto3 Session and role details to assume_role(), which returns a new session whose credentials automatically refresh when they expire. The wrapper handles the STS client creation and credential lifecycle internally.
The package is designed for developers who need to work with multiple AWS IAM roles within a single application—particularly in cross-account scenarios or when switching between roles frequently. It reduces boilerplate by eliminating the need to manually track credential expiration times or re-invoke AssumeRole. The underlying mechanism uses boto3's STS client to call assume_role with your specified parameters (RoleArn, RoleSessionName, optional DurationSeconds, tags, etc.) and wraps the resulting credentials in a session that refreshes them transparently.
Use it for
- Cross-account AWS access: assume a role in another AWS account to access resources without managing separate credentials.
- Multi-role applications: switch between different IAM roles within the same application without manual credential refresh logic.
- Long-running services: maintain assume-role credentials that auto-refresh over hours or days without manual intervention.
- Temporary elevated permissions: assume a higher-privilege role for specific tasks, with credentials automatically expiring after a set duration.
- CI/CD pipelines: assume deployment or testing roles without hardcoding temporary credentials in environment variables.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you regularly assume AWS IAM roles in boto3 applications.
The package eliminates credential-refresh boilerplate and is lightweight (two dependencies). The aging maintenance status (211 days since last release) is a minor concern for a stable, narrow-scope utility, but check whether your Python version (3.10+) and boto3 version are compatible. No known vulnerabilities.
Install
boto3-assume on PyPI
Before you install
Low install friction with only two runtime dependencies (boto3, botocore). Maintenance status is aging—last release was 211 days ago, though the repository remains active with a recent commit on 2026-01-15.
Requires a boto3 Session with automatic credential refreshing already configured; credentials must have permission to assume the target role.
License in practice
Apache License 2.0 is permissive, allowing commercial use, modification, and distribution with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install boto3-assume
import boto3
from boto3_assume import assume_role
assume_session = assume_role(
source_session=boto3.Session(),
assume_role_kwargs={
"RoleArn": "arn:aws:iam::123412341234:role/my_role",
"RoleSessionName": "my-role-session"
}
)
sts_client = assume_session.client("sts", region_name="us-east-1")
Verify before relying
- Whether automatic refresh happens transparently on every client call or only when credentials expire.
- Performance overhead compared to creating a standard boto3 session with assume-role credentials.
- Support for cross-account and cross-partition role assumptions beyond standard AWS partitions.
Package facts
| License | Apache License 2.0 permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesboto3botocore |
| Maintenance | Aging 211 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 216,159 / month, #9,385 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules |
Evidence: boto3_assume-0.2.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “aws iam role assumption”
- boto3-assumeWraps boto3 to create AWS IAM assume-role sessions with automatic…
- boto_session_managerWraps boto3 sessions with typed client properties, caching, and…
- aws-cdk.aws-iamProvides Python constructs for defining AWS IAM roles, policies,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also aws-assume-role-lib · boto_session_manager · gimme-aws-creds · aws-sso-lib · cloudsec-audit · alibabacloud-credentials · requests-aws-sign · aws-cdk.aws-iam · alibabacloud-sts20150401 · pymongo-auth-aws