schrodinger.utils.csv_unicode module

A wrapper around Python’s csv module that allows it to work with Unicode characters and optionally, gzip compression. The interface is intended to mirror the csv interface. See Python’s csv documentation for an explanation of methods and method arguments.

schrodinger.utils.csv_unicode.reader_open(filename)
schrodinger.utils.csv_unicode.writer_open(filename)
schrodinger.utils.csv_unicode.get_unicode_file_handle(filename, mode, encoding='utf-8')

Get a file handle with unicode encoding. csv requires the handle to be opened in text mode.

It is strongly recommended to use the reader_open and writer_open context managers instead of this function directly unless a context manager is not appropriate for your use case.