Format: application/octet-stream
1 import sys
2 from typing import Any, Iterable, Iterator, List, Optional, Protocol, Sequence, Text, Type, Union
3
4 QUOTE_ALL: int
5 QUOTE_MINIMAL: int
6 QUOTE_NONE: int
7 QUOTE_NONNUMERIC: int
8
9 class Error(Exception): ...
10
11 class Dialect:
12 delimiter: str
13 quotechar: Optional[str]
14 escapechar: Optional[str]
15 doublequote: bool
16 skipinitialspace: bool
17 lineterminator: str
18 quoting: int
19 strict: int
20 def __init__(self) -> None: ...
21
22 _DialectLike = Union[str, Dialect, Type[Dialect]]
23
24 class _reader(Iterator[List[str]]):
25 dialect: Dialect
26 line_num: int
27 if sys.version_info >= (3, 0):
28 def __next__(self) -> List[str]: ...
29 else:
30 def next(self) -> List[str]: ...
31
32 class _writer:
33 dialect: Dialect
34
35 if sys.version_info >= (3, 5):
36 def writerow(self, row: Iterable[Any]) -> Any: ...
37 def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
38 else:
39 def writerow(self, row: Sequence[Any]) -> Any: ...
40 def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ...
41
42 class _Writer(Protocol):
43 def write(self, s: str) -> Any: ...
44
45 def writer(csvfile: _Writer, dialect: _DialectLike = ..., **fmtparams: Any) -> _writer: ...
46 def reader(csvfile: Iterable[Text], dialect: _DialectLike = ..., **fmtparams: Any) -> _reader: ...
47 def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ...
48 def unregister_dialect(name: str) -> None: ...
49 def get_dialect(name: str) -> Dialect: ...
50 def list_dialects() -> List[str]: ...
51 def field_size_limit(new_limit: int = ...) -> int: ...
52