jsonvectorizer.utils.fopen¶
-
jsonvectorizer.utils.
fopen
(filename, mode='r')¶ Open a regular or compressed file
Detects the type of the file, and uses the relevent module to open it. Supports regular (uncompressed), gz, and lz4 files.
Parameters: - filename : str
Path to a file.
- mode : str, optional (default=’r’)
Mode for opening the file, similar to Python’s open method. lz4 files can only be opened for reading.
Returns: - file-like object
Raises: - ValueError
If a lz4 file is opened for writing or appending.