This module holds few functions used to dynamically construct filenames for files in SIP package.
Filenames are generated dynamically. Here is set of constructors for those filanames.
Return suffix from path.
/home/xex/somefile.txt –> txt.
Parameters: | path (str) – Full file path. |
---|---|
Returns: | Suffix. |
Return type: | str |
Raises: | UserWarning – When / is detected in suffix. |
Construct original filename from book_id and ebook_fn.
Parameters: |
|
---|---|
Returns: | Filename in format oc_nk-BOOKID.suffix. |
Return type: | str |
Construct filename for metadata file.
Parameters: | book_id (int/str) – ID of the book, without special characters. |
---|---|
Returns: | Filename in format meds_nk-BOOKID.xml. |
Return type: | str |
Construct filename for ‘volume’ metadata file.
Parameters: | cnt (int) – Number of the MODS record. |
---|---|
Returns: | Filename in format mods_volume.xml or mods_volume_cnt.xml. |
Return type: | str |