Skip to main content

s3pe for Python

PyPI CI License: MIT DOI

Read and write data on any S3-compatible object store (AWS S3, Garage, MinIO, Ceph, …). Nine verbs, two environment variables, and a Rust core that signs, retries and checks every transfer.

Website: https://strategicprojects.github.io/s3pe/python/ · API reference: https://strategicprojects.github.io/s3pe/python/api/ · Português

Install

pip install s3pe            # bytes, str, dict/list and files
pip install "s3pe[pandas]"  # also CSV, Parquet and Excel as DataFrames

Wheels for Linux (x86_64, aarch64), macOS (Intel, Apple silicon) and Windows; Python 3.9 or later.

Use

import s3pe

# S3PE_ENDPOINT, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in the environment
meta = s3pe.read_s3("s3://my-bucket/data/manifest.json")      # dict
meta["version"]

df = s3pe.read_s3("series/sales.csv.gz", bucket="my-bucket")  # DataFrame
s3pe.write_s3(df, "s3://my-bucket/reports/sales.parquet")      # by extension
s3pe.upload_s3("figure1.png", "s3://my-bucket/reports/")       # keeps the file name
s3pe.download_s3("s3://my-bucket/data/regions.geojson", "regions.geojson")

for o in s3pe.list_s3("s3://my-bucket/data/"):
    print(o.size, o.key)
s3pe.exists_s3("s3://my-bucket/data/manifest.json")
s3pe.delete_s3("s3://my-bucket/reports/old.parquet")

Every call prints one line on stderr (↑ s3://my-bucket/reports/sales.parquet (1.2 MB, 0.3 s)); s3pe.quiet() or S3PE_QUIET=1 silences it.

With S3PE_BUCKET=my-bucket in the environment, or after s3pe.configure(bucket="my-bucket"), bare keys work: s3pe.read_s3("data/manifest.json"). For explicit settings use a client:

s3 = s3pe.Client(endpoint="http://127.0.0.1:9000", bucket="my-bucket",
                 access_key="...", secret_key="...")
s3.read("data/manifest.json")
s3.write(df, "reports/sales.csv")
s3.list("data/")

Formats

Extension read_s3 returns write_s3 accepts
.json, .geojson dict / list dict, list, str, DataFrame (orient="records")
.csv, .csv.gz, .tsv pandas.DataFrame DataFrame
.parquet pandas.DataFrame DataFrame
.xlsx pandas.DataFrame DataFrame
.txt, .md, .html, .xml, .svg, ... str str
anything else bytes bytes, file-like, pathlib.Path

format="bytes" (or "text", "json", "csv", "parquet", "xlsx") overrides the extension; extra keyword arguments go to the reader or writer (s3pe.read_s3("x.csv", bucket="b", sep=";", dtype=str)). A .gz suffix is compressed and decompressed on the way.

Configuration

Setting Environment Default
endpoint S3PE_ENDPOINT, then AWS_ENDPOINT_URL required (https://host[:port])
region AWS_REGION, then AWS_DEFAULT_REGION us-east-1
credentials AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY (AWS_SESSION_TOKEN) required
bucket S3PE_BUCKET none: use s3://bucket/key or bucket=

Errors

All errors derive from s3pe.S3Error: NotFoundError (404), AccessDeniedError (403), HttpError (other statuses, with .status, .code, .message), TransportError (network, after retries), ConfigError (missing endpoint, credentials or bucket) and IntegrityError (the bytes that arrived differ from the bytes sent). exists_s3 and head_s3 turn 404 into False / None.

What happens in every call

Resolve the key, hash the payload, sign with SigV4, send, retry on 429 and 5xx, verify the ETag and Content-Length; success logs one line, errors are typed.

Dependable by default

  • SigV4 signatures over the real SHA-256 of the payload, path-style URLs.
  • Connection failures and HTTP 429/500/502/503/504 are retried twice (1 s, then 2 s). Other errors are raised at once, typed.
  • After an upload the server's ETag is compared with the local MD5; after a download the byte count with Content-Length and, when the ETag is an MD5, the MD5 of what arrived.
  • Files are streamed to a .s3pe-part file and renamed when complete.
  • The Rust core releases the GIL during transfers.

Architecture

The Python package is a PyO3 binding on the Rust crate; R and Go have their own implementations of the same specification. All talk to any S3-compatible store.

Em português

s3pe lê e grava dados em qualquer armazenamento de objetos compatível com S3, com nove verbos: read_s3, write_s3, download_s3, upload_s3, list_s3, delete_s3, exists_s3, head_s3, buckets_s3. O endpoint e as credenciais vêm do ambiente (S3PE_ENDPOINT, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY); o formato vem da extensão do arquivo. Cada transferência imprime uma linha no terminal; s3pe.quiet() silencia.

The family

The same package exists for R (install.packages("s3pe")), Rust (cargo add s3pe, with the s3pe command line) and Go (go get github.com/StrategicProjects/s3pe), all in one repository.

Made in Pernambuco 🌵

s3pe is developed in Recife, Brazil. MIT license.

Metadata

Release files for s3pe 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for s3pe 0.2.0
File Size Uploaded Provenance
s3pe-0.2.0.tar.gz 51.4 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for s3pe 0.2.0
File
s3pe-0.2.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
s3pe-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
s3pe-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
s3pe-0.2.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
s3pe-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 6.4 MB

Release files / s3pe-0.2.0.tar.gz

Download URL s3pe-0.2.0.tar.gz
Size 51.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0a2eecb9c698f8fe4e7c1a73d9bc7fe62b5db5ffdfa9aee28f7c1eb81d372c4c
BLAKE2b-256 checksum
How to use checksums
5a6beffde0f68db48a47e374e4c51a80f7aa2912c07e8e40377368ddc7d68edb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / s3pe-0.2.0-cp39-abi3-win_amd64.whl

Download URL s3pe-0.2.0-cp39-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8a79c8f50c356a3728ee7c93a07a8d1ea480149e262e05aecad9bbf2a481efcd
BLAKE2b-256 checksum
How to use checksums
0936e4bdf7f5b498c9aa4e501466f7f658773f7fafb068600f40c479c23063f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / s3pe-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL s3pe-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
2b9590dc1dc3028353e28753def2ccf3350b6604a4a7eb04c8a11e9ae1cc7646
BLAKE2b-256 checksum
How to use checksums
cae40a2fb8f173a6c02fc4ac035b8a3a7faba32d5ff41e01229fd19aa7ef18a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / s3pe-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL s3pe-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
321bcb573a825c9dbde1da9ef74a596dd3d1ae77cca91034f20cb7afbb7e9746
BLAKE2b-256 checksum
How to use checksums
e91d3e8bca15fc4680279442c37e9e245b6d7fa21fb32494508742faea1acb0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / s3pe-0.2.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL s3pe-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ee81527cc0f49a4707ccf47437ea3d2fc288c6256886b163076ce8ea196ba94f
BLAKE2b-256 checksum
How to use checksums
57aa774a1c9f3060b0fcc694d867da844e5d94b28ce404d3c0caaf0e12ae0ac3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / s3pe-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL s3pe-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6f88c84f0a87651676d8f19998f9ecc8965dd26e518287fa9b67ad7a67eb3a86
BLAKE2b-256 checksum
How to use checksums
b0d307ff204dc2bb895074cd1ac8af361faf16bb33606030874754eb6b16d7db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for s3pe 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for s3pe-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page