pyarrow.LocalFileSystem¶
- class pyarrow.LocalFileSystem[source]¶
Bases:
pyarrow.filesystem.FileSystemMethods
__init__()cat(path)Return contents of file as a bytes object.
delete(path[, recursive])Delete the indicated file or directory.
disk_usage(path)Compute bytes used by all contents under indicated path in file tree.
exists(path)Return True if path exists.
isdir(path)Return True if path is a directory.
isfile(path)Return True if path is a file.
ls(path)Return list of file paths.
mkdir(path[, create_parents])Create a directory.
mv(path, new_path)Alias for FileSystem.rename.
open(path[, mode])Open file for reading or writing.
read_parquet(path[, columns, metadata, ...])Read Parquet data from path in file system.
rename(path, new_path)Rename file, like UNIX mv command.
rm(path[, recursive])Alias for FileSystem.delete.
stat(path)Information about a filesystem entry.
walk(path)Directory tree generator, see os.walk.
Attributes
- cat(path)¶
Return contents of file as a bytes object.
- delete(path, recursive=False)¶
Delete the indicated file or directory.
- disk_usage(path)¶
Compute bytes used by all contents under indicated path in file tree.
- mv(path, new_path)¶
Alias for FileSystem.rename.
- property pathsep¶
- read_parquet(path, columns=None, metadata=None, schema=None, use_threads=True, use_pandas_metadata=False)¶
Read Parquet data from path in file system. Can read from a single file or a directory of files.
- Parameters
- path
str Single file path or directory
- columns
List[str], optional Subset of columns to read.
- metadata
pyarrow.parquet.FileMetaData Known metadata to validate files against.
- schema
pyarrow.parquet.Schema Known schema to validate files against. Alternative to metadata argument.
- use_threadsbool, default
True Perform multi-threaded column reads.
- use_pandas_metadatabool, default
False If True and file has custom pandas schema metadata, ensure that index columns are also loaded.
- path
- Returns
- table
pyarrow.Table
- table
- rename(path, new_path)¶
Rename file, like UNIX mv command.
- rm(path, recursive=False)¶
Alias for FileSystem.delete.