epublib.identifier module¶
- class EPUBId¶
Bases:
strA unique identifier for a resource within an EPUB file. Use this class to reference epub resources throughout the library using it’s manifest id rather than its complete filename.
Typical usage:
>>> EPUBId("chapter1") 'chapter1' >>> EPUBId("chapter1") == "chapter1" True >>> EPUBId("chapter 1").valid False >>> EPUBId.to_valid("chapter 1") 'chapter_1'
- Parameters:
value – The identifier string.
- classmethod is_valid(value: str) bool¶
Check if the identifier is valid according to the XML specification.
- Returns:
True if the identifier is valid, False otherwise.