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.0.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.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lazyscribe_arrow-0.3.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","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.0.tar.gz
Algorithm Hash digest
SHA256 22f49a8f34b2443c691fdb1b3fef3ba2abf8a186f1e935be5822f3014899b206
MD5 f65c7848f3ed0ca9a68a44b4176e207f
BLAKE2b-256 91eea1adeeb316ebf01b92bba21fe7dc9a284024208587d24712c9f48833639c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lazyscribe_arrow-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a633e1c9f5ef1b741fb0e0579021b1701812a3e8f529d9fb8b99e19b5b73fda
MD5 e51af4d1738d6a17f7e31940300ddcc7
BLAKE2b-256 f69cfe9b4a0a82b43d9a093077d6826fd34416e2cae02195f2dce376178ee44a

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