Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 40 additions & 24 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# AWS SDK for Python v4

The AWS SDK for Python v4 provides asynchronous clients for supported AWS services.
Each service has its own package.
The AWS SDK for Python v4 provides synchronous and asynchronous clients for
supported AWS services. Each service has its own package.

!!! warning "Developer Preview"

The AWS SDK for Python v4 is intended for evaluation and testing only. Do
not use it for production workloads; use
[Boto3](https://docs.aws.amazon.com/boto3/latest/)
instead.
This SDK is for evaluation and testing only. APIs might change before
general availability, so we recommend pinning the versions of the packages
you install. For production workloads, use
[Boto3](https://aws.amazon.com/sdk-for-python/).

[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`.
- **Sync and async clients.** Each package includes a synchronous client and an
asynchronous client that works with `asyncio`. Both clients use the same
models.
- **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.
- **Generated types.** Each client and its data types are generated from the
service's Smithy model. Operations take keyword arguments and return typed
objects instead of dictionaries.
- **Streaming support.** The asynchronous 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.
Expand Down Expand Up @@ -80,25 +81,40 @@ 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
=== "Sync"

from aws_sdk_dynamodb import AsyncDynamoDBClient, AsyncDynamoDBConfig
```python
from aws_sdk_dynamodb import DynamoDBClient, DynamoDBConfig

config = DynamoDBConfig.resolve(region="us-east-1")

async def main():
config = await AsyncDynamoDBConfig.resolve(region="us-east-1")

async with AsyncDynamoDBClient(config=config) as client:
response = await client.list_tables(limit=10)
with DynamoDBClient(config=config) as client:
response = client.list_tables(limit=10)
for table in response.table_names or []:
print(table)
```

=== "Async"

asyncio.run(main())
```
```python
import asyncio

from aws_sdk_dynamodb import AsyncDynamoDBClient, AsyncDynamoDBConfig


async def main():
config = await AsyncDynamoDBConfig.resolve(region="us-east-1")

async with AsyncDynamoDBClient(config=config) as client:
response = await client.list_tables(limit=10)
for table in response.table_names or []:
print(table)


asyncio.run(main())
```

`AsyncDynamoDBConfig.resolve()` loads shared settings such as retry
The config's `resolve()` method 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.
Expand Down
43 changes: 36 additions & 7 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
/* Custom breadcrumb styling */
.breadcrumb {
font-size: 0.85em;
color: var(--md-default-fg-color--light);
}
/* Symbol page breadcrumbs reuse the theme's path inside the article; undo article styles. */
.md-typeset .md-path {
padding-top: 0;
margin: 0.25rem 0 0.95rem;
}

.md-typeset .md-path .md-path__list {
display: flex;
margin: 0;
list-style: none;
}

.md-typeset .md-path .md-path__item {
margin: 0;
}

p:has(span.breadcrumb) {
margin-top: 0;
.md-typeset .md-path .md-path__link {
color: var(--md-default-fg-color--light);
text-decoration: none;
}

.md-typeset .md-path .md-path__link:is(:focus, :hover) {
color: var(--md-accent-fg-color);
}

/* Light mode - use dark logo */
Expand Down Expand Up @@ -38,3 +53,17 @@ p:has(span.breadcrumb) {
text-decoration: underline;
text-underline-offset: 0.1em;
}

/* Marks operations that only the asynchronous client supports. */
.mode-badge {
display: inline-block;
margin-left: 0.4em;
padding: 0 0.45em;
border: 0.05rem solid var(--md-default-fg-color--lighter);
border-radius: 0.2rem;
color: var(--md-default-fg-color--light);
font-size: 0.7em;
font-weight: 700;
line-height: 1.6;
vertical-align: middle;
}
7 changes: 3 additions & 4 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

{% block announce %}
<strong>Developer Preview:</strong>
This SDK is intended for evaluation and testing only. Do not use it for
production workloads; use
<a href="https://docs.aws.amazon.com/boto3/latest/">Boto3</a>
instead.
This SDK is for evaluation and testing only. APIs might change before general
availability. For production workloads, use
<a href="https://aws.amazon.com/sdk-for-python/">Boto3</a>.
{% endblock %}
Loading
Loading