Skip to main content

Lift special-purpose data into common tabular formats for analytics 💪

Project description

💪 Elbow

Build codecov Code style: black MIT License

Elbow is a lightweight and scalable library for getting diverse data out of specialized formats and into common tabular data formats for downstream analytics.

Example

Extract image metadata and pixel values from all JPEG image files under the current directory and save as a Parquet dataset.

import numpy as np
import pandas as pd
from PIL import Image

from elbow.builders import build_parquet

def extract_image(path: str):
    img = Image.open(path)
    width, height = img.size
    pixel_values = np.asarray(img)
    return {
        "path": path,
        "width": width,
        "height": height,
        "pixel_values": pixel_values,
    }

build_parquet(
    source="**/*.jpg",
    extract=extract_image,
    output="images.pqds/",
    workers=8,
)

df = pd.read_parquet("images.pqds")

For a complete example, see here.

Installation

pip install elbow

The current development version can be installed with

pip install git+https://github.com/cmi-dair/elbow.git

Related projects

There are many other high quality projects for extracting, loading, and transforming data. Some alternative projects focused on somewhat different use cases are:

Contributing

We welcome contributions of any kind! If you'd like to contribute, please feel free to start a conversation in our issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elbow-0.1.1.tar.gz (38.7 kB view hashes)

Uploaded Source

Built Distribution

elbow-0.1.1-py3-none-any.whl (29.6 kB view hashes)

Uploaded Python 3

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