quantlab.utils.watermark.read_watermark#
- quantlab.utils.watermark.read_watermark(path)[source]#
Return the day the dated watermark in
pathreaches, orNonewithout a file.- Parameters:
- pathstr or Path
The watermark file.
- Returns:
- date or None
Nonewhen the file is absent.
- Raises:
- ValueError
If the file is not valid JSON.
- KeyError
If it has no
through.
Examples
>>> import tempfile >>> from pathlib import Path >>> read_watermark(Path(tempfile.mkdtemp()) / WATERMARK_FILE) is None True