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
8424 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 builder;
20
mod options;
21
mod parser;
22
mod read_impl;
23
mod reader;
24
pub mod schema_inference;
25
mod splitfields;
26
pub mod streaming;
27
mod utils;
28
29
pub use options::{CommentPrefix, CsvEncoding, CsvParseOptions, CsvReadOptions, NullValues};
30
pub use parser::{SplitLines, count_rows, count_rows_from_slice_par};
31
pub use reader::CsvReader;
32
pub use streaming::read_until_start_and_infer_schema;
33
34
pub mod _csv_read_internal {
35
pub use super::builder::validate_utf8;
36
pub use super::options::{CommentPrefix, NullValuesCompiled};
37
pub use super::parser::{CountLines, SplitLines, is_comment_line};
38
pub use super::read_impl::{cast_columns, read_chunk};
39
pub use super::reader::prepare_csv_schema;
40
}
41
42