Skip to main content

A Distributed DataFrame library for large scale complex data processing.

Project description

Daft dataframes can load any data such as PDF documents, images, protobufs, csv, parquet and audio files into a table dataframe structure for easy querying

Github Actions tests PyPI latest tag

WebsiteDocsInstallation10-minute tour of DaftCommunity and Support

Daft: the distributed Python dataframe for complex data

Daft is a fast, Pythonic and scalable open-source dataframe library built for Python and Machine Learning workloads.

Daft is currently in its Alpha release phase - please expect bugs and rapid improvements to the project. We welcome user feedback/feature requests in our Discussions forums

Table of Contents

About Daft

The Daft dataframe is a table of data with rows and columns. Columns can contain any Python objects, which allows Daft to support rich complex data types such as images, audio, video and more.

  1. Any Data: Columns can contain any Python objects, which means that the Python libraries you already use for running machine learning or custom data processing will work natively with Daft!

  2. Notebook Computing: Daft is built for the interactive developer experience on a notebook - intelligent caching/query optimizations accelerates your experimentation and data exploration.

  3. Distributed Computing: Rich complex formats such as images can quickly outgrow your local laptop’s computational resources - Daft integrates natively with Ray for running dataframes on large clusters of machines with thousands of CPUs/GPUs.

Getting Started

Installation

Install Daft with pip install getdaft.

Quickstart

Check out our full quickstart tutorial!

In this example, we load images from an AWS S3 bucket and run a simple function to generate thumbnails for each image:

from daft import DataFrame, lit

import io
from PIL import Image

def get_thumbnail(img: Image.Image) -> Image.Image:
    """Simple function to make an image thumbnail"""
    imgcopy = img.copy()
    imgcopy.thumbnail((48, 48))
    return imgcopy

# Load a dataframe from files in an S3 bucket
df = DataFrame.from_files("s3://daft-public-data/laion-sample-images/*")

# Get the AWS S3 url of each image
df = df.select(lit("s3://").str.concat(df["name"]).alias("s3_url"))

# Download images and load as a PIL Image object
df = df.with_column("image", df["s3_url"].url.download().apply(lambda data: Image.open(io.BytesIO(data))))

# Generate thumbnails from images
df = df.with_column("thumbnail", df["image"].apply(get_thumbnail))

df.show(3)

Dataframe code to load a folder of images from AWS S3 and create thumbnails

More Resources

  • 10-minute tour of Daft - learn more about Daft’s full range of capabilities including dataloading from URLs, joins, user-defined functions (UDF), groupby, aggregations and more.

  • User Guide - take a deep-dive into each topic within Daft

  • API Reference - API reference for public classes/functions of Daft

License

Daft has an Apache 2.0 license - please see the LICENSE file.

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

getdaft-0.0.19.tar.gz (146.3 kB view hashes)

Uploaded Source

Built Distributions

getdaft-0.0.19-cp310-cp310-manylinux_2_17_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

getdaft-0.0.19-cp310-cp310-macosx_11_0_x86_64.whl (286.8 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

getdaft-0.0.19-cp310-cp310-macosx_11_0_arm64.whl (273.3 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

getdaft-0.0.19-cp39-cp39-manylinux_2_17_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

getdaft-0.0.19-cp39-cp39-macosx_11_0_x86_64.whl (287.2 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

getdaft-0.0.19-cp39-cp39-macosx_11_0_arm64.whl (273.7 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

getdaft-0.0.19-cp38-cp38-manylinux_2_17_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

getdaft-0.0.19-cp38-cp38-macosx_11_0_arm64.whl (273.6 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

getdaft-0.0.19-cp38-cp38-macosx_10_16_x86_64.whl (287.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.16+ x86-64

getdaft-0.0.19-cp37-cp37m-manylinux_2_17_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

getdaft-0.0.19-cp37-cp37m-macosx_10_16_x86_64.whl (286.7 kB view hashes)

Uploaded CPython 3.7m macOS 10.16+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page