跳转到主要内容

S3 兼容服务

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

参数说明

参数类型必填说明
typestring固定为 "s3"
endpointstringS3 服务端点 URL
access_keystring访问密钥 ID(Access Key ID)
secret_keystring访问密钥(Secret Access Key)
bucketstring存储桶名称
prefixstring对象前缀(文件夹路径),默认为空字符串
regionstring区域名称,默认为 "us-east-1"

通用配置示例

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 兼容服务,点击查看具体配置指南:

使用示例

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()