Tables.jl

Package defining common interface for tabular data in Julia. Provides interoperability between different data structures, enabling unified data access across various formats like DataFrames, CSV, and JSON.

Juliatablesinterfacedata interoperabilityabstractiondata structuresecosystem

Framework

Tables.jl

Overview

Tables.jl is a package that defines a common interface for tabular data in Julia. It provides interoperability between different data structures, enabling unified data access across various formats including DataFrames, CSV, JSON, and more.

Details

Tables.jl is a foundational interface package for the Julia data ecosystem. Development began in 2018, and by providing a common API between different tabular data structures, it has significantly improved interoperability between packages. It supports both row-oriented and column-oriented data access patterns, enabling efficient iterator-based data processing. Major data packages such as DataFrames.jl, CSV.jl, SQLite.jl, and Arrow.jl have adopted this interface, enabling seamless conversion between data sources. It provides type-safe data access with minimal overhead and supports large-scale data processing.

Basic Usage

using Tables, DataFrames, CSV

# Check Tables.jl interface
Tables.istable(df)  # true

# Row iterator
for row in Tables.rows(df)
    println(row.name, ": ", row.age)
end

# Column access
cols = Tables.columns(df)
names_col = Tables.getcolumn(cols, :name)

# Conversion between different data formats
# CSV → DataFrame (via Tables.jl)
df = DataFrame(CSV.File("data.csv"))

# Define custom table type
struct MyTable
    data::Vector{NamedTuple}
end

Tables.istable(::Type{MyTable}) = true
Tables.rowaccess(::Type{MyTable}) = true
Tables.rows(t::MyTable) = t.data

Summary

Tables.jl is an important foundation supporting interoperability in the Julia data ecosystem. Through its common interface, it enables smooth data exchange between different data packages, significantly enhancing Julia's overall data processing capabilities.