Load tabular data from any storage backend (GCS, S3, Azure, local) and any common format into a pandas DataFrame with a single call.
Project description
loadfile
Load tabular data from any storage backend (Google Cloud Storage, AWS S3, Azure, local disk, …) and any common format into a pandas DataFrame with a single call.
from loadfile import load
df = load("gs://my-bucket/data.parquet")
df = load("data/local.csv")
df = load("s3://bucket/export.json", storage_options={"anon": True})
The storage backend is chosen automatically from the URL prefix (powered by
fsspec). The file format is detected
from the extension (or forced with format=).
The function is also exported as
load_data(an alias ofload) for compatibility with the original helper.
Install
pip install loadfile # core: pandas + fsspec + pyarrow (local files)
pip install "loadfile[gcs]" # Google Cloud Storage (gcsfs)
pip install "loadfile[s3]" # AWS S3 (s3fs)
pip install "loadfile[azure]" # Azure (adlfs)
pip install "loadfile[excel]" # .xlsx support (openpyxl)
pip install "loadfile[calamine]"# fast Rust Excel engine for fast=True
pip install "loadfile[all]" # everything
Supported formats
| Format | Extensions |
|---|---|
| Parquet | .parquet |
| CSV | .csv (and .csv.gz, .csv.bz2…) |
| JSON / JSON Lines | .json, .jsonl, .ndjson |
| Excel | .xlsx, .xls |
| Feather | .feather |
| ZIP | .zip (wrapping any of the above) |
Usage
Faster reads with fast=True
df = load("big.csv") # default: plain pandas (NumPy dtypes)
df = load("big.csv", fast=True) # Arrow-accelerated: much faster, less memory
fast=True delegates to pyarrow's multi-threaded C++ parser for CSV and
JSON-lines and returns Arrow-backed columns (dtype_backend="pyarrow") for
every format — typically several times faster with a fraction of the memory, and
no slow object dtype. The default stays plain pandas for backwards
compatibility. Any explicit reader kwargs you pass override the fast defaults.
Installing loadfile[calamine] (or [all]) additionally enables the fast Rust
calamine engine for Excel under fast=True.
Format override and reader options
Any extra keyword arguments are forwarded to the underlying pandas reader:
load("export.tsv", format="csv", sep="\t")
load("book.xlsx", sheet_name="Sheet2")
load("big.csv", usecols=["id", "value"])
Credentials
Pass backend options via storage_options (forwarded to fsspec):
load("gs://bucket/data.parquet", storage_options={"token": "/path/key.json"})
load("s3://bucket/data.csv", storage_options={"key": "...", "secret": "..."})
ZIP archives
A .zip may contain any mix of supported formats. Each member is loaded with the
reader matching its own extension.
# Single data file in the zip -> a DataFrame
df = load("archive.zip")
# Multiple data files -> a dict {member_name: DataFrame}
frames = load("archive.zip") # {"a.csv": ..., "b.parquet": ...}
# Pick one member -> a DataFrame
df = load("archive.zip", filename="a.csv")
# Pick a subset -> a dict of just those members
frames = load("archive.zip", filename=["a.csv", "b.parquet"])
Non-data members (e.g. readme.txt) and nested zips are ignored. A zip with no
supported files raises EmptyArchiveError; a missing requested member raises
MemberNotFoundError.
Development
pip install -e ".[dev,all]"
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loadfile-0.1.1.tar.gz.
File metadata
- Download URL: loadfile-0.1.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be271d38fd236bbf596db5fd4d2b88de2744b461b25c73786ceb09840b63bca5
|
|
| MD5 |
bcb8336a18da57455d3d93081b5e74db
|
|
| BLAKE2b-256 |
cb3b1b9491a2ecaca8b8d28675700445cfd810283da6f3edb6d4ecb9e99383df
|
Provenance
The following attestation bundles were made for loadfile-0.1.1.tar.gz:
Publisher:
publish.yml on VedantAndhale/loadfile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loadfile-0.1.1.tar.gz -
Subject digest:
be271d38fd236bbf596db5fd4d2b88de2744b461b25c73786ceb09840b63bca5 - Sigstore transparency entry: 1733144037
- Sigstore integration time:
-
Permalink:
VedantAndhale/loadfile@904e2b043434faf07a835b10ebc871d9dde94c63 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/VedantAndhale
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@904e2b043434faf07a835b10ebc871d9dde94c63 -
Trigger Event:
push
-
Statement type:
File details
Details for the file loadfile-0.1.1-py3-none-any.whl.
File metadata
- Download URL: loadfile-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcf130b212d3934f2dec07929de5f00ddf51f8f99342c9a480204a15956d8c15
|
|
| MD5 |
4e973f3ba571b30004e0f42d3e740275
|
|
| BLAKE2b-256 |
8a4446ad98a15c3fc08e480bed25b3dc7c7cf5a5cd9ee122737ac87b520aec99
|
Provenance
The following attestation bundles were made for loadfile-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on VedantAndhale/loadfile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loadfile-0.1.1-py3-none-any.whl -
Subject digest:
fcf130b212d3934f2dec07929de5f00ddf51f8f99342c9a480204a15956d8c15 - Sigstore transparency entry: 1733144120
- Sigstore integration time:
-
Permalink:
VedantAndhale/loadfile@904e2b043434faf07a835b10ebc871d9dde94c63 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/VedantAndhale
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@904e2b043434faf07a835b10ebc871d9dde94c63 -
Trigger Event:
push
-
Statement type: