% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read.R
\name{tl_read}
\alias{tl_read}
\title{Read data from diverse sources}
\usage{
tl_read(source, ..., format = NULL, .quiet = FALSE)
}
\arguments{
\item{source}{A file path, URL, connection string, directory path, or a
character vector of multiple file paths.}

\item{...}{Additional arguments passed to the format-specific reader.}

\item{format}{Optional explicit format override.
One of \code{"csv"}, \code{"tsv"},
\code{"excel"}, \code{"parquet"}, \code{"json"},
\code{"rds"}, \code{"rdata"},
\code{"sqlite"}, \code{"postgres"}, \code{"mysql"}, \code{"bigquery"},
\code{"s3"}, \code{"github"}, \code{"kaggle"}. When \code{NULL} (default),
the format is auto-detected from the file extension
or source pattern. Note: \code{.txt} files default
to CSV; use \code{format = "tsv"} to override.}

\item{.quiet}{Logical. If \code{TRUE}, suppresses
informational messages. Default is \code{FALSE}.}
}
\value{
A \code{tidylearn_data} object (a \link[tibble]{tibble} subclass)
with attributes \code{tl_source}, \code{tl_format}, and
\code{tl_timestamp}.
}
\description{
Auto-detects the data format from the file extension or source pattern and
dispatches to the appropriate reader. All readers
return a \code{tidylearn_data} object, which is a
tibble subclass carrying metadata about the data
source.
}
\details{
When \code{source} is a character vector of multiple paths, each file is read
and row-bound into a single result with a \code{source_file} column. When
\code{source} is a directory path, it is equivalent to calling
\code{tl_read_dir()}. When \code{source} is a \code{.zip} file, it is
equivalent to calling \code{tl_read_zip()}.
}
\examples{
\donttest{
# Read a single CSV file
# data <- tl_read("path/to/data.csv")

# Read multiple files and row-bind
# data <- tl_read(c("jan.csv", "feb.csv", "mar.csv"))

# Read all CSVs from a directory
# data <- tl_read("data/")

# Read from a zip archive
# data <- tl_read("data.zip")

# Explicit format override
# data <- tl_read("path/to/data.txt", format = "tsv")
}

}
