pyShelf Open Source Ebook Server 0.8.0
FOSS E-Book Server, https://pyshelf.com
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
src.backend.lib.library.Catalogue Class Reference
Inheritance diagram for src.backend.lib.library.Catalogue:
src.backend.lib.overide.ACatalogue src.backend.tests.library_test.Test_Catalogue

Public Member Functions

def __init__ (self, config)
 
def scan_folder (self, _path=None)
 
def filter_books (self)
 
def process_by_filetype (self, book)
 
def extract_metadata_epub (self, book)
 
def extract_metadata_pdf (self, book)
 
def extract_metadata_mobi (self, book)
 
def extract_content (self, book_zip, book)
 
def extract_cover_html (self, book_zip, book)
 
def extract_cover_image (self, book_zip, book)
 
def compare_shelf_current (self)
 
def import_books (self, list=None, **kwargs)
 

Static Public Member Functions

def process_epub (book)
 
def stripTags (source)
 

Public Attributes

 file_list
 
 opf_regx
 
 cover_regx
 
 html_regx
 
 title_sanitization_regx
 
 title_sanitization_lvl2_regx
 
 title_sanitization_dirs_regx
 
 root_dir
 
 book_folder
 
 books
 
 db_pointer
 
 config
 

Detailed Description

Decodes book metadata for storage

Constructor & Destructor Documentation

◆ __init__()

def src.backend.lib.library.Catalogue.__init__ (   self,
  config 
)

Member Function Documentation

◆ compare_shelf_current()

def src.backend.lib.library.Catalogue.compare_shelf_current (   self)
Calls storage system, gets list of books stored and compares against files on disk

◆ extract_content()

def 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

◆ extract_cover_html()

def 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

◆ extract_cover_image()

def 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

◆ extract_metadata_epub()

def src.backend.lib.library.Catalogue.extract_metadata_epub (   self,
  book 
)
Return extracted metadata and cover picture
book['path'] == Full path to ebook file
book['files'] == list of files from self.process_book(book)

◆ extract_metadata_mobi()

def src.backend.lib.library.Catalogue.extract_metadata_mobi (   self,
  book 
)

◆ extract_metadata_pdf()

def 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.

◆ filter_books()

def 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.

◆ import_books()

def 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.

◆ process_by_filetype()

def src.backend.lib.library.Catalogue.process_by_filetype (   self,
  book 
)
Determine books filetype and process.

◆ process_epub()

def src.backend.lib.library.Catalogue.process_epub (   book)
static
Return dictionary of epub file contents

◆ scan_folder()

def src.backend.lib.library.Catalogue.scan_folder (   self,
  _path = None 
)
Scan folder by _path, allows recurisive scanning

Reimplemented in src.backend.lib.overide.ACatalogue.

◆ stripTags()

def src.backend.lib.library.Catalogue.stripTags (   source)
static

Member Data Documentation

◆ book_folder

src.backend.lib.library.Catalogue.book_folder

◆ books

src.backend.lib.library.Catalogue.books

◆ config

src.backend.lib.library.Catalogue.config

◆ cover_regx

src.backend.lib.library.Catalogue.cover_regx

◆ db_pointer

src.backend.lib.library.Catalogue.db_pointer

◆ file_list

src.backend.lib.library.Catalogue.file_list

◆ html_regx

src.backend.lib.library.Catalogue.html_regx

◆ opf_regx

src.backend.lib.library.Catalogue.opf_regx

◆ root_dir

src.backend.lib.library.Catalogue.root_dir

◆ title_sanitization_dirs_regx

src.backend.lib.library.Catalogue.title_sanitization_dirs_regx

◆ title_sanitization_lvl2_regx

src.backend.lib.library.Catalogue.title_sanitization_lvl2_regx

◆ title_sanitization_regx

src.backend.lib.library.Catalogue.title_sanitization_regx

The documentation for this class was generated from the following file: