|
pyShelf Open Source Ebook Server 0.8.0
FOSS E-Book Server, https://pyshelf.com
|
Public Member Functions | |
| __init__ (self, config) | |
| scan_folder (self, _path=None) | |
| filter_books (self) | |
| process_by_filetype (self, book) | |
| extract_metadata_epub (self, book) | |
| extract_metadata_pdf (self, book) | |
| extract_metadata_mobi (self, book) | |
| extract_content (self, book_zip, book) | |
| extract_cover_html (self, book_zip, book) | |
| extract_cover_image (self, book_zip, book) | |
| compare_shelf_current (self) | |
| import_books (self, list=None, **kwargs) | |
Static Public Member Functions | |
| process_epub (book) | |
| stripTags (source) | |
Public Attributes | |
| list | file_list = [] |
| opf_regx = re.compile(r"\.opf") | |
| cover_regx = re.compile(r"\.jpg|\.jpeg|\.png|\.bmp|\.gif") | |
| html_regx = re.compile(r"\.html") | |
| title_sanitization_regx = re.compile(r"^(Book )+[0-9]*") | |
| title_sanitization_lvl2_regx | |
| title_sanitization_dirs_regx = re.compile(r"/") | |
| root_dir = config.root | |
| book_folder = config.book_path | |
| books = None | |
| db_pointer = config.catalogue_db | |
| config = config | |
Decodes book metadata for storage
| src.backend.lib.library.Catalogue.__init__ | ( | self, | |
| config ) |
| src.backend.lib.library.Catalogue.compare_shelf_current | ( | self | ) |
Calls storage system, gets list of books stored and compares against files on disk
| src.backend.lib.library.Catalogue.extract_content | ( | self, | |
| book_zip, | |||
| book ) |
Opens epub as zip file filters then stores as list any files matching opf_regx
| src.backend.lib.library.Catalogue.extract_cover_html | ( | self, | |
| book_zip, | |||
| book ) |
Opens epub as zip file filters then stores as list any files matching html_regx
| src.backend.lib.library.Catalogue.extract_cover_image | ( | self, | |
| book_zip, | |||
| book ) |
Opens epub as zip file filters then stores as list any files matching cover_regx
| src.backend.lib.library.Catalogue.extract_metadata_epub | ( | self, | |
| book ) |
Extract metadata from epub file :param book: Dictionary of epub file contents :returns: Dictionary of book metadata
| src.backend.lib.library.Catalogue.extract_metadata_mobi | ( | self, | |
| book ) |
| src.backend.lib.library.Catalogue.extract_metadata_pdf | ( | self, | |
| book ) |
Return extracted metadata :NOTES: Retrieval of data has been problematic, some pdf's providing reliable titles that corespond with the actual, and others being nonsense.
| src.backend.lib.library.Catalogue.filter_books | ( | self | ) |
Calls scan_folder and filters out book files. :returns self._book_list_expanded: json string containing all book metadata
Reimplemented in src.backend.tests.library_test.Test_Catalogue.
| src.backend.lib.library.Catalogue.import_books | ( | self, | |
| list = None, | |||
| ** | kwargs ) |
Main entry point for import operations. Gets a list of new files via compare_shelf_current. Iterates over list and inserts new books into database.
Reimplemented in src.backend.lib.overide.ACatalogue.
| src.backend.lib.library.Catalogue.process_by_filetype | ( | self, | |
| book ) |
Determine books filetype and process.
|
static |
Return dictionary of epub file contents
| src.backend.lib.library.Catalogue.scan_folder | ( | self, | |
| _path = None ) |
Scan folder by _path, allows recurisive scanning :param _path: Path to scan
Reimplemented in src.backend.lib.overide.ACatalogue.
|
static |
| src.backend.lib.library.Catalogue.book_folder = config.book_path |
| src.backend.lib.library.Catalogue.books = None |
| src.backend.lib.library.Catalogue.config = config |
| src.backend.lib.library.Catalogue.cover_regx = re.compile(r"\.jpg|\.jpeg|\.png|\.bmp|\.gif") |
| src.backend.lib.library.Catalogue.db_pointer = config.catalogue_db |
| list src.backend.lib.library.Catalogue.file_list = [] |
| src.backend.lib.library.Catalogue.html_regx = re.compile(r"\.html") |
| src.backend.lib.library.Catalogue.opf_regx = re.compile(r"\.opf") |
| src.backend.lib.library.Catalogue.root_dir = config.root |
| src.backend.lib.library.Catalogue.title_sanitization_dirs_regx = re.compile(r"/") |
| src.backend.lib.library.Catalogue.title_sanitization_lvl2_regx |
| src.backend.lib.library.Catalogue.title_sanitization_regx = re.compile(r"^(Book )+[0-9]*") |