def extract_csv(zip_path, destination):
with zipfile.ZipFile(zip_path) as zf:<EOL><INDENT>member_to_unzip = None<EOL>for member in zf.namelist():<EOL><INDENT>if member.endswith('<STR_LIT>'):<EOL><INDENT>member_to_unzip = member<EOL>break<EOL><DEDENT><DEDENT>if not member_to_unzip:<EOL><INDENT>raise LookupError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>with zf.open(member_to_unzip) as zfp,open(destination, '<STR_LIT:wb>') as dfp:<EOL><INDENT>dfp.write(zfp.read())<EOL><DEDENT><DEDENT>
Extract the first CSV file found in the given ``zip_path`` ZIP file to the
``destination`` file. Raises :class:`LookupError` if no CSV file can be
found in the ZIP.