Registry / azure / mltable

mltable

JSON →
library1.6.3pypypi✓ verified 85d ago

mltable provides Python APIs for creating, loading, and managing the MLTable data format, a declarative and standardized way to define data for machine learning workloads. It is particularly used within Azure Machine Learning to specify datasets from various sources like local files, Delta Lake, Parquet, and CSV. The current version is 1.6.3, and it generally follows a regular release cadence.

pip install mltable
INSTALL
IMPORT
SIG · MLTABLE
M
mltable
azurepythonv1.6.3
Install
9.4s avg
Import
1717ms
Disk
286MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
timeout
glibc
py 3.103.920 runs
installs and imports cleanly · install 9.4s · import 1.717s · 287MB
286MB installed
● package 286MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MLTable
import mltable
from mltable import MLTable
While MLTable is a class, it's typically instantiated via factory methods like `mltable.from_json_lines_files()` rather than directly. The module `mltable` itself contains the core functionality.
load
import mltable mltable.load(...)
The `load` function is a module-level function within the `mltable` package.
from_json_lines_files
import mltable mltable.from_json_lines_files(...)
One of many factory methods for creating an MLTable from specific data sources.

This quickstart demonstrates how to create an MLTable from local JSON Lines files, save it to a directory, and then load it back. Finally, it converts the loaded MLTable into a Pandas DataFrame for easy viewing. This is a common pattern for defining and managing datasets.

import mltable import pandas as pd import os # Create a dummy data file if not os.path.exists('data'): os.makedirs('data') with open('data/sample.jsonl', 'w') as f: f.write('{"id": 1, "value": "A"}\n') f.write('{"id": 2, "value": "B"}\n') # Create an MLTable object from a local JSON Lines file tbl = mltable.from_json_lines_files(files=['data/sample.jsonl']) # Save the MLTable to a directory output_dir = 'my_mltable_data' if not os.path.exists(output_dir): os.makedirs(output_dir) tbl.save(output_dir) print(f"MLTable saved to '{output_dir}'") # Load the MLTable loaded_tbl = mltable.load(output_dir) # Convert to pandas DataFrame for inspection df = loaded_tbl.to_pandas_dataframe() print("Loaded DataFrame:") print(df) # Clean up dummy files os.remove('data/sample.jsonl') os.rmdir('data') os.remove(os.path.join(output_dir, 'MLTable')) os.rmdir(output_dir)
Debug
Known issues
gotchaMLTable expects paths to be URIs (e.g., `file://`, `azureml://`, `http://`). While relative local paths often work implicitly, explicitly using `file://` for local files, especially when integrating with systems like AzureML, can prevent unexpected `FileNotFoundError` or permission issues.
fix
Prefix local paths with `file://` (e.g., `mltable.from_json_lines_files(files=['file://./data.jsonl'])`) or ensure your execution environment correctly resolves relative paths for `MLTable` operations.
affects: All versions
gotchaMLTable files (e.g., `MLTable` YAML file) adhere to a specific schema. Incorrect YAML syntax, missing required fields, or invalid data source definitions can lead to `mltable.exceptions.ValidationException`.
fix
Carefully review the official MLTable schema documentation. Use a YAML linter if authoring MLTable files manually. Ensure all required fields like `paths` and `transformations` (if applicable) are correctly defined.
affects: All versions
gotchaUsing `mltable` with remote storage (e.g., Azure Blob Storage, ADLS Gen2) requires appropriate authentication and optional dependency packages (e.g., `azure-storage-blob`, `azure-identity`). Without correct setup, operations will fail with authentication errors or `FileNotFoundError`.
fix
Install necessary storage-specific packages (e.g., `pip install mltable[azure]`). Ensure your environment has valid Azure credentials (e.g., via environment variables, Azure CLI login, or managed identity). Refer to `azure-identity` documentation for credential setup.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mltable'
The `mltable` package is not installed or not accessible in the current Python environment.
fix
Run `pip install mltable` in your active Python environment.
FileNotFoundError: No such file or directory: 'path/to/my_mltable_data'
The specified path to the MLTable directory or a file referenced within the MLTable definition does not exist or is inaccessible.
fix
Verify that the path provided to `mltable.load()` or within the MLTable definition points to an existing directory or file. Ensure correct casing and full paths if not using URIs. Check file permissions.
mltable.exceptions.ValidationException: Validation error while parsing MLTable at 'MLTable'
The `MLTable` YAML file (or its JSON equivalent) at the specified path is syntactically incorrect or does not conform to the expected MLTable schema.
fix
Inspect the `MLTable` file for syntax errors (e.g., indentation, missing colons) and ensure it includes all required fields and adheres to the official MLTable schema for its version. The error message usually provides more details on what failed validation.
Upgrade
Version history
1.6.3latest on PyPI · released Sep 9, 2025
Audit
Dependencies
azure-storage-bloboptionalRequired for interacting with Azure Blob Storage data sources.
pyarrowoptionalOften used for efficient data handling with Parquet and other columnar formats.
delta-kernel-pythonoptionalRequired for interacting with Delta Lake data sources.
Agent activity
31 hits · last 30 days
node
28
OpenAI (training)
1
Resources
mltable — pip install mltable · libregistry