> ## Documentation Index
> Fetch the complete documentation index at: https://docs.textin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# S3兼容服务

> 配置 S3 兼容的对象存储数据源，支持 AWS S3、MinIO 及各大云厂商

## S3 兼容服务

S3 兼容服务使用 AWS S3 SDK 接入，支持所有兼容 S3 协议的对象存储服务。

### 参数说明

| 参数           | 类型       | 必填 | 说明                      |
| ------------ | -------- | -- | ----------------------- |
| `type`       | `string` | 是  | 固定为 `"s3"`              |
| `endpoint`   | `string` | 是  | S3 服务端点 URL             |
| `access_key` | `string` | 是  | 访问密钥 ID（Access Key ID）  |
| `secret_key` | `string` | 是  | 访问密钥（Secret Access Key） |
| `bucket`     | `string` | 是  | 存储桶名称                   |
| `prefix`     | `string` | 否  | 对象前缀（文件夹路径），默认为空字符串     |
| `region`     | `string` | 否  | 区域名称，默认为 `"us-east-1"`  |

### 通用配置示例

```python theme={null}
source = S3Source(
    endpoint='https://your-s3-endpoint.com',
    access_key='your-access-key-id',
    secret_key='your-secret-access-key',
    bucket='your-bucket-name',
    prefix='documents/',  # 可选，指定文件夹前缀
    region='us-east-1'    # 可选，默认为 us-east-1
)
```

### 支持的服务

xParse 支持以下 S3 兼容服务，点击查看具体配置指南：

* [MinIO](/pipeline/sources/minio) - 高性能对象存储服务
* [AWS S3](/pipeline/sources/aws-s3) - 亚马逊云对象存储
* [阿里云 OSS](/pipeline/sources/aliyun-oss) - 阿里云对象存储服务
* [腾讯云 COS](/pipeline/sources/tencent-cos) - 腾讯云对象存储
* [火山引擎 TOS](/pipeline/sources/volcengine-tos) - 火山引擎对象存储
* [华为云 OBS](/pipeline/sources/huawei-obs) - 华为云对象存储服务

### 使用示例

```python theme={null}
from xparse_client import S3Source, Pipeline

source = S3Source(
    endpoint='https://oss-cn-hangzhou.aliyuncs.com',  # 阿里云 OSS 端点
    access_key='your-access-key-id',
    secret_key='your-secret-access-key',
    bucket='my-documents',
    prefix='pdfs/',  # 只处理 pdfs/ 文件夹下的文件
    region='cn-hangzhou'
)

# ... 其他配置

pipeline = Pipeline(
    source=source,
    # ...其他配置
)
pipeline.run()
```
