1 from collections import OrderedDict
\r
3 from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Union
\r
5 from _csv import (_reader,
\r
9 register_dialect as register_dialect,
\r
10 unregister_dialect as unregister_dialect,
\r
11 get_dialect as get_dialect,
\r
12 list_dialects as list_dialects,
\r
13 field_size_limit as field_size_limit,
\r
14 QUOTE_ALL as QUOTE_ALL,
\r
15 QUOTE_MINIMAL as QUOTE_MINIMAL,
\r
16 QUOTE_NONE as QUOTE_NONE,
\r
17 QUOTE_NONNUMERIC as QUOTE_NONNUMERIC,
\r
21 _Dialect = Union[str, Dialect]
\r
22 _DictRow = Dict[str, Any]
\r
24 class Dialect(object):
\r
25 delimiter = ... # type: str
\r
26 quotechar = ... # type: Optional[str]
\r
27 escapechar = ... # type: Optional[str]
\r
28 doublequote = ... # type: bool
\r
29 skipinitialspace = ... # type: bool
\r
30 lineterminator = ... # type: str
\r
31 quoting = ... # type: int
\r
32 def __init__(self) -> None: ...
\r
34 class excel(Dialect):
\r
35 delimiter = ... # type: str
\r
36 quotechar = ... # type: str
\r
37 doublequote = ... # type: bool
\r
38 skipinitialspace = ... # type: bool
\r
39 lineterminator = ... # type: str
\r
40 quoting = ... # type: int
\r
42 class excel_tab(excel):
\r
43 delimiter = ... # type: str
\r
45 if sys.version_info >= (3,):
\r
46 class unix_dialect(Dialect):
\r
47 delimiter = ... # type: str
\r
48 quotechar = ... # type: str
\r
49 doublequote = ... # type: bool
\r
50 skipinitialspace = ... # type: bool
\r
51 lineterminator = ... # type: str
\r
52 quoting = ... # type: int
\r
54 if sys.version_info >= (3, 6):
\r
55 _DRMapping = OrderedDict[str, str]
\r
57 _DRMapping = Dict[str, str]
\r
60 class DictReader(Iterator[_DRMapping]):
\r
61 restkey = ... # type: Optional[str]
\r
62 restval = ... # type: Optional[str]
\r
63 reader = ... # type: _reader
\r
64 dialect = ... # type: _Dialect
\r
65 line_num = ... # type: int
\r
66 fieldnames = ... # type: Sequence[str]
\r
67 def __init__(self, f: Iterable[str], fieldnames: Sequence[str] = ...,
\r
68 restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ...,
\r
69 *args: Any, **kwds: Any) -> None: ...
\r
70 def __iter__(self) -> 'DictReader': ...
\r
71 if sys.version_info >= (3,):
\r
72 def __next__(self) -> _DRMapping: ...
\r
74 def next(self) -> _DRMapping: ...
\r
77 class DictWriter(object):
\r
78 fieldnames = ... # type: Sequence[str]
\r
79 restval = ... # type: Optional[Any]
\r
80 extrasaction = ... # type: str
\r
81 writer = ... # type: _writer
\r
82 def __init__(self, f: Any, fieldnames: Sequence[str],
\r
83 restval: Optional[Any] = ..., extrasaction: str = ..., dialect: _Dialect = ...,
\r
84 *args: Any, **kwds: Any) -> None: ...
\r
85 def writeheader(self) -> None: ...
\r
86 def writerow(self, rowdict: _DictRow) -> None: ...
\r
87 def writerows(self, rowdicts: Iterable[_DictRow]) -> None: ...
\r
89 class Sniffer(object):
\r
90 preferred = ... # type: List[str]
\r
91 def __init__(self) -> None: ...
\r
92 def sniff(self, sample: str, delimiters: Optional[str] = ...) -> Dialect: ...
\r
93 def has_header(self, sample: str) -> bool: ...
\r