fn_composers submodule¶
This module holds few functions used to dynamically construct filenames for files in SIP package.
API¶
Filenames are generated dynamically. Here is set of composers of filanames.
-
ltp.fn_composers.
_get_suffix
(path)[source]¶ 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.
-
ltp.fn_composers.
original_fn
(book_id, ebook_fn)[source]¶ Construct original filename from book_id and ebook_fn.
Parameters: - book_id (int/str) – ID of the book, without special characters.
- ebook_fn (str) – Original name of the ebook. Used to get suffix.
Returns: Filename in format
oc_nk-BOOKID.suffix
.Return type:
-
ltp.fn_composers.
metadata_fn
(book_id)[source]¶ 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
-
ltp.fn_composers.
volume_fn
(cnt)[source]¶ Construct filename for ‘volume’ metadata file.
Parameters: cnt (int) – Number of the MODS record. Returns: Filename in format mods_volume.xml
ormods_volume_cnt.xml
.Return type: str