Skip to main content

Add your description here

Reason this release was yanked:

wrong tag, was supposed to be 0.0.1

Project description

Data Pebbles SDK

Python SDK for the Data Pebbles platform — manage data across bronze, silver, and gold layers with built-in lineage tracking.

Installation

pip install data-pebbles

Requires Python 3.13+. Dependencies: polars, httpx, mlflow.

Quick Start

from data_pebbles import DataPebbles

dp = DataPebbles("http://localhost:8000", token="your-token")

# Bronze: upload raw files (.csv, .parquet, .json, .xlsx)
dp.bronze.create_source("raw_sales")
dp.bronze.upload(1, file_path="sales.csv")
raw = dp.bronze.download(1)

# Silver: cleaned LazyFrames with lineage
dp.silver.create_source("clean_sales")
dp.silver.upload(2, lf, from_source_id=1)
lf = dp.silver.download(2)

# Gold: aggregated LazyFrames with multi-source lineage
dp.gold.create_source("sales_summary")
dp.gold.upload(3, lf, from_source_ids=[2])

The client can be used as a context manager:

with DataPebbles("http://localhost:8000") as dp:
    sources = dp.bronze.list_sources()

Layers

Bronze

Stores raw, unprocessed files. Only .csv, .parquet, .json, and .xlsx files are accepted.

Method Description
create_source(name) Create a new source
list_sources() List all sources
get_source(source_id) Get source metadata
update_source(source_id, name) Rename a source
delete_source(source_id) Delete a source
list_versions(source_id) List all versions
upload(source_id, *, file_path=None, data=None, file_name="upload") Upload a file by path or raw bytes
download(source_id, *, version=None) Download raw bytes (defaults to latest version)
activate_version(source_id, version) Set a version as active
delete_version(source_id, version) Delete a version

Silver

Stores cleaned, structured data as Parquet. Works with Polars DataFrames/LazyFrames and tracks lineage back to bronze.

Method Description
create_source(name) Create a new source
list_sources() List all sources
get_source(source_id) Get source metadata
update_source(source_id, name) Rename a source
delete_source(source_id) Delete a source
list_versions(source_id) List all versions with lineage
upload(source_id, data, *, from_source_id) Upload a DataFrame/LazyFrame with bronze lineage
download(source_id, *, version=None) Download as a Polars LazyFrame

Gold

Stores aggregated, business-ready data as Parquet. Supports multi-source lineage from silver.

Method Description
create_source(name) Create a new source
list_sources() List all sources
get_source(source_id) Get source metadata
update_source(source_id, name) Rename a source
delete_source(source_id) Delete a source
list_versions(source_id) List all versions with lineage
upload(source_id, data, *, from_source_ids) Upload a DataFrame/LazyFrame with silver lineage
download(source_id, *, version=None) Download as a Polars LazyFrame

Transform Decorators

Automate downloading, transforming, and uploading data between layers with lineage tracking.

silver_transform

Transforms bronze → silver. The decorator auto-parses bronze data into a LazyFrame based on the original file extension. The decorated function receives a LazyFrame and returns a LazyFrame.

@dp.silver_transform(target_id=2, from_bronze_id=1)
def clean(lf: pl.LazyFrame) -> pl.LazyFrame:
    return lf.filter(pl.col("amount") > 0)

clean()            # uses latest bronze version
clean(version=5)   # uses a specific bronze version

For CSV files with a non-standard delimiter, use csv_separator:

@dp.silver_transform(target_id=2, from_bronze_id=1, csv_separator=";")
def clean_eu(lf: pl.LazyFrame) -> pl.LazyFrame:
    return lf.filter(pl.col("amount") > 0)

gold_transform

Transforms silver → gold. The decorated function receives a dict mapping silver source IDs to their LazyFrames and returns a LazyFrame.

@dp.gold_transform(target_id=3, from_silver_ids=[1, 2])
def aggregate(sources: dict[int, pl.LazyFrame]) -> pl.LazyFrame:
    return (
        pl.concat(sources.values())
        .group_by("category")
        .agg(pl.sum("amount"))
    )

aggregate()

License

See LICENSE.

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

data_pebbles-0.1.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

data_pebbles-0.1.0-py3-none-any.whl (60.1 kB view details)

Uploaded Python 3

File details

Details for the file data_pebbles-0.1.0.tar.gz.

File metadata

  • Download URL: data_pebbles-0.1.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for data_pebbles-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5eae61d0f2904e2bfb1dd9a2803e7ff568356855082555de669fc41dd6a8339f
MD5 dd37daf4819a10d721536f94ad05c60a
BLAKE2b-256 9c363d9683aa9b6a65806bca3bf35d34ce23fa18c1de7b785ea55728090ab78a

See more details on using hashes here.

Provenance

The following attestation bundles were made for data_pebbles-0.1.0.tar.gz:

Publisher: publish.yml on LeonDavidZipp/data-pebbles-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file data_pebbles-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: data_pebbles-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 60.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for data_pebbles-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aab0108c78c62344c4dd95f865cd10dfc323e049f90180a1c2d0e1eaac6e650a
MD5 2f5301725b629203805cf4a21aa6f2c8
BLAKE2b-256 e8d84a0404e4fe30c8d1c3b03c205aa1d6345b5a613e875be98c44ac51e3a30f

See more details on using hashes here.

Provenance

The following attestation bundles were made for data_pebbles-0.1.0-py3-none-any.whl:

Publisher: publish.yml on LeonDavidZipp/data-pebbles-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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