Metadata-Version: 2.4
Name: lakeprism
Version: 0.1.0a2
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Requires-Dist: ipython>=8 ; extra == 'notebook'
Requires-Dist: pandas>=1.5 ; extra == 'notebook'
Requires-Dist: pyarrow>=14 ; extra == 'notebook'
Requires-Dist: tqdm>=4.64 ; extra == 'notebook'
Requires-Dist: pytest>=7 ; extra == 'test'
Requires-Dist: faster-whisper==1.2.1 ; extra == 'speech'
Requires-Dist: pyarrow>=14 ; extra == 'speech'
Provides-Extra: notebook
Provides-Extra: test
Provides-Extra: speech
License-File: LICENSE
License-File: FFMPEG-LICENSE.txt
Summary: Notebook-friendly bindings for governed local LakePrism queries
Keywords: arrow,datafusion,delta-lake,lakehouse,notebook
Author: LakePrism contributors
License-Expression: Apache-2.0 AND LGPL-2.1-or-later
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/danielbeach/lakeprism
Project-URL: Documentation, https://github.com/danielbeach/lakeprism#start-with-python
Project-URL: Source, https://github.com/danielbeach/lakeprism

# LakePrism Python

`lakeprism` is the Maturin/PyO3 notebook binding for the local LakePrism
session. This package version is `0.1.0a2`; its native wheels add bundled media
decoding and a persistent recording-to-SQL workflow. See the repository's
release status before installing from PyPI:

```bash
python -m pip install lakeprism==0.1.0a2
```

Or build a matching native wheel from this repository:

```bash
bash scripts/build-python-wheels.sh --platform native --out dist/python
pip install dist/python/lakeprism-*.whl
```

For notebook display helpers install `lakeprism[notebook]`. They import
PyArrow, pandas, IPython, and tqdm only when called.

Published `0.1.0a1` wheels omit native media decoding. The next candidate
bundles native FFmpeg shared libraries, LGPL notices, build instructions and
complete corresponding source, without requiring system FFmpeg at runtime.
Models remain external. See the repository's
`examples/local_transcription/README.md` for an actual offline CPU model workflow.

The builder uses `uv tool run` to manage Maturin. It intentionally rejects
cross-target builds: PyO3 and FFmpeg must link on the target-native
host. LakePrism uses the PyO3 `abi3-py39` policy, producing one `cp39-abi3`
wheel for CPython 3.9+. See the repository README for the supported
manylinux and musllinux (x86_64/aarch64), macOS (x86_64/aarch64), and Windows
x86_64 release matrix. The workflow tests ordinary CPython 3.9, 3.12, and 3.14.
PyPy and free-threaded Python are not included. Alpine core bindings are tested
without PyArrow; PyArrow-dependent notebook extras on Alpine are not validated.

## Capability parity and limits

`MediaSession` exposes local media registration, SQL, lazy Arrow C-stream/IPC
export, catalog metadata, `explain`, governed query lifecycle, local Parquet,
document/media table functions, transcript/embedding indexes, and derived
Parquet snapshots. `MediaSession.with_transcription_subprocess` plus
`transcribe` provides local audio/video transcription through a validated,
bounded Whisper-compatible adapter. `LocalCatalog` exposes its durable DDL and
registration path. `FlightServer`/`FlightClient` are available with the
`flight` feature.

With `delta-rs`, `register_delta` reads credential-free local `file://` Delta
tables and `write_delta_ipc` writes a PyArrow IPC stream with explicit write
and schema modes. Remote Delta writes are intentionally Rust-only because they
require scoped object-store credentials and an explicit concurrency guard.

With `unity`, `UnityCatalog(base_url, token_supplier)` accepts an
application-owned fresh-token callback and resolves/registers tables for a
`UnityQueryContext`. The callback receives only query identity and returns a
token for that one REST request. LakePrism stores the callback—not its returned
token—and redacts native credential types. Unity temporary table credentials are consumed internally by
`UnityCatalog.resolve_and_register_managed_delta`; they are never exposed to
Python. `OAuthTokenSupplier` and `FlightAuthSupplier` document the callback
shapes. `FlightClient(endpoint, auth_supplier=...)` invokes its callback for
each execution and sends the result only as that request's Authorization
header. Local Python round trips are tested; the client accepts loopback HTTP
or HTTPS endpoint shapes but exposes no remote TLS deployment configuration.
Remote Flight deployment and authentication policy remain Rust
application-boundary work.

Iceberg's Arrow-59 upstream provider currently accepts an already constructed
Rust `iceberg::Table`; its REST construction and credentialed storage client
are not safely constructible from this ABI-stable Python extension. Use the
Rust Iceberg/REST adapter at an application boundary, then expose the
credential-free `MediaSession` result to Python. Likewise, custom Rust
`MediaResolver`, OCR/image providers, distributed worker implementations, S3
staging, and Flight server-side authentication remain application-boundary
traits rather than Python object wrappers.

### Optional local Whisper adapter

Python wheels include `WhisperSubprocessConfig` and
`MediaSession.with_transcription_subprocess`, but deliberately do **not**
include a model runtime or model artifact. Candidate wheels include a Python
adapter for the optional `speech` extra and the `RecordingDataset` workflow;
`prepare_speech_model(path)` explicitly downloads the pinned English model,
then `SpeechModel(path)` configures offline CPU inference. `RecordingDataset`
ingests files/folders, atomically persists lineage-bearing Parquet snapshots,
reuses unchanged recordings, and reopens them for SQL/search without a model.
Inputs are bounded to 1 GiB and two hours, with 30-second decode windows.
See the root README's recording workflow for installation and current limits.

For application-owned adapters, the config
requires an absolute executable, explicit argument vector (not a shell
command), validated local model artifact, and private staging directory.
`session.transcribe` accepts only a local `file://` audio/video URI and an
explicit source version; it returns and registers lineage-bearing
`TranscriptSegment` rows. See the root README's “Transcribe local audio or
video” section for the protocol and resource/cancellation limits.

No LakePrism Python object accepts, serializes, logs, or persists OAuth client
secrets, bearer tokens, or temporary cloud object-store credentials. See the
repository's `docs/CLOUD_ACCEPTANCE.md` for the opt-in live contract.

