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 ...

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.2

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.2
File Size Uploaded Provenance Actions
hdfs_s3_gateway-0.3.2.tar.gz 256.7 kB Without provenance Details for hdfs_s3_gateway-0.3.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hdfs-s3-gateway 0.3.2
File Actions
hdfs_s3_gateway-0.3.2-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for hdfs_s3_gateway-0.3.2-cp314-cp314t-win_amd64.whl
hdfs_s3_gateway-0.3.2-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.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hdfs_s3_gateway-0.3.2-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.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hdfs_s3_gateway-0.3.2-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.2-cp314-cp314t-macosx_11_0_arm64.whl
hdfs_s3_gateway-0.3.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for hdfs_s3_gateway-0.3.2-cp310-abi3-win_amd64.whl
hdfs_s3_gateway-0.3.2-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.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hdfs_s3_gateway-0.3.2-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.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hdfs_s3_gateway-0.3.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for hdfs_s3_gateway-0.3.2-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 36.8 MB

Release files / hdfs_s3_gateway-0.3.2.tar.gz

Download URL hdfs_s3_gateway-0.3.2.tar.gz
Size 256.7 kB
Tags Source
SHA-256 checksum
How to use checksums
88a8a3028444d7ebb23323e971fa886151ab1a77291fd00c0634b6794ecdf87d
BLAKE2b-256 checksum
How to use checksums
0bd53841bb02f0bf34e50fb3b1562712a328c3db585f57c55b47ebdb6c41af88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-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
876a1efec4d1235f273116e3d3428029526409d4fea207a8e7afdff036f4e4e4
BLAKE2b-256 checksum
How to use checksums
284654cce3bd364d82701c24fb3e374cd79b63c5243135c8591fbc8956ec6e77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-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
a59b152ce057af21a69995426c86d30439e480701fb69bcc247c70ec816f70b7
BLAKE2b-256 checksum
How to use checksums
9d835b030f78db28d3fb96eb5d604dca18d286e3b318e1b73715e809d7ec2743
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-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
1456244f76b4dd40f04e28986841b0b92801430c98994bf4a4827a9b1314507d
BLAKE2b-256 checksum
How to use checksums
d104e2db7131b266ef8f0177f4631dc5ecacf141a774cd767059d54fd0168ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-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
ad94ee4cb7dddfb4745a168f689199ea4e5ebd08300ad67af19bb54e3cb5e39c
BLAKE2b-256 checksum
How to use checksums
acf6c54080fd7d7c15597e8ef9a9324a57c8c3848043dad1f3eb5e7311a723cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-cp310-abi3-win_amd64.whl
Size 4.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5f7278db71ac6943b5519747e77c49ff26caa0b61eb03f78afd63eb6e21e34ec
BLAKE2b-256 checksum
How to use checksums
12f4e9869e075f2daa4e31e90672c842404f70374a463f3beece629d115db27a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-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
7c712a0a4530f08a649070096ee78dfd762ec547c3875cb58777d968fe15421d
BLAKE2b-256 checksum
How to use checksums
7aaccb533cf4a9539326269ee1874e7c9d67a631d76f88a62d4a3f76b54cebf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-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
dc213240a36c38a05771c43dcc87debe57889754c6e696a66ee7afb4ce6e5bc9
BLAKE2b-256 checksum
How to use checksums
39e423ee79dec824337535e5c47aa39c26a77c63ed187fca2e8602a8d1168ddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL hdfs_s3_gateway-0.3.2-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
03cad19fe23887a0f2b28ddaa0def5fdc64e5056d05903221bee512b114d6c27
BLAKE2b-256 checksum
How to use checksums
d81e64ca8f913f2ddfb0f2eaab66b6f9001957fe91fd7d96f2d964e1b0cd01c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hdfs-s3-gateway 0.3.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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