Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-io/src/csv/read/mod.rs
6939 views
1
//! Functionality for reading CSV files.
2
//!
3
//! # Examples
4
//!
5
//! ```
6
//! use polars_core::prelude::*;
7
//! use polars_io::prelude::*;
8
//! use std::fs::File;
9
//!
10
//! fn example() -> PolarsResult<DataFrame> {
11
//! // Prefer `from_path` over `new` as it is faster.
12
//! CsvReadOptions::default()
13
//! .with_has_header(true)
14
//! .try_into_reader_with_file_path(Some("example.csv".into()))?
15
//! .finish()
16
//! }
17
//! ```
18
19
pub mod buffer;
20
mod options;
21
mod parser;
22
mod read_impl;
23
mod reader;
24
pub mod schema_inference;
25
mod splitfields;
26
mod utils;
27
28
pub use options::{CommentPrefix, CsvEncoding, CsvParseOptions, CsvReadOptions, NullValues};
29
pub use parser::{count_rows, count_rows_from_slice, count_rows_from_slice_par};
30
pub use read_impl::batched::{BatchedCsvReader, OwnedBatchedCsvReader};
31
pub use reader::CsvReader;
32
pub use schema_inference::infer_file_schema;
33
34
pub mod _csv_read_internal {
35
pub use super::buffer::validate_utf8;
36
pub use super::options::NullValuesCompiled;
37
pub use super::parser::CountLines;
38
pub use super::read_impl::{cast_columns, find_starting_point, read_chunk};
39
pub use super::reader::prepare_csv_schema;
40
}
41
42