sheet_loader package

Submodules

sheet_loader.constants module

sheet_loader.data_loader module

sheet_loader.detecting_buffer module

class sheet_loader.detecting_buffer.DetectingBuffer(file: Union[Readable, Openable, str, bytes, PathLike[str], PathLike[bytes], int], newline=None, **kwargs)[source]

Bases: Readable

get_csv_dialect(sniffer: Optional[Sniffer] = None, delimiters: Optional[str] = None, sample_size=524288)[source]
peek(size: Optional[int] = None) str[source]
read(size: Optional[int] = None) str[source]
readline()[source]
seek(_DetectingBuffer__offset: int, _DetectingBuffer__whence: int = Ellipsis) int[source]
seekable() bool[source]
class sheet_loader.detecting_buffer.ReaderThread(file: Readable, in_writer: NonBlockConnection, chunk_size=32768)[source]

Bases: Thread

This constructor should always be called with keyword arguments. Arguments are:

group should be None; reserved for future extension when a ThreadGroup class is implemented.

target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

name is the thread name. By default, a unique name is constructed of the form “Thread-N” where N is a small decimal number.

args is the argument tuple for the target invocation. Defaults to ().

kwargs is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

stop()[source]
exception sheet_loader.detecting_buffer.StopThread[source]

Bases: BaseException

sheet_loader.detecting_buffer.pipe_full(conn, timeout=0.0)[source]

sheet_loader.helpers module

class sheet_loader.helpers.LazyOpener(file: Union[Readable, Openable, str, bytes, PathLike[str], PathLike[bytes], int], *args, **kwargs)[source]

Bases: object

close()[source]
open() Readable[source]
class sheet_loader.helpers.PandasLoader[source]

Bases: object

sheet_loader.helpers.catch_exceptions(func, exceptions)[source]
sheet_loader.helpers.frame_chunker(frame, chunk_size)[source]
sheet_loader.helpers.lazy_open(file: Union[Readable, Openable, str, bytes, PathLike[str], PathLike[bytes], int], *args, **kwargs) Generator[Readable, None, None][source]

sheet_loader.sheet_loader module

class sheet_loader.sheet_loader.SheetFileType(value)[source]

Bases: Enum

An enumeration.

CSV = 1
XLS = 2
class sheet_loader.sheet_loader.SheetLoader(file: Union[str, bytes, PathLike[str], PathLike[bytes], int, FastApiFile], **kwargs)[source]

Bases: Iterable

close()[source]
property data
get_file_data(**kwargs)[source]
load_csv(csv_read_func=None, **pd_kwargs)[source]
load_xlsx(**pd_kwargs)[source]
read()[source]
sheet_loader.sheet_loader.clean_kwargs(function, kwargs: dict)[source]
sheet_loader.sheet_loader.read_sheet(file: Union[str, bytes, PathLike[str], PathLike[bytes], int, FastApiFile], **kwargs)[source]

sheet_loader.types module

class sheet_loader.types.FastApiFile(*args, **kwargs)[source]

Bases: Protocol

content_type: str
file: Readable
filename: str
class sheet_loader.types.Openable(*args, **kwargs)[source]

Bases: Protocol

open(*args, **kwargs) Any[source]
class sheet_loader.types.Readable(*args, **kwargs)[source]

Bases: Protocol[AnyStr_co]

read(_Readable__n: int | None = Ellipsis) AnyStr_co[source]
seek(_Readable__offset: int, _Readable__whence: int = Ellipsis) int[source]

Module contents