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.3.1.tar.gz (5.1 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.3.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lazyscribe_arrow-0.3.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.3.1.tar.gz
Algorithm Hash digest
SHA256 cb12709eec50e2d5585aa8dc948d0322c127273fb1082a80d8d8b692865ebec8
MD5 a68b8e91203be83acb06d0db4d2579a9
BLAKE2b-256 215d566b1cdaee9faddd67e0551662bbf96d7b2796dfa0ff6b08cdbe4ae0b614

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lazyscribe_arrow-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 980048c617239cce99384bda23f8258e36d772141b69f27757bd3c575caff5a8
MD5 2159854de4ab55a660bfa5740f175889
BLAKE2b-256 6f3fc4a8c3a9195975d561e9f66be790bb05fe7b4630a0fb071b732dd2b0f027

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