-
Notifications
You must be signed in to change notification settings - Fork 18
Improve the API reference landing page #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jonathan343
wants to merge
6
commits into
develop
Choose a base branch
from
api-ref-home
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+155
−1
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9d33016
checkpoint
jonathan343 74ba238
updates
jonathan343 8743ced
Improve API reference overview and add Developer Preview banner
jonathan343 f04bbc0
unslop
jonathan343 972c2ef
Improve API reference setup and credential guidance
jonathan343 567b9bf
restore missing tables fallback in example
jonathan343 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,114 @@ | ||
| # AWS SDK for Python | ||
|
|
||
| --8<-- "README.md:2" | ||
| The AWS SDK for Python provides asynchronous clients for supported AWS services. | ||
| Each service has its own package. | ||
|
|
||
| !!! warning "Developer Preview: Not for production use" | ||
|
|
||
| Use this SDK for evaluation and pre-production testing. Interfaces and | ||
| behavior may change before general availability. Use | ||
| [Boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) | ||
| for production workloads. | ||
|
|
||
| [Browse clients](clients/index.md){ .md-button .md-button--primary } | ||
| [View source](https://github.com/aws/aws-sdk-python){ .md-button } | ||
|
|
||
| ## Features | ||
|
|
||
| - **Async operations.** Every service operation is an `async` method that works | ||
| with `asyncio`. | ||
| - **Per-service packages.** Install only the clients your application uses. | ||
| - **Type annotations.** Operations, input models, and response models include | ||
| type annotations, so editors and type checkers do not need separate stub | ||
| packages. | ||
| - **Streaming support.** Clients for streaming services support event streams | ||
| and bidirectional streaming. | ||
|
|
||
| The code generator builds each client from its service's | ||
| [Smithy](https://smithy.io/) model. | ||
|
|
||
| ## Install a client | ||
|
|
||
| The clients require Python 3.12 or later. Follow the | ||
| [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/), | ||
| then create and activate a virtual environment: | ||
|
|
||
| ```bash | ||
| uv venv --python 3.12 | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| === "One client" | ||
|
|
||
| Install the Amazon DynamoDB client from its service package: | ||
|
|
||
| ```bash | ||
| uv pip install aws-sdk-dynamodb | ||
| ``` | ||
|
|
||
| === "Several clients" | ||
|
|
||
| Use the `aws-sdk-python` meta-package to install several clients at | ||
| compatible versions. Select clients with package extras: | ||
|
|
||
| ```bash | ||
| uv pip install "aws-sdk-python[bedrock-runtime,sts]" | ||
| ``` | ||
|
|
||
| See [available clients](clients/index.md) for a list of service packages. | ||
|
|
||
| ## List DynamoDB tables | ||
|
|
||
| Before running the example, grant an identity `dynamodb:ListTables` permission | ||
| and configure AWS credentials. The default credential chain checks these | ||
| built-in sources: | ||
|
|
||
| - Environment variables such as `AWS_ACCESS_KEY_ID`, | ||
| `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` | ||
| - Shared AWS config and credentials files, including `credential_process` | ||
|
|
||
| Other supported providers come from `aws-credentials-*` packages. Install and | ||
| configure the package for your environment: | ||
|
|
||
| - `aws-credentials-sts` for profile-based AssumeRole | ||
| - `aws-credentials-http` for Amazon ECS or Amazon EKS container credentials | ||
| - `aws-credentials-imds` for Amazon EC2 instance metadata | ||
|
|
||
| The SDK detects installed provider packages and adds them to the chain | ||
| automatically. You do not need to pass a credential resolver or change the | ||
| client code. The IAM Identity Center (SSO) credential provider and the login | ||
| credentials provider are not yet supported. | ||
|
|
||
| Use the [Amazon DynamoDB client](clients/dynamodb/index.md) to list up to ten | ||
| tables in `us-east-1`: | ||
|
|
||
| ```python | ||
| import asyncio | ||
|
|
||
| from aws_sdk_dynamodb.client import AsyncDynamoDBClient | ||
| from aws_sdk_dynamodb.config import AsyncDynamoDBConfig | ||
| from aws_sdk_dynamodb.models import ListTablesInput | ||
|
|
||
|
|
||
| async def main(): | ||
| config = await AsyncDynamoDBConfig.resolve(region="us-east-1") | ||
|
|
||
| async with AsyncDynamoDBClient(config=config) as client: | ||
| response = await client.list_tables(input=ListTablesInput(limit=10)) | ||
| for table in response.table_names or []: | ||
| print(table) | ||
|
|
||
|
|
||
| asyncio.run(main()) | ||
| ``` | ||
|
|
||
| `AsyncDynamoDBConfig.resolve()` loads shared settings such as retry | ||
| configuration. Here, the `region` argument overrides a region set in the | ||
| environment or shared config. The client resolves credentials through the | ||
| default chain when it sends the request. | ||
|
|
||
| ## Documentation and support | ||
|
Alan4506 marked this conversation as resolved.
|
||
|
|
||
| - [Browse client API references](clients/index.md) | ||
| - [Contribute to the SDK](contributing.md) | ||
| - [Report a bug or request a feature](https://github.com/aws/aws-sdk-python/issues/new/choose) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block announce %} | ||
| <strong>Developer Preview:</strong> | ||
| This SDK is not for production use, and its APIs and behavior may change. | ||
| For production workloads, use | ||
| <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">Boto3</a>. | ||
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.