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

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.0
File Size Uploaded Provenance Actions
pydala2-0.29.0.tar.gz 469.4 kB Without provenance Details for pydala2-0.29.0.tar.gz

Built distribution (wheel)

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

Total release size: 549.7 kB

Release files / pydala2-0.29.0.tar.gz

Download URL pydala2-0.29.0.tar.gz
Size 469.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4fa3d4ef5cf0280d148fc1ff6109512e39e88eaa3a63c37606596c22673fef21
BLAKE2b-256 checksum
How to use checksums
6e696f32c32c570c58a95e247e3294b8b7f477a75522d7f55e9154d14e1a8892
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.0-py3-none-any.whl

Download URL pydala2-0.29.0-py3-none-any.whl
Size 80.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4e95ff42838e67d91af3d0f8eb19522a0e6221e98733c73663b6aa12ff2c58f
BLAKE2b-256 checksum
How to use checksums
276e568df3a3ce32f5bf4ce53bb66ea0da8771f941c24ee9e95e56e0991eb20f
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.0

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