Registry / aws / arn
library0.1.5pypypi✓ verified 83d ago

A lightweight Python library for parsing and manipulating AWS ARNs (Amazon Resource Names). Version 0.1.5, low activity.

pip install arn
INSTALL
IMPORT
SIG · ARN
A
arn
awspythonv0.1.5
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.5 · 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.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

Arn
from arn import Arn
from arn import ARN

Parse an AWS ARN and access its components.

from arn import ARN arn_str = os.environ.get('AWS_ARN', 'arn:aws:iam::123456789012:user/JohnDoe') try: parsed = ARN(arn_str) print(f'Service: {parsed.service}, Region: {parsed.region}, Account: {parsed.account}, Resource: {parsed.resource}') except Exception as e: print(f'Invalid ARN: {e}')
Debug
Known issues
gotchaThe ARN constructor does not validate that the partition matches known AWS partitions (e.g., 'aws', 'aws-cn', 'aws-us-gov'). It accepts arbitrary strings, so 'arn:foo:...' parses without error.
fix
Validate partition manually with a whitelist if needed.
affects: all
gotchaThe library does not support ARNs with resource qualifiers (like 'arn:aws:s3:::bucket/key') via the standard resource attribute; you may need to parse the resource string manually.
fix
Use `parsed.resource` and split on '/' or ':' as needed.
affects: all
Upgrade
Version history
0.1.5latest on PyPI · released Mar 5, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
30
Resources
arn — pip install arn · libregistry