Helpers for the Arrow-backed Python stack: polars, pyarrow, duckdb.
Project description
arrow-dx
Helpers for the Arrow-backed Python stack: polars, pyarrow, duckdb. Small, theme-bound — each helper smooths a rough edge in day-to-day dataframe work, nothing more.
Install
pip install arrow-dx
# optional extras
pip install "arrow-dx[pandas]"
pip install "arrow-dx[duckdb]"
pip install "arrow-dx[all]"
Requires Python 3.13+. Only polars is a hard runtime dependency.
Helpers
unify_schema(root, *, output_dir=None, type_overrides=None, on_conflict="supertype", column_order=None)
Rewrite every *.parquet under root to share one schema. Use case: a hive-partitioned dataset where files written at different times have drifted — a column added later, a type widened, a column missing in older files. After unification every reader (polars, pyarrow, duckdb, pandas) handles the dataset with its bare-minimum call.
from arrow_dx import unify_schema
# rewrite files in place
unify_schema("data/")
# or copy into a new tree, preserving the partition layout
unify_schema("data/", output_dir="data-unified/")
on_conflict∈{"supertype" (default), "string", "error"}— how to resolve a column whose type differs across files.type_overrides={"col": pl.String}— pin specific columns; wins over conflict resolution.column_order=[...]— pin a column-order prefix; remaining columns follow in first-seen order.- Hive
key=valuepartition columns are auto-detected and excluded from the file schema.
sample_print(df, n=10, seed=None)
Print n contiguous rows from a random offset in a sorted polars df, with pl.Config(tbl_rows=n) so polars' default row-clipping doesn't truncate the window. Caller is responsible for sorting first — the slice is contiguous, so it's only meaningful in some intentional order.
from arrow_dx import sample_print
sample_print(sorted_df, n=10, seed=42)
Scope
In: ergonomics for the Arrow-backed dataframe stack — polars, pyarrow, duckdb (+ pandas as an extra). Out: anything that doesn't fit that theme. The discipline keeps this from rotting into a junk drawer.
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 arrow_dx-0.1.0.tar.gz.
File metadata
- Download URL: arrow_dx-0.1.0.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8ad24b99e4749de23bb0c83a9ede9cf325f783712eb7ce76b8cca439e0952fc
|
|
| MD5 |
cb99289e4715523d7958fb0b33bc34c3
|
|
| BLAKE2b-256 |
a25aebb56808c611e775c23a43dd24f4e1047582c6d8feae3059dc405f4dddcf
|
Provenance
The following attestation bundles were made for arrow_dx-0.1.0.tar.gz:
Publisher:
publish.yml on twedl/arrow-dx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arrow_dx-0.1.0.tar.gz -
Subject digest:
f8ad24b99e4749de23bb0c83a9ede9cf325f783712eb7ce76b8cca439e0952fc - Sigstore transparency entry: 1474106021
- Sigstore integration time:
-
Permalink:
twedl/arrow-dx@43caf445f890e37d3d629f042211db5b98fa82db -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/twedl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43caf445f890e37d3d629f042211db5b98fa82db -
Trigger Event:
push
-
Statement type:
File details
Details for the file arrow_dx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arrow_dx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 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 |
a10e73c1b4fbd676e18a8cc02740ba72e877a4bcd4802371f5ab1d9b03749de8
|
|
| MD5 |
f656f31ca4984d6b89f2600dcde8337e
|
|
| BLAKE2b-256 |
07a687dc94d700ff1db9adf97cdc60e2b9c8d45c7876d796a24c3f8bcf3b6b69
|
Provenance
The following attestation bundles were made for arrow_dx-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on twedl/arrow-dx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arrow_dx-0.1.0-py3-none-any.whl -
Subject digest:
a10e73c1b4fbd676e18a8cc02740ba72e877a4bcd4802371f5ab1d9b03749de8 - Sigstore transparency entry: 1474106109
- Sigstore integration time:
-
Permalink:
twedl/arrow-dx@43caf445f890e37d3d629f042211db5b98fa82db -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/twedl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43caf445f890e37d3d629f042211db5b98fa82db -
Trigger Event:
push
-
Statement type: