Skip to main content

datap-rs-client

Python client for a DataPress dataset server, backed by the native Rust client (datapress-client) via PyO3.

Requests are plain Python dicts; responses come back as dicts. Structured queries can optionally be decoded into a pyarrow.Table.

Install

pip install datap-rs-client          # core
pip install datap-rs-client[arrow]   # + pyarrow for query_arrow()

This project standardises on uv: uv pip install datap-rs-client[arrow].

Usage

from datap_rs_client import DataPressClient

client = DataPressClient("http://127.0.0.1:8000")

client.datasets()
# ['accidents']

client.count("accidents", predicates=[{"col": "Severity", "op": "gte", "val": 3}])
# 123456

rows = client.query(
    "accidents",
    columns=["State", "Severity"],
    predicates=[{"col": "Severity", "op": "gte", "val": 3}],
    page_size=1000,
)
rows["page"], len(rows["data"])
# (1, 1000)

# Arrow (requires the [arrow] extra)
table = client.query_arrow("accidents", columns=["State", "Severity"], page_size=100_000)
table.num_rows

Authentication

client = DataPressClient(
    "http://127.0.0.1:8000",
    bearer_token="…",     # servers with auth enabled
    admin_token="…",      # required by reload()
)

SQL

client.sql("SELECT State, COUNT(*) AS n FROM accidents GROUP BY State", max_rows=100)

DataFrames

query_arrow(...) returns a pyarrow.Table (install the [arrow] extra). Arrow is the zero-copy interchange format for every popular dataframe library, so a single query feeds them all:

from datap_rs_client import DataPressClient

client = DataPressClient("http://127.0.0.1:8000")
table = client.query_arrow(
    "accidents",
    columns=["State", "Severity"],
    predicates=[{"col": "Severity", "op": "gte", "val": 3}],
    page_size=1_000_000,
)

Polars

import polars as pl

# Zero-copy from the Arrow table.
df = pl.from_arrow(table)
df.group_by("State").len().sort("len", descending=True)

pandas

import pandas as pd  # noqa: F401  (pyarrow drives the conversion)

# Arrow-backed dtypes (recommended) …
df = table.to_pandas(types_mapper=pd.ArrowDtype)
# … or classic NumPy-backed dtypes:
df = table.to_pandas()
df.groupby("State")["Severity"].mean()

DuckDB

import duckdb

# DuckDB queries the Arrow table in place — no copy, no temp files.
duckdb.sql("SELECT State, COUNT(*) AS n FROM table GROUP BY State ORDER BY n DESC")

PySpark

from pyspark.sql import SparkSession

spark = SparkSession.builder.getOrCreate()
# Spark has no direct Arrow-table constructor; go via pandas (Arrow-accelerated).
sdf = spark.createDataFrame(table.to_pandas())
sdf.groupBy("State").count().orderBy("count", ascending=False).show()

DataFusion

from datafusion import SessionContext

ctx = SessionContext()
df = ctx.from_arrow(table)
df.aggregate([df["State"]], [df["Severity"].mean()])

PyArrow / Arrow ecosystem

# The result is already a pyarrow.Table.
table.column("Severity").combine_chunks()
table.to_batches()           # -> list[pyarrow.RecordBatch]
table.to_pydict()            # -> dict[str, list]

Anything implementing the Arrow C Data Interface (Polars, DuckDB, DataFusion, Vaex, cuDF, …) can consume the table directly. For libraries without an Arrow constructor, table.to_pandas() is the universal fallback.

Relationship to datap-rs

datap-rs ships the server; datap-rs-client is a standalone client. They are independent packages — install whichever you need.

License

MIT

Metadata

Release files for datap-rs-client 0.8.7

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

Source distribution (sdist)

Source distribution for datap-rs-client 0.8.7
File Size Uploaded Provenance Actions
datap_rs_client-0.8.7.tar.gz 75.1 kB Without provenance Details for datap_rs_client-0.8.7.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for datap-rs-client 0.8.7
File Actions
datap_rs_client-0.8.7-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for datap_rs_client-0.8.7-cp39-abi3-win_amd64.whl
datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
datap_rs_client-0.8.7-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for datap_rs_client-0.8.7-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 10.2 MB

Release files / datap_rs_client-0.8.7.tar.gz

Download URL datap_rs_client-0.8.7.tar.gz
Size 75.1 kB
Tags Source
SHA-256 checksum
How to use checksums
812f5f6861533b2ec876b5812ecf0cf19190ef79f7253db839e353c05da8f6e1
BLAKE2b-256 checksum
How to use checksums
21f89b0bad0c84b21442744457b247a39dd37bef8af9d0e645410ad006f69ee1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / datap_rs_client-0.8.7-cp39-abi3-win_amd64.whl

Download URL datap_rs_client-0.8.7-cp39-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f4517230695bed39fd85722e649a2633db9528e6fb3ac0d7d12b3ba4d4f46dca
BLAKE2b-256 checksum
How to use checksums
1ef20a19fb3b893c9ad35671268429c180aeb7c681339fc84b5f636d0e387509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.7 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
99c5d217d99e0e30e60467fe802f23335a02c0edcb01e2bddecc4edd30f68ebe
BLAKE2b-256 checksum
How to use checksums
decf2465aacde0ca24bc011013856014815c64b3a6ead16c0e3d372e2a37c5b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL datap_rs_client-0.8.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
130b49ff4a48595c46b88dbd6fe9f1a9a932b1095ff90c2cfd03027aaca177cc
BLAKE2b-256 checksum
How to use checksums
3a33d7feac56f737380109312a017de0eeb7b72b12c4a523769b092b55585df1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / datap_rs_client-0.8.7-cp39-abi3-macosx_11_0_arm64.whl

Download URL datap_rs_client-0.8.7-cp39-abi3-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
66113db36f5c1d575c73847d5754d805a9ab410e179191e1a9bc3301bcf17a7f
BLAKE2b-256 checksum
How to use checksums
4d01941065193bcc552c9fd570ea7e816cd47d00e0177b33542d85f54bf704be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for datap-rs-client 0.8.7

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.

Release history Release notifications | RSS feed

This release

0.8.7 This release

5 release files No provenance

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