Skip to main content

Arrow-based artifact handlers for Lazyscribe

Project description

License PyPI PyPI - Python Version codecov

Arrow-based artifact handling for lazyscribe

lazyscribe-arrow is a lightweight package that adds the following artifact handlers for lazyscribe:

  • csv, and
  • parquet.

Any data structure that implements the Arrow PyCapsule Interface will be compatible with the handlers in this library. Popular compatible open source data structures include

  • pandas.DataFrame
  • polars.DataFrame
  • polars.LazyFrame

This library also adds interchange methods to construct a pyarrow.Table from lazyscribe.Project and lazyscribe.Repository objects.

Installation

Python 3.10 and above is required. use pip to install:

$ python -m pip install lazyscribe-arrow

Usage

Artifact handlers

To use this library, simply log an artifact to a lazyscribe experiment or repository with

  • handler="csv" for a CSV output
import pyarrow as pa
from lazyscribe import Project

project = Project("project.json", mode="w")
with project.log("My experiment") as exp:
    data = pa.Table.from_arrays([[0, 1, 2]], names=["a"])
    exp.log_artifact(name="data", value=data, handler="csv")

project.save()

Interchange

To convert your lazyscribe.Project to a pyarrow.Table object, call lazyscribe_arrow.interchange.to_table:

import pyarrow as pa
from lazyscribe import Project
from lazyscribe_arrow.interchange import to_table

project = Project("project.json", mode="w")
with project.log("My experiment") as exp:
    data = pa.Table.from_arrays([[0, 1, 2]], names=["a"])
    exp.log_artifact(name="data", value=data, handler="csv")

table = to_table(project)

The same function works for lazyscribe.Repository objects.

import pyarrow as pa
from lazyscribe import Repository
from lazyscribe_arrow.interchange import to_table

repo = Repository("repository.json", mode="w")

data = pa.Table.from_arrays([[0, 1, 2]], names=["a"])
repo.log_artifact(name="data", value=data, handler="csv")

table = to_table(repo)

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

lazyscribe_arrow-0.4.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

lazyscribe_arrow-0.4.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file lazyscribe_arrow-0.4.0.tar.gz.

File metadata

  • Download URL: lazyscribe_arrow-0.4.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lazyscribe_arrow-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9c71c745f62543bc3e431c064147294d677b2d69126fabb72d277945f1cfad4a
MD5 e0a7adf1664a274e44883925e3b13199
BLAKE2b-256 5015acc86cd8a486a5e15d0f320978c16bf06c7649baf4fe57ff3b86b9d16012

See more details on using hashes here.

File details

Details for the file lazyscribe_arrow-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: lazyscribe_arrow-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lazyscribe_arrow-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 327d0d6037b20f23d295431ee4973401677b1e673b42f3e2a7860e790f289d08
MD5 2b1c7bf729a1f656c23cf8f3100d0338
BLAKE2b-256 55008f9a08869dfc5de9555f37cf5fbd977de5c81b07daf04e9ddfaa335ba2d1

See more details on using hashes here.

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