simple-arn
A simple AWS ARN parsing and serialization package.
Supports python 3.7+ or 3.6 with the dataclasses backport.
Motivation
Other AWS ARN parsing libraries provide parsing functionality but lack the ability to serialize the parsed ARN back into a string.
Sometimes it is necessary to swap parts of arn strings in the case of resource migration automation and this package provides a simple way to do this:
from simple_arn import AwsArn
arn = AwsArn.parse("arn:aws:iam::123456789012:user/MyUserName")\
.clone(resource="MyOtherUserName")
print(str(arn)) # prints: arn:aws:iam::123456789012:user/MyOtherUserName
Installation
install from PyPI: pip install simple-arn
Usage
This package provides the functionality to parse AWS ARNs into a dataclass AwsArn
and AwsArn objects can be serialized back into arn strings by simply calling the
object's __str__ method.
AwsArn objects expose a clone method allowing for copies of AwsArn objects
with modified attributes.
Example:
from simple_arn import AwsArn
arn = AwsArn.parse("arn:aws:iam::123456789012:user/MyUserName")
print(str(arn)) # prints: arn:aws:iam::123456789012:user/MyUserName
# clone the arn with a different resource
arn2 = arn.clone(resource="MyOtherUserName")
print(str(arn2)) # prints: arn:aws:iam::123456789012:user/MyOtherUserName
Metadata
Release files for simple-arn 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple_arn-0.0.3.tar.gz | 3.5 kB | Without provenance | Details for simple_arn-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_arn-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for simple_arn-0.0.3-py3-none-any.whl |
Total release size: 7.3 kB
Release files / simple_arn-0.0.3.tar.gz
| Download URL | simple_arn-0.0.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16dd6b9cf22801bc4c55bdc678e959688f247b40dc6232e29dcea0d52ea24534
|
|
BLAKE2b-256 checksum How to use checksums |
9a2c65fcda48b33ed2319351df1665e1c7d22f67a93fee3dae8800a8ea800f66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / simple_arn-0.0.3-py3-none-any.whl
| Download URL | simple_arn-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a99f4be8b2f98bbc25c80d48d7b99042880ddd888e81a4b2aa5c9c2ca634aa72
|
|
BLAKE2b-256 checksum How to use checksums |
1badb1b8c16610e8797be738a1a5b0c110888cb751915bd45ae63f75e8635988
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Security for simple-arn 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.