{"id":9309,"library":"smithy-aws-core","title":"Smithy AWS Core","description":"Smithy AWS Core provides foundational components for building AWS service clients using the Smithy framework in Python. It encapsulates AWS-specific logic for concerns like authentication (signing requests), endpoint resolution, and HTTP transport. Currently at version 0.5.0, it is part of the broader smithy-python ecosystem, meaning API adjustments are expected as it approaches a 1.0 stable release.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/smithy-lang/smithy-python/tree/develop/packages/smithy-aws-core/","tags":["aws","smithy","code-generation","cloud","sdk","api-client"],"install":[{"cmd":"pip install smithy-aws-core","lang":"bash","label":"Install smithy-aws-core"}],"dependencies":[{"reason":"Provides core Smithy runtime components and types, which smithy-aws-core extends.","package":"smithy-python","optional":false},{"reason":"Used for AWS credential and session management within the Smithy Python ecosystem.","package":"aiobotocore","optional":false}],"imports":[{"wrong":"from smithy_aws_core.config import AwsUserConfig","symbol":"AwsUserConfig","correct":"from smithy_aws_core.config import AwsUserConfig"}],"quickstart":{"code":"import asyncio\nimport os\nimport datetime\nfrom smithy_aws_core.config import AwsUserConfig\nfrom smithy_aws_core.signing import AwsSigner\nfrom smithy_python.types import Credentials, UnresolvedUrl\nfrom smithy_python.http import HttpRequest\n\nasync def main():\n    # In a real application, consider using aiobotocore.session.get_session()\n    # for robust credential discovery. For this quickstart, we use environment variables.\n    aws_access_key_id = os.environ.get(\"AWS_ACCESS_KEY_ID\", \"AKIAIOSFODNN7EXAMPLE\")\n    aws_secret_access_key = os.environ.get(\"AWS_SECRET_ACCESS_KEY\", \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\")\n    aws_session_token = os.environ.get(\"AWS_SESSION_TOKEN\", None)\n\n    if aws_access_key_id == \"AKIAIOSFODNN7EXAMPLE\" or aws_secret_access_key == \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\":\n        print(\"Warning: Using dummy AWS credentials. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables for real usage.\")\n\n    credentials = Credentials(\n        access_key_id=aws_access_key_id,\n        secret_access_key=aws_secret_access_key,\n        token=aws_session_token\n    )\n\n    config = AwsUserConfig(\n        region=\"us-east-1\",\n        credentials=credentials,\n        endpoint_url=UnresolvedUrl(\"https://s3.us-east-1.amazonaws.com\") # Example S3 endpoint\n    )\n    print(f\"\\nCreated AWS User Config for region: {config.region}\")\n\n    # Demonstrate an AWS Signer\n    signer = AwsSigner(service_id=\"s3\", config=config) # 's3' is the service ID for S3\n    print(f\"Created AWS Signer for service: {signer.service_id}\")\n\n    # Prepare a dummy HTTP request to be signed\n    request = HttpRequest(\n        method=\"GET\",\n        url=\"https://s3.us-east-1.amazonaws.com/my-bucket\", # Example URL, typically resolved by client\n        headers={\n            \"Host\": \"s3.us-east-1.amazonaws.com\",\n            \"User-Agent\": \"smithy-python-quickstart/1.0\"\n        },\n        body=b\"\"\n    )\n\n    # Sign the request\n    # Note: The 'url' in HttpRequest must be a concrete string, not UnresolvedUrl, for signing.\n    # In a real client, endpoint resolution would convert UnresolvedUrl to a string.\n    signed_request = await signer.sign(request, credentials, datetime.datetime.now(datetime.timezone.utc))\n\n    print(f\"\\n--- Signed Request Details ---\")\n    print(f\"Method: {signed_request.method}\")\n    print(f\"URL: {signed_request.url}\")\n    print(f\"Headers: {signed_request.headers}\")\n    if 'Authorization' in signed_request.headers:\n        print(f\"Authorization header present (truncated): {signed_request.headers['Authorization'][:50]}...\")\n    else:\n        print(\"Authorization header NOT found.\")\n\nasyncio.run(main())\n","lang":"python","description":"This quickstart demonstrates how to initialize core Smithy AWS components like `AwsUserConfig` for regional and credential settings, and how to use `AwsSigner` to sign a basic HTTP request, which is a fundamental step in interacting with AWS services. It uses environment variables for AWS credentials."},"warnings":[{"fix":"Refer to the `smithy-python` repository's changelog or release notes for specific breaking changes when upgrading.","message":"Smithy AWS Core is currently pre-1.0 (version 0.5.0). This means its API is not yet stable, and breaking changes may occur in minor versions without deprecation cycles.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Utilize `aiobotocore.session.get_session()` to retrieve `Credentials` objects compatible with `smithy-aws-core` components, or convert credentials from other sources to `smithy_python.types.Credentials`.","message":"AWS credential and session management within the Smithy Python ecosystem heavily relies on 'aiobotocore'. If you are accustomed to 'boto3', you might need to adapt your credential provider to work with 'aiobotocore' sessions.","severity":"gotcha","affected_versions":"all"},{"fix":"For making actual HTTP calls, rely on a generated Smithy client, which will provide a concrete HTTP client implementation, or instantiate a specific implementation like `smithy_python.http.aiohttp.AiohttpHttpClient`.","message":"Direct instantiation of abstract base classes like `AwsHttpClient` is not typically the way to make HTTP requests. These components are usually integrated into generated Smithy clients.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.5.0':41 '1.0':61 'adjust':54 'api':53,72 'api-cli':71 'approach':59 'authent':30 'aw':2,5,12,24,64 'aws-specif':23 'broader':47 'build':11 'client':14,73 'cloud':69 'code':67 'code-gener':66 'compon':9 'concern':28 'core':3,6 'current':38 'ecosystem':51 'encapsul':22 'endpoint':33 'expect':56 'foundat':8 'framework':18 'generat':68 'http':36 'like':29 'logic':26 'mean':52 'part':44 'provid':7 'python':20,50 'releas':63 'request':32 'resolut':34 'sdk':70 'servic':13 'sign':31 'smithi':1,4,17,49,65 'smithy-python':48 'specif':25 'stabl':62 'transport':37 'use':15 'version':40","created_at":"2026-04-16T18:49:33.036792+00:00","updated_at":"2026-04-16T18:49:33.036792+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'smithy_aws_core.config'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.6.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/smithy-lang/smithy-python","docs":null,"changelog":"https://github.com/smithy-lang/smithy-python/blob/develop/packages/smithy-aws-core/CHANGELOG.md","pypi":"https://pypi.org/project/smithy-aws-core/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws","http-networking","auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}