From 7de4228694acc5859fc0e4c76513c38cc884dfba Mon Sep 17 00:00:00 2001 From: Junxiao-Hou <72389857+Junxiao-Hou@users.noreply.github.com> Date: Thu, 21 Oct 2021 00:13:40 -0500 Subject: [PATCH] Add an overall module docstring (#934) --- src/CSV.jl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/CSV.jl b/src/CSV.jl index fbb44f13..cd5ce95b 100644 --- a/src/CSV.jl +++ b/src/CSV.jl @@ -1,3 +1,26 @@ +""" +CSV provides fast, flexible reader & writer for delimited text files in various formats. + +Reading: +- `CSV.File` reads delimited data and returns a `CSV.File` object, which allows dot-access to columns and iterating rows. +- `CSV.read` is similar to `CSV.File` but used when the input will be passed directly to a sink function such as a `DataFrame`. +- `CSV.Rows` reads delimited data and returns a `CSV.Rows` object, which allows "streaming" the data by iterating and thereby has a lower memory footprint than `CSV.File`. +- `CSV.Chunks` allows processing extremely large files in "batches" or "chunks". +Writing: +- `CSV.write` writes a [Tables.jl interface input](https://github.com/JuliaData/Tables.jl) such as a `DataFrame` to a csv file or an in-memory IOBuffer. +- `CSV.RowWriter` creates an iterator that produces csv-formatted strings for each row in the input table. +Here is an example of reading a csv file and passing the input to a `DataFrame`: +```julia +using CSV, DataFrames +ExampleInputDF = CSV.read("ExampleInputFile.csv", DataFrame) +``` +Here is an example of writing out a `DataFrame` to a csv file: +```julia +using CSV, DataFrames +ExampleOutputDF = DataFrame(rand(10,10), :auto) +CSV.write("ExampleOutputFile.csv", ExampleOutputDF) +``` +""" module CSV if !isdefined(Base, :contains)