Skip to main content

PyDala2

PyDala2

PyPI version License: MIT Documentation

Overview 📖

PyDala2 is a high-performance Python library for managing Parquet datasets with advanced metadata capabilities. Built on Apache Arrow, it provides efficient management of Parquet datasets with features including:

  • Smart dataset management with metadata optimization
  • Multi-format support (Parquet, CSV, JSON)
  • Multi-backend integration (Polars, PyArrow, DuckDB, Pandas)
  • Advanced querying with predicate pushdown
  • Schema management with automatic validation
  • Performance optimization with caching and partitioning
  • Catalog system for centralized dataset management

✨ Key Features

  • 🚀 High Performance: Built on Apache Arrow with optimized memory usage and processing speed
  • 📊 Smart Dataset Management: Efficient Parquet handling with metadata optimization and caching
  • 🔄 Multi-backend Support: Seamlessly switch between Polars, PyArrow, DuckDB, and Pandas
  • 🔍 Advanced Querying: SQL-like filtering with predicate pushdown for maximum efficiency
  • 📋 Schema Management: Automatic validation, evolution, and tracking of data schemas
  • ⚡ Performance Optimization: Built-in caching, compression, and intelligent partitioning
  • 🛡️ Type Safety: Comprehensive validation and error handling throughout the library
  • 🏗️ Catalog System: Centralized dataset management across namespaces

🚀 Quick Start

Installation

pip install pydala2

For remote storage, install pydala2[s3] for S3-compatible storage or pydala2[sftp] for SSH/SFTP.

Basic Usage

from pathlib import Path

import pandas as pd
from pydala import ParquetDataset

dataset = ParquetDataset(str(Path("data/my_dataset").resolve()), partitioning="hive")

# Write data
data = pd.DataFrame({
    'id': range(100),
    'category': ['A', 'B', 'C'] * 33 + ['A'],
    'value': [i * 2 for i in range(100)]
})
dataset.write_to_dataset(data, partition_by=["category"])
dataset.load()

result = dataset.filter("category IN ('A', 'B') AND value > 50")
df_polars = result.to_polars(lazy=False)
df_pandas = result.to_pandas()
duckdb_rel = result.to_duckdb()

Using Different Backends

import polars as pl

# Polars LazyFrame
lazy_df = dataset.table.pl  # or dataset.t.pl
result = (
    lazy_df
    .filter(pl.col("value") > 100)
    .group_by("category")
    .agg(pl.mean("value"))
    .collect()
)

# DuckDB (for SQL queries)
result = dataset.ddb_con.sql("""
    SELECT category, AVG(value) as avg_value
    FROM my_dataset
    GROUP BY category
""").to_arrow_table()

# PyArrow Table (for columnar operations)
table = dataset.table.arrow  # or dataset.t.arrow

# Pandas DataFrame (for compatibility)
df_pandas = dataset.table.df  # or dataset.t.df

# Direct export methods
df_polars = dataset.table.to_polars(lazy=False)
table = dataset.table.to_arrow()
df_pandas = dataset.table.to_pandas()

Catalog Management

Save this as catalog.yaml alongside the data/ directory from the example above:

filesystem:
  local:
    protocol: file
    bucket: .
tables:
  default:
    my_dataset:
      filesystem: local
      path: data/my_dataset
      format: parquet
from pydala import Catalog

catalog = Catalog("catalog.yaml", namespace="default")
result = catalog.sql("SELECT COUNT(*) FROM my_dataset").fetchone()

📚 Documentation

Comprehensive documentation is available at pydala2.readthedocs.io:

Getting Started

User Guide

API Reference

Advanced Topics

🤝 Contributing

Report bugs and discuss changes in GitHub Issues.

📝 License

MIT License

Metadata

Release files for pydala2 0.29.1

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

Source distribution (sdist)

Source distribution for pydala2 0.29.1
File Size Uploaded Provenance Actions
pydala2-0.29.1.tar.gz 473.5 kB Without provenance Details for pydala2-0.29.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydala2 0.29.1
File Interpreter ABI Platform Actions
pydala2-0.29.1-py3-none-any.whl Python 3 none any Details for pydala2-0.29.1-py3-none-any.whl

Total release size: 555.3 kB

Release files / pydala2-0.29.1.tar.gz

Download URL pydala2-0.29.1.tar.gz
Size 473.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ce1e9d9526ff5bf7fd66488e1d137dfde0de3e21a62278b4c92e53b43706e622
BLAKE2b-256 checksum
How to use checksums
f1f80ff771a1393406c794b06eab8e00a2915432a188b4b47a1af3a1cf21e9a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pydala2-0.29.1-py3-none-any.whl

Download URL pydala2-0.29.1-py3-none-any.whl
Size 81.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60b76bfdc08f06f9037994ed5ae4957eb0e369e50154a9fb19ddbea09d4852ad
BLAKE2b-256 checksum
How to use checksums
4cad09b858d114f005fef90721ae133a61a569dcf00d5dd78ac6c84a644a72d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pydala2 0.29.1

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.29.1 This release

2 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