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
2 changes: 1 addition & 1 deletion content/de/developer/examples/boto3.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ hello.txt 12

## Next steps

See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc).
See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc). If you prefer a community-driven SDK with native async support and full typing, see [capo (Python)](./capo.md).
108 changes: 108 additions & 0 deletions content/de/developer/examples/capo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: "capo (Python)"
description: "Verbinden Sie capo mit RustFS und führen Sie grundlegende Objektoperationen aus Python mit synchronen oder asynchronen Clients aus."
---

[capo](https://github.com/kap-sh/capo) ist ein von der Community entwickeltes AWS-SDK für Python, das vollständig typisierte Clients mit synchroner und asynchroner Unterstützung bietet. Der S3-Client wird als Paket [`capo-s3`](https://pypi.org/project/capo-s3/) ausgeliefert und verbindet sich über einen benutzerdefinierten Endpunkt mit RustFS.

## Installation

capo erfordert Python 3.10 oder höher:

```bash
pip install capo-s3
```

## Konfiguration

Richten Sie den Client auf Ihren RustFS-Endpunkt aus. Ersetzen Sie `http://localhost:9000` durch Ihre Serveradresse und verwenden Sie Ihre eigenen [Zugriffsschlüssel](../../security-compliance/iam/access-token.md). RustFS erfordert pfadbasierte Adressierung, die capo nativ über `force_path_style` aktiviert:

```python
from capo_s3 import Credentials, S3Client

s3 = S3Client(
region="us-east-1",
endpoint="http://localhost:9000",
credentials=Credentials(
access_key="<your-access-key>",
secret_key="<your-secret-key>",
),
force_path_style=True,
)
```

## Verifikation

Erstellen Sie einen Bucket, laden Sie ein Objekt hoch und listen Sie den Bucket auf:

```python
s3.create_bucket(bucket="my-bucket")

s3.put_object(bucket="my-bucket", key="hello.txt", body=b"hello RustFS\n")

for obj in s3.list_objects_v2(bucket="my-bucket").get("contents", []):
print(obj["key"], obj["size"])
```

Erwartete Ausgabe:

```text
hello.txt 13
```

Beim Zurücklesen gibt `get_object` eine Streaming-Antwort zurück, die als Kontextmanager verwendet wird:

```python
with s3.get_object(bucket="my-bucket", key="hello.txt") as response:
content = b"".join(response["body"])

print(content.decode())
```

Sie können außerdem vorsignierte URLs generieren, die zeitlich begrenzten Zugriff ohne Anmeldeinformationen gewähren:

```python
url = s3.presigned_get_object(bucket="my-bucket", key="hello.txt", expire_in=3600)
print(url)
```

## Asynchroner Client

Der asynchrone Client akzeptiert dieselben Argumente und spiegelt jede Operation. Awaiten Sie jeden Aufruf und verwenden Sie asynchrone Kontextmanager für den Client sowie für Streaming-Antworten:

```python
import asyncio

from capo_s3 import AsyncS3Client, Body, Credentials


async def main() -> None:
async with AsyncS3Client(
region="us-east-1",
endpoint="http://localhost:9000",
credentials=Credentials(
access_key="<your-access-key>",
secret_key="<your-secret-key>",
),
force_path_style=True,
) as s3:
await s3.create_bucket(bucket="my-bucket")

await s3.put_object(
bucket="my-bucket",
key="hello.txt",
body=Body.async_from_path("/path/to/hello.txt"),
)

async with s3.get_object(bucket="my-bucket", key="hello.txt") as response:
content = b"".join([chunk async for chunk in response["body"]])

print(content.decode())


asyncio.run(main())
```

## Nächste Schritte

Die paginierte Auflistung folgt derselben Konvention — `iter_list_objects_v2` iteriert über die Ergebnisse. Informationen zur offiziellen AWS-SDK-Alternative finden Sie unter [boto3 (Python)](./boto3.md); weitere Sprachen finden Sie in der [S3-SDK-Übersicht](../sdk/index.md).
1 change: 1 addition & 0 deletions content/de/developer/examples/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"[s3cmd](/de/developer/examples/s3cmd)",
"[rclone](/de/developer/examples/rclone)",
"[boto3 (Python)](/de/developer/examples/boto3)",
"[capo (Python)](/de/developer/examples/capo)",
"[AWS SDK for JavaScript](/de/developer/examples/aws-sdk-js)",
"[AWS SDK for Go](/de/developer/examples/aws-sdk-go)",
"[Terraform](/de/developer/examples/terraform)"
Expand Down
2 changes: 2 additions & 0 deletions content/de/developer/sdk/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,5 @@ def download_file(bucket, object_key, local_path):
```

For other operations (object tagging, bucket policies, and more), see the [Boto3 S3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html) — every S3-compatible call works against RustFS the same way.

If you prefer native async support and full type hints, the community-driven [capo](https://github.com/kap-sh/capo) SDK also works with RustFS — see the [capo (Python) example](../examples/capo.md).
2 changes: 1 addition & 1 deletion content/en/developer/examples/boto3.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ hello.txt 12

## Next steps

See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc).
See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc). If you prefer a community-driven SDK with native async support and full typing, see [capo (Python)](./capo.md).
108 changes: 108 additions & 0 deletions content/en/developer/examples/capo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: "capo (Python)"
description: "Connect capo to RustFS and perform basic object operations from Python with synchronous or asynchronous clients."
---

[capo](https://github.com/kap-sh/capo) is a community-driven AWS SDK for Python offering fully typed clients with both synchronous and asynchronous support out of the box. The S3 client ships as the [`capo-s3`](https://pypi.org/project/capo-s3/) package and connects to RustFS through a custom endpoint.

## Install

capo requires Python 3.10 or later:

```bash
pip install capo-s3
```

## Configure

Point the client at your RustFS endpoint. Replace `http://localhost:9000` with your server address, and use your own [access keys](../../security-compliance/iam/access-token.md). RustFS requires path-style addressing, which capo enables natively through `force_path_style`:

```python
from capo_s3 import Credentials, S3Client

s3 = S3Client(
region="us-east-1",
endpoint="http://localhost:9000",
credentials=Credentials(
access_key="<your-access-key>",
secret_key="<your-secret-key>",
),
force_path_style=True,
)
```

## Verify

Create a bucket, upload an object, and list the bucket:

```python
s3.create_bucket(bucket="my-bucket")

s3.put_object(bucket="my-bucket", key="hello.txt", body=b"hello RustFS\n")

for obj in s3.list_objects_v2(bucket="my-bucket").get("contents", []):
print(obj["key"], obj["size"])
```

Expected output:

```text
hello.txt 13
```

Read the object back — `get_object` returns a streaming response, used as a context manager:

```python
with s3.get_object(bucket="my-bucket", key="hello.txt") as response:
content = b"".join(response["body"])

print(content.decode())
```

You can also generate presigned URLs that grant time-limited access without credentials:

```python
url = s3.presigned_get_object(bucket="my-bucket", key="hello.txt", expire_in=3600)
print(url)
```

## Async client

The asynchronous client accepts the same arguments and mirrors every operation. Await each call and use async context managers for the client and for streaming responses:

```python
import asyncio

from capo_s3 import AsyncS3Client, Body, Credentials


async def main() -> None:
async with AsyncS3Client(
region="us-east-1",
endpoint="http://localhost:9000",
credentials=Credentials(
access_key="<your-access-key>",
secret_key="<your-secret-key>",
),
force_path_style=True,
) as s3:
await s3.create_bucket(bucket="my-bucket")

await s3.put_object(
bucket="my-bucket",
key="hello.txt",
body=Body.async_from_path("/path/to/hello.txt"),
)

async with s3.get_object(bucket="my-bucket", key="hello.txt") as response:
content = b"".join([chunk async for chunk in response["body"]])

print(content.decode())


asyncio.run(main())
```

## Next steps

Paginated listing follows the same convention — `iter_list_objects_v2` iterates over results. For the official AWS SDK alternative, see [boto3 (Python)](./boto3.md), or see the [S3 SDK overview](../sdk/index.md) for more languages.
1 change: 1 addition & 0 deletions content/en/developer/examples/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"[s3cmd](/en/developer/examples/s3cmd)",
"[rclone](/en/developer/examples/rclone)",
"[boto3 (Python)](/en/developer/examples/boto3)",
"[capo (Python)](/en/developer/examples/capo)",
"[AWS SDK for JavaScript](/en/developer/examples/aws-sdk-js)",
"[AWS SDK for Go](/en/developer/examples/aws-sdk-go)",
"[Terraform](/en/developer/examples/terraform)"
Expand Down
2 changes: 2 additions & 0 deletions content/en/developer/sdk/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,5 @@ def download_file(bucket, object_key, local_path):
```

For other operations (object tagging, bucket policies, and more), see the [Boto3 S3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html) — every S3-compatible call works against RustFS the same way.

If you prefer native async support and full type hints, the community-driven [capo](https://github.com/kap-sh/capo) SDK also works with RustFS — see the [capo (Python) example](../examples/capo.md).
2 changes: 1 addition & 1 deletion content/fr/developer/examples/boto3.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ hello.txt 12

## Next steps

See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc).
See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc). If you prefer a community-driven SDK with native async support and full typing, see [capo (Python)](./capo.md).
108 changes: 108 additions & 0 deletions content/fr/developer/examples/capo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: "capo (Python)"
description: "Connectez capo à RustFS et effectuez des opérations objet de base depuis Python avec des clients synchrones ou asynchrones."
---

[capo](https://github.com/kap-sh/capo) est un SDK AWS pour Python développé par la communauté, qui propose des clients entièrement typés avec prise en charge synchrone et asynchrone dès l'installation. Le client S3 est distribué dans le paquet [`capo-s3`](https://pypi.org/project/capo-s3/) et se connecte à RustFS via un point de terminaison personnalisé.

## Installation

capo nécessite Python 3.10 ou ultérieur :

```bash
pip install capo-s3
```

## Configuration

Pointez le client vers votre point de terminaison RustFS. Remplacez `http://localhost:9000` par l'adresse de votre serveur et utilisez vos propres [clés d'accès](../../security-compliance/iam/access-token.md). RustFS exige l'adressage de type chemin, que capo active nativement via `force_path_style` :

```python
from capo_s3 import Credentials, S3Client

s3 = S3Client(
region="us-east-1",
endpoint="http://localhost:9000",
credentials=Credentials(
access_key="<your-access-key>",
secret_key="<your-secret-key>",
),
force_path_style=True,
)
```

## Vérification

Créez un compartiment, téléversez un objet et listez le contenu du compartiment :

```python
s3.create_bucket(bucket="my-bucket")

s3.put_object(bucket="my-bucket", key="hello.txt", body=b"hello RustFS\n")

for obj in s3.list_objects_v2(bucket="my-bucket").get("contents", []):
print(obj["key"], obj["size"])
```

Sortie attendue :

```text
hello.txt 13
```

Pour relire l'objet, `get_object` renvoie une réponse en flux, à utiliser comme gestionnaire de contexte :

```python
with s3.get_object(bucket="my-bucket", key="hello.txt") as response:
content = b"".join(response["body"])

print(content.decode())
```

Vous pouvez également générer des URL présignées qui accordent un accès limité dans le temps sans identifiants :

```python
url = s3.presigned_get_object(bucket="my-bucket", key="hello.txt", expire_in=3600)
print(url)
```

## Client asynchrone

Le client asynchrone accepte les mêmes arguments et propose les mêmes opérations. Utilisez `await` pour chaque appel ainsi que des gestionnaires de contexte asynchrones pour le client et pour les réponses en flux :

```python
import asyncio

from capo_s3 import AsyncS3Client, Body, Credentials


async def main() -> None:
async with AsyncS3Client(
region="us-east-1",
endpoint="http://localhost:9000",
credentials=Credentials(
access_key="<your-access-key>",
secret_key="<your-secret-key>",
),
force_path_style=True,
) as s3:
await s3.create_bucket(bucket="my-bucket")

await s3.put_object(
bucket="my-bucket",
key="hello.txt",
body=Body.async_from_path("/path/to/hello.txt"),
)

async with s3.get_object(bucket="my-bucket", key="hello.txt") as response:
content = b"".join([chunk async for chunk in response["body"]])

print(content.decode())


asyncio.run(main())
```

## Prochaines étapes

Le listage paginé suit la même convention — `iter_list_objects_v2` itère sur les résultats. Pour l'alternative officielle du SDK AWS, voir [boto3 (Python)](./boto3.md) ; la [présentation des SDK S3](../sdk/index.md) répertorie les autres langages.
1 change: 1 addition & 0 deletions content/fr/developer/examples/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"[s3cmd](/fr/developer/examples/s3cmd)",
"[rclone](/fr/developer/examples/rclone)",
"[boto3 (Python)](/fr/developer/examples/boto3)",
"[capo (Python)](/fr/developer/examples/capo)",
"[AWS SDK for JavaScript](/fr/developer/examples/aws-sdk-js)",
"[AWS SDK for Go](/fr/developer/examples/aws-sdk-go)",
"[Terraform](/fr/developer/examples/terraform)"
Expand Down
2 changes: 2 additions & 0 deletions content/fr/developer/sdk/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,5 @@ def download_file(bucket, object_key, local_path):
```

For other operations (object tagging, bucket policies, and more), see the [Boto3 S3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html) — every S3-compatible call works against RustFS the same way.

If you prefer native async support and full type hints, the community-driven [capo](https://github.com/kap-sh/capo) SDK also works with RustFS — see the [capo (Python) example](../examples/capo.md).
2 changes: 1 addition & 1 deletion content/ja/developer/examples/boto3.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ hello.txt 12

## Next steps

See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc).
See the [S3 SDK overview](../sdk/index.md) for more languages, or manage objects with [`rc`](/operations/rc). If you prefer a community-driven SDK with native async support and full typing, see [capo (Python)](./capo.md).
Loading
Loading