Skip to main content

Python CLI to convert between Lastra and Parquet/CSV/Arrow. Mirror of QTSurfer/lastra-convert (Java).

Project description

Lastra

CI PyPI License

Python CLI to convert between Lastra and Parquet / CSV / Arrow.
Mirror of the Java lastra-convert tool.


Install

pip install lastra-convert

CLI

Six commands, one per direction. Each takes input output plus a small flag set; run any with -h for the full list.

# Parquet ↔ Lastra
parquet2lastra ticks.parquet ticks.lastra
parquet2lastra ticks.parquet ticks.lastra --columns "ts:long:delta_varint,close:double:pongo"
lastra2parquet ticks.lastra  ticks.parquet --compression zstd

# CSV ↔ Lastra (delimiter auto-detected: comma / tab / semicolon / pipe)
csv2lastra     ticks.csv     ticks.lastra
lastra2csv     ticks.lastra  ticks.csv

# Arrow IPC ↔ Lastra
arrow2lastra   ticks.arrow   ticks.lastra
lastra2arrow   ticks.lastra  ticks.arrow

Type / codec auto-detection (override with --columns):

Source type Lastra DataType Default codec
int8…int64 / uint* LONG DELTA_VARINT
float32 / float64 DOUBLE ALP
timestamp / date / bool LONG DELTA_VARINT
binary / string / other BINARY VARLEN_ZSTD

CSV column types are inferred per-column from up to the first 256 cells: integer if every non-empty cell parses as int; double if every non-empty cell parses as float; binary otherwise.

Library API

from lastra_convert import (
    parquet_to_lastra, lastra_to_parquet,
    csv_to_lastra,     lastra_to_csv,
    arrow_to_lastra,   lastra_to_arrow,
)

# Auto-detect every column's type + default codec.
parquet_to_lastra("ticks.parquet", "ticks.lastra")

# Per-column override.
parquet_to_lastra(
    "ticks.parquet", "ticks.lastra",
    columns="ts:long:delta_varint,close:double:pongo",
)

# Decode every series column back into a Parquet (ZSTD by default).
lastra_to_parquet("ticks.lastra", "ticks.parquet", compression="zstd")

Each function returns the row count written.

Reference implementation

This package mirrors QTSurfer/lastra-convert (Java, JVM CLI). Output is byte-equivalent for the same input + codec choices.

License

Copyright 2026 Wualabs LTD. Apache License 2.0 — 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

lastra_convert-1.0.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

lastra_convert-1.0.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file lastra_convert-1.0.0.tar.gz.

File metadata

  • Download URL: lastra_convert-1.0.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lastra_convert-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5fb62ec0a62154b174ffa2dabd86c1a30f5583a80bb2c4b25c6c9e813a2588eb
MD5 fba9624ab58a3fd14d52ddde4f8804f7
BLAKE2b-256 23191397d834f6e5ac3139931bcaf839c90418e833d23cd4c94f0a28e5c1fd23

See more details on using hashes here.

Provenance

The following attestation bundles were made for lastra_convert-1.0.0.tar.gz:

Publisher: release.yml on QTSurfer/lastra-convert-py

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

File details

Details for the file lastra_convert-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lastra_convert-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lastra_convert-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49145411df6e87197cd0948ce41d79e8fa7c876eaa471a82cdcb011b93b29af4
MD5 ac5143eacda61d1f95256750eaed570b
BLAKE2b-256 3dc81dd8a6ee4c106a7aa91a51ed4054b76d177773db36de1b07d5238723c256

See more details on using hashes here.

Provenance

The following attestation bundles were made for lastra_convert-1.0.0-py3-none-any.whl:

Publisher: release.yml on QTSurfer/lastra-convert-py

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