Skip to main content

hdfs-s3-gateway (Python)

Python bindings for the HDFS → S3 read-only gateway. This package wraps the Rust gateway so it can be driven from Python either as a foreground blocking call or as an in-process background server.

Install

pip install hdfs-s3-gateway

Python 3.10 or newer. Wheels are published for Linux (x86_64, aarch64), macOS (arm64), and Windows (x64), including free-threaded 3.14t builds. Other platforms (macOS Intel, musl/Alpine) build from source and need a Rust toolchain.

Usage

from hdfs_s3_gateway import Gateway

# Background server (no subprocess — runs on its own native thread + tokio runtime).
gw = Gateway(namenode_uri="hdfs://localhost:8020", hdfs_root="/data", bucket_name="hdfs")
gw.start()
print(gw.address)   # e.g. "127.0.0.1:8080"
# ... point any S3 client at the endpoint ...
gw.stop()           # graceful shutdown

# Or as a context manager:
with Gateway(config_path="gateway.toml") as gw:
    print(gw.address)
    # ... use the endpoint ...

The HDFS client settings are keywords too, so a config file is optional:

with Gateway(
    namenode_uri="hdfs://localhost:8020",
    hdfs_root="/data",
    bucket_name="hdfs",
    hdfs_user="alice",                      # else HADOOP_USER_NAME / HADOOP_PROXY_USER
    hdfs_config_dir="/etc/hadoop/conf",     # else HADOOP_CONF_DIR / HADOOP_HOME
    hdfs_options={                          # raw Hadoop keys; override XML values
        "dfs.client.use.datanode.hostname": "true",
    },
) as gw:
    print(gw.address)

Each of these also exists as a flag (--hdfs-user, --hdfs-config-dir, repeatable --hdfs-option KEY=VALUE) and as a TOML key.

Caches (metadata, block maps, directory listings and negative lookups) are off by default. Enable them for read-heavy workloads with Gateway(..., cache_enabled=True) (or [cache] enabled = true / HDFS_S3_CACHE_ENABLED=1). The same argument is the incident kill switch: pass cache_enabled=False to bypass the caches without waiting for a release, and read gw.cache_enabled to confirm the effective value. Within a TTL, an object written by another client may not be visible yet.

The gateway performs no authentication by default — it must run behind network-level access control. See the top-level project README for the full security posture. You can optionally enable SigV4 auth by passing auth_secret="..." to Gateway(...) (or the --auth-secret CLI flag / auth_secret TOML key). When set, a valid signature is required (unsigned requests are rejected, wrong secret → 403 SignatureDoesNotMatch), so clients use normal signing (any access-key id + that secret) instead of anonymous / aws_skip_signature. When unset (the default), the gateway accepts both anonymous and signed requests.

Reading data through the gateway

Once the gateway is running, point any S3 client at its endpoint. The examples below assume the gateway was started with hdfs_root="/data" and bucket_name="hdfs", exposing a hive-partitioned table at s3://hdfs/seed_parquet/country=us/year=2021/data.parquet.

By default all clients use anonymous / unsigned access (the gateway has no auth). The endpoint is http://<gw.address> — e.g. http://127.0.0.1:39111. If you started the gateway with auth_secret, drop the anonymous / aws_skip_signature flags and pass any access-key id plus that secret instead.

polars

import polars as pl

ep = f"http://{gw.address}"
so = {
    "aws_skip_signature": "true",
    "aws_endpoint_url": ep,
    "aws_allow_http": "true",
}
# Whole directory tree (hive partition columns are recovered automatically):
df = pl.read_parquet(f"s3://hdfs/seed_parquet/", storage_options=so)
# Or a recursive glob (polars expands it client-side into S3 listings):
df = pl.read_parquet(f"s3://hdfs/seed_parquet/country=*/year=*/*.parquet", storage_options=so)

DuckDB

import duckdb

ep = f"http://{gw.address}"
host = ep.replace("http://", "")
duckdb.sql("INSTALL httpfs; LOAD httpfs;")
duckdb.sql(f"SET s3_endpoint='{host}';")
duckdb.sql("SET s3_use_ssl=false;")
duckdb.sql("SET s3_access_key_id='';")
duckdb.sql("SET s3_secret_access_key='';")
duckdb.sql("SET s3_session_token='';")
duckdb.sql("SET s3_url_style='path';")

# DuckDB's httpfs reads a directory tree via a recursive glob:
df = duckdb.sql("SELECT * FROM read_parquet('s3://hdfs/seed_parquet/**')").df()

pandas (pyarrow engine)

import pandas as pd

ep = f"http://{gw.address}"
so = {
    "anon": "true",
    "endpoint_url": ep,
    "client_kwargs": {"endpoint_url": ep},
}
# pandas delegates s3:// URIs to fsspec/s3fs, not pyarrow's native S3 filesystem.
df = pd.read_parquet("s3://hdfs/seed_parquet/", storage_options=so)

pandas (s3fs / fsspec engine)

import pandas as pd

ep = f"http://{gw.address}"
so = {
    "anon": "true",
    "endpoint_url": ep,
    "client_kwargs": {"endpoint_url": ep},
}
df = pd.read_parquet("s3://hdfs/seed_parquet/", storage_options=so)

pyarrow (native S3FileSystem)

import pyarrow.dataset as ds
import pyarrow.fs as pafs

