QuickReaderPDF package¶
Subpackages¶
Modules¶
Boldens the first three letters of each word
- QuickReaderPDF.pdfeditor.bolden_html(soup)¶
- Given a BeautifulSoup object, finds all text in the HTML
file and bolds the first three letters of every word.
Parameters: soup (bs4.BeautifulSoup): The BeautifulSoup object representing the HTML document.
Returns: bs4.BeautifulSoup: The modified BeautifulSoup object with bolded text.
- QuickReaderPDF.pdfeditor.copy_url(response, html_file)¶
Writes the content of the response object to the specified HTML file.
Parameters: response (requests.Response): The response object containing the content to be written. html_file (str): The path and filename of the HTML file to be written.
- QuickReaderPDF.pdfeditor.create_bs_obj(html_doc)¶
Given an HTML document, creates a BeautifulSoup object and returns it.
Parameters: html_doc (str): The HTML document to be parsed into a BeautifulSoup object.
Returns: bs4.BeautifulSoup: The BeautifulSoup object created from the HTML document.
- QuickReaderPDF.pdfeditor.html_to_pdf(html_file, pdf_file)¶
- QuickReaderPDF.pdfeditor.main_func(type='url', input='sample.pdf', file_name='out.pdf')¶
Converts a PDF file or URL to a PDF file with bold text.
- Args:
- type (str, optional): The type of input.
Either “url” or “pdf”. Defaults to “url”.
- input (str, optional): The URL or PDF file path.
Defaults to “sample.pdf”.
- file_name (str, optional): The name of the output PDF file.
Defaults to “out.pdf”.
- Returns:
None
- QuickReaderPDF.pdfeditor.read_html_file(html_file)¶
Reads the contents of the specified HTML file and returns them as a string.
Args: html_file (str): The path and filename of the HTML file to be read.
Returns: str: The contents of the specified HTML file.
- QuickReaderPDF.pdfeditor.remove_html(html_file)¶
Deletes the specified HTML file.
Parameters: html_file (str): The path and filename of the HTML file to be deleted
- QuickReaderPDF.pdfeditor.url_parser(url)¶
Given a URL, sends a GET request and returns the response object.
Parameters: url (str): The URL to send the GET request to.
Returns: requests.Response: The response object returned by the GET request.
- QuickReaderPDF.pdfeditor.write_html(soup, html_file)¶
Given a BeautifulSoup object and an HTML file path, writes the modified HTML to the specified file.
Parameters: soup (bs4.BeautifulSoup): The modified BeautifulSoup object to be written to the HTML file. html_file (str): The path and filename of the HTML file to be written.