Files
typeshed/stdlib/3/zipfile.pyi
2015-09-30 09:59:44 -07:00

30 lines
951 B
Python

# TODO these are incomplete
from typing import List, Tuple, BinaryIO, Union
ZIP_STORED = 0
ZIP_DEFLATED = 0
def is_zipfile(filename: Union[str, BinaryIO]) -> bool: ...
class ZipInfo:
filename = ''
date_time = ... # type: Tuple[int, int, int, int, int, int]
compressed_size = 0
file_size = 0
class ZipFile:
def __init__(self, file: Union[str, BinaryIO], mode: str = 'r',
compression: int = ZIP_STORED,
allowZip64: bool = False) -> None: ...
def close(self) -> None: ...
def getinfo(name: str) -> ZipInfo: ...
def infolist(self) -> List[ZipInfo]: ...
def namelist(self) -> List[str]: ...
def read(self, name: Union[str, ZipInfo], pwd: str = None) -> bytes: ...
def write(self, filename: str, arcname: str = None,
compress_type: int = None) -> None: ...
def __enter__(self) -> 'ZipFile': ...
def __exit__(self, type, value, traceback) -> bool: ...