ep = f"http://{gw.address}"
host = ep.replace("http://", "")
s3 = pafs.S3FileSystem(anonymous=True, endpoint_override=host, scheme="http")
# pyarrow wants a "bucket/key" path, not a full s3:// URI.
dataset = ds.dataset("hdfs/seed_parquet", format="parquet", filesystem=s3, partitioning="hive")
table = dataset.to_table()

Note on path forms. Only polars and DuckDB expand glob patterns (country=*/year=*) client-side into real S3 listings; the other engines pass the glob literally to the gateway, which cannot match it. For a whole partitioned table, use the directory form (s3://hdfs/seed_parquet/).

Metadata

Release files for hdfs-s3-gateway 0.3.4

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

Source distribution (sdist)

Source distribution for hdfs-s3-gateway 0.3.4
File Size Uploaded Provenance Actions
hdfs_s3_gateway-0.3.4.tar.gz 258.8 kB With provenance Details for hdfs_s3_gateway-0.3.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hdfs-s3-gateway 0.3.4
File Actions
hdfs_s3_gateway-0.3.4-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for hdfs_s3_gateway-0.3.4-cp314-cp314t-win_amd64.whl
hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Details for hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ ARM64 Details for hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hdfs_s3_gateway-0.3.4-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for hdfs_s3_gateway-0.3.4-cp314-cp314t-macosx_11_0_arm64.whl
hdfs_s3_gateway-0.3.4-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for hdfs_s3_gateway-0.3.4-cp310-abi3-win_amd64.whl
hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hdfs_s3_gateway-0.3.4-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for hdfs_s3_gateway-0.3.4-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 36.9 MB

Release files / hdfs_s3_gateway-0.3.4.tar.gz

Download URL hdfs_s3_gateway-0.3.4.tar.gz
Size 258.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d10d9e3fd2ccce19d0ede52f40c8d796393ef35d404389fcdb019eaf00612bd8
BLAKE2b-256 checksum
How to use checksums
a60587f772db3ae8b30edd0c2002f983747378f4cd9a0baa2046e8cb70338662
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp314-cp314t-win_amd64.whl

Download URL hdfs_s3_gateway-0.3.4-cp314-cp314t-win_amd64.whl
Size 4.4 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
70ad019c7c9b25d37956c09a562617f46f4ae1f6976e50cf4895646bccc4441b
BLAKE2b-256 checksum
How to use checksums
dcca8a05a244adee56d1f06cbdd77123b480ba60085e089d003f8083725aca91
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.0 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
df013f50f69808ff5b6fee116c69b5d5ef2bc2b7956b27e25ab17e861b23d7af
BLAKE2b-256 checksum
How to use checksums
ea8ad2eda697375e7c86771e88d50c4ed9c33a8481994284fc14816582bf3e23
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hdfs_s3_gateway-0.3.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 5.0 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
959ee94ca96521aa8f8b7a05911d3aa41a18cd62198879846533114f700c8034
BLAKE2b-256 checksum
How to use checksums
8dc420db39fe1995207319a138420d210cf0f677aa185cca479cf760c5c23808
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp314-cp314t-macosx_11_0_arm64.whl

Download URL hdfs_s3_gateway-0.3.4-cp314-cp314t-macosx_11_0_arm64.whl
Size 3.9 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c25422e47f88e8ef35eadf094d69aaa85808ea7d33fcb1bb62855358120445b5
BLAKE2b-256 checksum
How to use checksums
bcb0cb25e119763a1dfbfb34ef02ee663189cebccbf3a329c2439d33591c9393
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp310-abi3-win_amd64.whl

Download URL hdfs_s3_gateway-0.3.4-cp310-abi3-win_amd64.whl
Size 4.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f9d47892438d86d034bca957dede490ff5087cdb78bbb14ee3e4d2da39e9f348
BLAKE2b-256 checksum
How to use checksums
9101dc20107dfc58ae96020b80c65d29f2213909dd7e3f1c3099d8de0687e2a0
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
6e57f11bc0b6e9dcd813956624ef9c4f04199698bf89ae631ad41b5e186854a9
BLAKE2b-256 checksum
How to use checksums
39f72d015744c5ddd84a0544dc2669e2b8ed815e270f7801b404b85409168b43
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hdfs_s3_gateway-0.3.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 5.0 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
051d16f6bed30cfdeb3a874b856f4f5be8a8d02ab582d15c91de157b3ce44471
BLAKE2b-256 checksum
How to use checksums
1ad9d406f2a1b93eea63bb3dc8db20d8ec4b5e5de02964b18dde627615206fc7
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 26, 2026.

Transparency log

Release files / hdfs_s3_gateway-0.3.4-cp310-abi3-macosx_11_0_arm64.whl

Download URL hdfs_s3_gateway-0.3.4-cp310-abi3-macosx_11_0_arm64.whl
Size 3.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
40514fe3b62dd5d63b5ab7040fea0007b49b78c6f2df197c98f5aef40f536e81
BLAKE2b-256 checksum
How to use checksums
80717579e81ef2b66a7bf58abe6c8792d66552ea88d6d0b00e9edaac9dbfc43c
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 26, 2026.

Transparency log

Security for hdfs-s3-gateway 0.3.4

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 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for hdfs_s3_gateway-0.3.4.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 26, 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