{"id":20945,"library":"arn","title":"arn","description":"A lightweight Python library for parsing and manipulating AWS ARNs (Amazon Resource Names). Version 0.1.5, low activity.","status":"active","version":"0.1.5","language":"python","source_language":"en","source_url":"https://github.com/quantumcygn/arn","tags":["aws","arn","parsing"],"install":[{"cmd":"pip install arn","lang":"bash","label":"pip"}],"dependencies":[],"imports":[{"note":"Imported module does not expose ARN as top-level; must explicitly import the class.","wrong":"import arn","symbol":"ARN","correct":"from arn import ARN"}],"quickstart":{"code":"from arn import ARN\n\narn_str = os.environ.get('AWS_ARN', 'arn:aws:iam::123456789012:user/JohnDoe')\ntry:\n    parsed = ARN(arn_str)\n    print(f'Service: {parsed.service}, Region: {parsed.region}, Account: {parsed.account}, Resource: {parsed.resource}')\nexcept Exception as e:\n    print(f'Invalid ARN: {e}')","lang":"python","description":"Parse an AWS ARN and access its components."},"warnings":[{"fix":"Validate partition manually with a whitelist if needed.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `parsed.resource` and split on '/' or ':' as needed.","message":"The 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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from arn import ARN' or 'import arn; arn.ARN'.","cause":"Importing the module instead of the class.","error":"AttributeError: module 'arn' has no attribute 'ARN'"},{"fix":"Ensure the string starts with 'arn:' and follows the pattern 'arn:partition:service:region:account:resource'.","cause":"The input string does not match the ARN format (e.g., missing 'arn:' prefix).","error":"arn.ArnException: Invalid ARN string"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}