Code Monkey home page Code Monkey logo

epy's Introduction

$ epy

Downloads

Buy Me a Coffee at ko-fi.com

screenshot

CLI Ebook Reader.

This is just a fork of epr with these extra features:

  • Supported formats:
    • Epub (.epub, .epub3)
    • FictionBook (.fb2)
    • Mobi (.mobi)
    • AZW3 (.azw, .azw3)
    • URL
  • Reading progress percentage
  • Bookmarks
  • External dictionary integration (sdcv, dict or wkdict)
  • Inline formats: bold and italic (depend on terminal and font capability. Italic only supported in python>=3.7)
  • Text-to-Speech (with additional setup, read below)
  • Double Spread
  • Seamless (disabled by default, read below)

Installation

  • Via PyPI (Linux and Mac OS)

    pip3 install epy-reader
  • Via Pip+Git

    pip3 install git+https://github.com/wustho/epy
  • Via AUR

    yay -S epy-ereader-git
  • Windows Binary

    Standalone binary for Windows is available at release page.

Usage

  • epy /path/to/your/book/book.epub (Remember to make sure your book's title doesn't contain any spaces)
  • c Switching the color profile
  • Shift + h Previous chapter
  • Shift + l Next chapter
  • Shift + g Skip to the end of the chapter
  • g Skip to the beginning of the chapter
  • Shift + m Show metadata of the book
  • t Table of contents
  • / Search
  • b Add bookmark
  • Shift + b Show bookmarks
  • q Quit
  • - Shrink the text
  • + Enlarge the text
  • o Open an image
  • s Show or hide progress

Color profiles

In the config file you will see the following section.

 "DarkColorFG": 47,
 "DarkColorBG": 235,
 "LightColorFG": 238,
 "LightColorBG": 253,

Change the values by using this image. (Make sure to ignore zeros at the beginning, it won't launch otherwise.) image

Reading Tips Using Epy

When reading using epy you might occasionally find triple asteriks ***. That means you reach the end of some section in your ebook and the next line (right after those three asteriks, which is in new section) will start at the top of the page. This might be disorienting, so the best way to get seamless reading experience is by using next-page control (space, l or Right) instead of next-line control (j or Down).

If you really want to get seamless reading experience, you can set SeamlessBetweenChapters to true in configuration file. But it has its drawback with more memory usage, that's why it's disabled by default.

Configuration File

Config file is available in json format which is located at:

  • Linux and Mac OS: ~/.config/epy/configuration.json or ~/.epy/configuration.json
  • Windows: %USERPROFILE%\.epy\configuration.json

URL Support

You can read online books like: short stories, fan fiction, etc. using epy with an url as cli argument. Pretty useful when you want to read with less distraction. epy will also remember your reading progress online.

eg. You can read Moby Dick from gutenberg directly with:

$ epy https://www.gutenberg.org/files/2701/2701-h/2701-h.htm

But note that epy will never be a web browser, it's simply a TUI program to read your favorite fiction stories in the comfort of a terminal. So please do not expect for web browser features to be implemented in epy.

Using Mouse

Although mouse support is useful when running epy on Termux Android, it’s disabled by default since most people find it intrusive when using epy in desktop. But you can enable it by setting MouseSupport to true in config file.

Key Action
Left Click (right side of screen) next page
Left Click (left side of screen) prev page
Right Click ToC
Scroll Up scroll up
Scroll Down scroll down
Ctrl + Scroll Up increase text width
Ctrl + Scroll Down decrease text width

Text-to-Speech

To get Text-to-Speech (TTS) support, external TTS engine is necessary.

List of supported engines:

  • mimic
  • pico2wave
  • gtts-mpv (requires both gTTS and MPV)

Dictionary

To use "Define Word" you will have to install an external dictionary cli program (sdcv, dict or wkdict). After you've done that, it is recommended to manually modify the configuration.json file, and set your desired dictionary there, so everything works properly.

After that you will be able to find definition of word by pressing d, and aprompt will appear to let you type in word to define.

Double Spread

Double spread is intended to mimic the behaviour of real book, so line scrolling navigation will act as scrolling page and textwidth is not adjustable.

Changelog

  • v2021.10.23: Major refactoring which harness a lot of new stuff in python>=3.7 and epy won't be backward compatible with older python version and older configuration.

  • v2022.1.8: Change in configuration and reading states schema that is not backward compatible. So if error is encountered, deleting the configuration and states file might fix the issue.

  • v2022.1.15: Early implementation of URL support, table of contents isn't available for now.

  • v2022.1.23: Library implementation: ability to switch ebook from reading history inside epy (default key: R).

  • v2022.2.5: Fix process.join() issue for unstarted process.

  • v2022.10.2: Major breakdown epy.py module into package structure for easier development.

epy's People

Contributors

3n4n avatar justchokingaround avatar lokiluciferase avatar mcepl avatar mdom avatar tsu-gu avatar wustho avatar xiota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

epy's Issues

Need a better way to display main text than using curses.pad

Since curses.newpad() only limited to 32767 lines height, 32768 or more will raise an exception. So currently epy cannot open thick books with single HTML page containing more than 32767 lines.

Unless those books are well structured where entire text is split into multiple smaller HTML pages.

Features

Hello,

I'm BM. A very nice and polite guy.

Nice package.

Feature requests:

  1. Disable page turning animation. Perhaps toggle it off with a keypress such as "a". I prefer to have it disabled when I read a lot.

Release

Hello,

Can you create a release in order to allow users to package epy?

Please and thank you.

image support?

is there a way to do it like how ranger does it but for cover pages

Running in PowerShell gives strange error

I have faced following error message when running Windows Terminal (powershell.exe):

image

Funniest thing is that it just flashes and then first page of page shows. But navigation is not working. It stuck on this first page.

When running in cmder (cmd.exe) everything is fine.

error: do not load epub file

Python 3.8.2
pip 20.0.2

epy "anyfile.epy"

Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/epy", line 11, in
load_entry_point('epy==2020.3.8', 'console_scripts', 'epy')()
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/epy.py", line 1213, in main
loadstate()
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/epy.py", line 523, in loadstate
STATE = json.load(f)
File "/data/data/com.termux/files/usr/lib/python3.8/json/init.py", line 293, in load
return loads(fp.read(),
File "/data/data/com.termux/files/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/data/data/com.termux/files/usr/lib/python3.8/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 12 column 9 (char 435)

Where is stored the bookmark file?

Hi,

I am looking into the possibility to read books cross devices, and therefore the possibility to export/import bookmarks from a device to another (without transferring the entire book every time).

I can see through your code that you store the bookmark with the function savestate(). That same function creates json.dump() in a file.

My question then, where is that file stored?

Note: I installed your CLI app through pypi.org/pip install, and use it entirely in CLI. In my search through my device file system, epy is compiled. I don't see any json file around.

So I guess my questions are as follow:

  • In Dev mode, where is the Json File stored?
  • In compiled mode, where is the bookmark/json file stored? Or is it accessible?
  • Is it in the pipelines to create some kind of "export my bookmarks" command? (If not, no worries, I'll find a way around)

Beside that query, I congratulate for a job well done!

"AttributeError: 'NoneType' object has no attribute 'group'" when asking for help on the commandline

FIle downloaded directly from the repo (since i have all the prerequisites installed), opened one epub without issues. Then tried this:

$ python3 epy.py -h
Traceback (most recent call last):
  File "epy.py", line 1279, in <module>
    main()
  File "epy.py", line 1183, in main
    hlp = re.search("(\n|.)*(?=\n\nKey)", hlp).group()
AttributeError: 'NoneType' object has no attribute 'group'

More strangely:

$ python3 epy.py --help
Usages:
    epy             read last epub
    epy EPUBFILE    read EPUBFILE
    epy STRINGS     read matched STRINGS from history
    epy NUMBER      read file from history
                    with associated NUMBER

Options:
    -r              print reading history
    -d              dump epub
    -h, --help      print short, long help

Short help breaks, log help gives short help.

Linux Mint 19.1, Python 3.6.9, in case it helps. I also installed epr so i imagine the short and long help are essentially the same, so it's not what you'd call "critical", but still :)

Copying text

Thanks for the great piece of software!

Is it possible to copy text? I can do that in epr, but it seems like in epy, I can only use the mouse for navigation. I prefer epy's features, but copying text is quite important for me.

Text justification

First of all i wanna say that i m grateful for that amazing program. I love doing as much as possible in terminal. But is it possible to justify text? Is there any way to this? Thx in advance, keep up the good job!

Startup color scheme

Hi, I like to read in dark or light color scheme. Currently there is a way to specify colors for the color schemes, but no way to select what color scheme to load while starting epy.

So, what I am asking for is a command like option --theme [dark|light] or a config option "Theme":"dark".

AttributeError for PROC_COUNTLETTERS.kill() in version 2020.4.24

Hi Wustho,

Nice that you have added the bookmark functionality! Neat feature! Also good to see that you are actively developing epy [and not only epr ;)] and willing to share your work!

For a possible future version I would suggest to adjust lines 660&661:

# PROC_COUNTLETTERS.terminate()
PROC_COUNTLETTERS.kill()

into

try:
    PROC_COUNTLETTERS.kill()
except AttributeError:
    PROC_COUNTLETTERS.terminate()

On my setup the first leads to attribute errors (perhaps there are some different versions of multiprocessing python package floating around?; I am using python 3.6.9 on ubuntu 18.04 b.t.w.). As far as I could judge the errors occur when the terminal area resizes. With the try-catch epy works again for me also when resizing the terminal. One could also instead use if hasattr(PROC_COUNTLETTERS,'kill') to get to a "get permission" methodology instead of the "ask forgiveness, not permission" philosophy of try-catch ...

Please feel free to ignore if you disagree ;)

Thanks again and with kind regards,
happy user

Feature request or bug fix - auto-save page number and random page

Hello,

I'm BM. A very nice and polite guy.

  1. Most of the times when I use epy it doesn't save my current page correctly. Let's say I'm on "page 33" (there are no pages but you know what I mean). Next time when I restart epy I am back on pack 20 again so I have to press the keybutton forward x times. Not sure why this is happening, probably a bug.

  2. Random page flag. It would be cool if epy could be opened with an -r flag to open a random page from an epub file. Feature request : )

TTS doesn't work with other languages than en_US

And frankly, Harry Potter fanfiction should be read in en_GB ;).

Also, would it be possible to switch to mimic. It is free (contrary to svox, which cannot go into most Linux distributions) and it has stdin-to-speech function, so no need to fiddle with temporary files. Difference in the pronunciation is minimal.

crash in the wrapper function

fanfiction@stitny$ epy elsewhere_at_hogwarts/Thursdays.epub
Traceback (most recent call last):
  File "/home/matej/.local/bin/epy", line 33, in <module>
    sys.exit(load_entry_point('epy-reader', 'console_scripts', 'epy')())
  File "/home/matej/archiv/knihovna/repos/tmp/epy/epy.py", line 3469, in main
    curses.wrapper(preread, filepath)
  File "/usr/lib64/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/matej/archiv/knihovna/repos/tmp/epy/epy.py", line 3326, in preread
    reading_state = reader.read(reading_state)
  File "/home/matej/archiv/knihovna/repos/tmp/epy/epy.py", line 2905, in read
    rettock, fllwd, _ = self.toc(toc_entries, ntoc)
  File "/home/matej/archiv/knihovna/repos/tmp/epy/epy.py", line 1740, in wrapper
    strs = "  " + i.replace("\n", " ")
AttributeError: 'NoneType' object has no attribute 'replace'
fanfiction@stitny$

Add command line option to send keys to epy on startup

Just like in vim, it would be nice to be able to send keys to epy on startup. An option like >>epy --keys "<Tab>gg" would open epy with contents page open, and cursor on the first contents line item.

If thats difficult, please add a command line option to specify start screen, >>epy -s contents would start epy and launch contents page (as if <Tab> was entered).

Feature Request - OPDS

Hi, I was just wondering if there were plans to support OPDS feeds in the future? If not then that's fine, the app is great as is 👍🏾

Highlight issue

why am I getting highlight in book, I tried turn it off but it seems no use.. and I can't find any tips on internet.
Screen Shot 2022-02-06 at 11 11 30 PM

Hang on viewing epub

Version: v2022.2.14

epy loads the epub file, but hangs after the first page.

Problem is in (734-754):

    def get_raw_text(self, content_path: Union[str, ET.Element]) -> str:
        assert isinstance(self.file, zipfile.ZipFile)
        assert isinstance(content_path, str)

        max_tries: Optional[int] = None  # 1 if DEBUG else None

        # use try-except block to catch
        # zlib.error: Error -3 while decompressing data: invalid distance too far back
        # seems like caused by multiprocessing
        tries = 0
        while True:
            try:
                content = self.file.open(content_path).read()
                break
            except Exception as e:
                tries += 1
                if max_tries is not None and tries >= max_tries:
                    raise e

        return content.decode("utf-8")

when it is passed a content_path with value: "OEBPS/../jacket.xhtml"

self.file.open(content_path) errors with There is no item named 'OEBPS/../jacket.xhtml' in the archive"
The try/except catches the error.
max_tries = None
The while loop never exits.

My quick fix has been to set max_tries = 2
and add:

content_path=os.path.relpath(content_path)
after the tries += 1 line.

Inline bold text not bold

So I'm positive that my terminal emulator and the font I'm using are capable of bold text, however, it does not appear that it's working in the book I'm reading:
Screenshot_2021-07-14_21-16-12

The headings show as bold, but text in the content body that's supposed to be bold is not showing as such. Is there something I'm missing?

Here's the source from that section if it helps:

<p>It’s not immediately clear how the prefix and mask work together to give you all possible IP addresses on a subnet. Looking at the numbers in binary form helps clear it up. The mask marks the bit locations in an IP address that are common to the subnet. For example, here are the binary forms of 10.23.2.0 and 255.255.255.0:</p>

<a id="pro_id00249"/><pre class="programlisting">10.23.2.0:        00001010 00010111 00000010 00000000
            255.255.255.0:    11111111 11111111 11111111 00000000</pre>

<p>Now, let’s use boldface to mark the bit locations in 10.23.2.0 that are 1s in 255.255.255.0:</p>

<a id="pro_id00250"/><pre class="programlisting">10.23.2.0:        <span class="strong"><strong>00001010 00010111 00000010</strong></span> 00000000</pre>

<p>Look at the bits that are <span class="emphasis"><em>not</em></span> in bold. You can set any number of these bits to 1 to get a valid IP address in this subnet, with the exception of all 0s or all 1s.</p>

<p>Putting it all together, you can see how a host with an IP address of 10.23.2.1 and a subnet mask of 255.255.255.0 is on the same subnet as any other computers that have IP addresses beginning with 10.23.2. You can denote this entire subnet as 10.23.2.0/255.255.255.0.</p>
</div>

<div class="sect2" title="9.3.3 Common Subnet Masks and CIDR Notation"><div class="titlepage"><div><div><h2 class="title"><a id="ninedot3dot3_common_subnet_masks_and_cid"/>9.3.3 Common Subnet Masks and CIDR Notation</h2></div>

EDIT: The epub does have some embedded fonts - both of which support bold text as well - however, those are overridden by whatever font is chosen by the terminal. I've also attempted to change my terminal font to those fonts (DejaVu and Ubuntu Mono), and there was no change

Error: module curses has no attribute A_ITALIC

When I open a epub or mobi, I get the following error. I have not updated epy in my other machine, this does not happen there. Am using the current version of pip3 while reporting this on my current machine.

❯ epy ~/Desktop/Books/Effective_Writing.epub
Traceback (most recent call last):
  File "/opt/homebrew/bin/epy", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 3358, in main
    curses.wrapper(preread, filepath)
  File "/opt/homebrew/Cellar/[email protected]/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 3215, in preread
    reading_state = reader.read(reading_state)
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 2501, in read
    text_structure = parse_html(
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 1407, in parse_html
    return parser.get_structured_text(textwidth, starting_line)
  File "/opt/homebrew/lib/python3.9/site-packages/epy.py", line 831, in get_structured_text
    attr=curses.A_ITALIC,
AttributeError: module 'curses' has no attribute 'A_ITALIC'

applaud and chapter progress proposal

Dear developer,

My apologies for posting an issue comment. I don't have an issue, but know of no another place to paste a general comment.

I have used epy.py for a while during Christmas last year and wanted to applaud you for this wonderful script. I am impressed! Very nice lightweight epub reader, indeed!

I agree with your comment that showing the progress in the book has added value. However, for me the progress within a chapter is also very useful, as chapter endings are natural places to pause reading. For myself I have therefore replaced this line of code:

PROGRESSTR = "{}%".format(int(PROGRESS*100))

with this one:

PROGRESSCHAPTER = sum(LOCALPCTG[:y+rows-1]) / float(sum(LOCALPCTG))
PROGRESSTR = "{}%/{}%".format(int(PROGRESSCHAPTER*100),int(PROGRESS*100))

I just wanted to post this comment here in case that the developers also may find the chapter progress a useful feature to have.

Thanks again for sharing your work.

With kind regards,
Grateful user

quote indentation

Hi wustho,

Once again I would like to congratulate you with this wonderful project. Very impressive indeed! For novels epy has by now become my principle epub reader ...

In addition it makes me very happy to see how actively you are maintaining it and adding new features with each release! The "bookmark" feature is a very valuable extension indeed (and I am fond of the dictionary search as well, although it is a bit older I believe)!

On another note: recently I stumbled upon the following code:

<p>paragraph1</p>
<blockquote class="calibre24">
<p>quote1<br class="calibre13"/>quote2</p>
</blockquote>
<p>paragraph2</p>
<p>paragraph3</p>

This is rendered as follows by epy:

paragraph1

    quote1

    quote2

    paragraph2

paragraph3

As can be seen also paragraph2 appears indented. I suppose this is the consequence of the use of the paragraph tag <p> inside the body of the blockquote tag, which results in an additional pass through HTMLtoLines.handle_data(), which in turn appends an extra incremental value to self.idinde that in the final rendering corresponds to the position of paragraph2. To me the easiest solution for this example seems to be to update self.idinde only when the tag encloses actual content, i.e. inside handle_data using:

    elif self.isinde and line:
        self.idinde.add(len(self.text)-1)

With the additional conditional on line the result was rendered as desired (for this example):

paragraph1

    quote1

    quote2

paragraph2

paragraph3

This is a tiny non-essential change, but perhaps you may like to take it along in some future update anyway.

Please feel free to ignore this post if you disagree or if you have a better solution ;)

Cheers,
Happy user

When resizing the terminal window, epy crashed

WIth this backtrace:

stitny~/b/i/h/python-numpy.SUSE_SLE-15_Update ()$ epy /home/matej/Knihy/fanfiction/elsewhere_at_hogwarts/What\'s\ Her\ Name\ in\ Hufflepuff-ao3_22283053.epub
Traceback (most recent call last):
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 1498, in update_library
    metadata = ebook.get_meta()
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 601, in get_meta
    content_opf = ET.parse(self.file.open(self.root_filepath))
  File "/usr/lib64/python3.8/zipfile.py", line 1535, in open
    raise BadZipFile("Bad magic number for file header")
zipfile.BadZipFile: Bad magic number for file header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matej/.bin/epy", line 33, in <module>
    sys.exit(load_entry_point('epy-reader', 'console_scripts', 'epy')())
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 3982, in main
    filepath = curses.wrapper(preread, filepath)
  File "/usr/lib64/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 3881, in preread
    reading_state_or_ebook = reader.read(reading_state)
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 3729, in read
    self.savestate(
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 2974, in savestate
    self.state.update_library(self.ebook, self.reading_progress)
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 1509, in update_library
    conn.close()
UnboundLocalError: local variable 'conn' referenced before assignment                                                                                                                            

Invalid search regex crashes the program with a traceback

I've accidentally hit enter after /? and the program crashed with the following traceback:

Traceback (most recent call last):
  File "/usr/bin/epy", line 11, in <module>
    load_entry_point('epy==2020.4.17', 'console_scripts', 'epy')()
  File "/usr/lib64/python3.7/site-packages/epy.py", line 1437, in main
    curses.wrapper(preread, file)
  File "/usr/lib64/python3.7/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib64/python3.7/site-packages/epy.py", line 1336, in preread
    ebook, idx, width, y, pctg, sec
  File "/usr/lib64/python3.7/site-packages/epy.py", line 1159, in reader
    index, len(contents)
  File "/usr/lib64/python3.7/site-packages/epy.py", line 832, in searching
    pattern = re.compile(SEARCHPATTERN[1:], re.IGNORECASE)
  File "/usr/lib64/python3.7/re.py", line 234, in compile
    return _compile(pattern, flags)
  File "/usr/lib64/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib64/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib64/python3.7/sre_parse.py", line 930, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib64/python3.7/sre_parse.py", line 426, in _parse_sub
    not nested and not items))
  File "/usr/lib64/python3.7/sre_parse.py", line 651, in _parse
    source.tell() - here + len(this))
re.error: nothing to repeat at position 0

You should probably catch this exception and instead display a relevant error message about an invalid regexp search string.

It's not a critical bug, yet epy seems to lose the current position in the file when crashing like that. Without looking at the code, I can assume it only saves position when exitting gracefully.

epy crashes sometimes when attempting to scroll using keyboard on the end of the chapter

When viewing the second to last chapter from this epub: https://archiveofourown.org/downloads/32751484/Game%20Night.epub?updated_at=1643035440

Alternatively click download -> epub here: https://archiveofourown.org/works/32751484/chapters/91378543?view_adult=true

Epy crashes sometimes when attempting to scroll down at the end of the chapter with the following traceback:

Traceback (most recent call last):
  File "/usr/bin/epy", line 33, in <module>
    sys.exit(load_entry_point('epy-reader==2022.1.23', 'console_scripts', 'epy')())
  File "/usr/lib/python3.10/site-packages/epy.py", line 3971, in main
    filepath = curses.wrapper(preread, filepath)
  File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib/python3.10/site-packages/epy.py", line 3869, in preread
    reading_state_or_ebook = reader.read(reading_state)
  File "/usr/lib/python3.10/site-packages/epy.py", line 3783, in read
    board.write(reading_state.row)
  File "/usr/lib/python3.10/site-packages/epy.py", line 1706, in write
    text_line = self.text[row + n_row]
IndexError: tuple index out of range

Other info:

$ epy --version
v2022.1.23

Hourglass instead of opening epub

I had epy installed previously and didn't have this problem, but since I powerwashed my Chromebook and re-installed epy, all I get when trying to open epubs is this:

image

and then, when I crash the program with ctrl+c, I get this error message:
image
so, apparently my error is this:
Keyerror: 'there is no item named 'OEBPS/../titlepage.xhtml' in the archive'

Any ideas?

P.S.: Thanks and congrats on the program! It's literally a sight for my sore eyes.

[Resolved] Large Epub

Hello, whenever I open a relatively large epub file, the most current is Linux Command Line and Shell Scripting Bible, I receive an error and and forced to use another epub reader such as Thorium. I have received it for War and Piece in the past as well. I am prevented from scrolling beyond a range of pages.

Error code:Traceback (most recent call last): File "/usr/bin/epy", line 33, in <module> sys.exit(load_entry_point('epy-reader==2021.4.5', 'console_scripts', 'epy')()) File "/usr/lib/python3.9/site-packages/epy.py", line 2246, in main curses.wrapper(preread, file) File "/usr/lib/python3.9/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) File "/usr/lib/python3.9/site-packages/epy.py", line 2126, in preread incr, width, y, pctg, sec = reader( File "/usr/lib/python3.9/site-packages/epy.py", line 1648, in reader src_lines, imgs, toc_secid, formatting = parser.get_lines(width) File "/usr/lib/python3.9/site-packages/epy.py", line 560, in get_lines if i[0] == i[2]: IndexError: list index out of range

Is this due to the ebook version I am using or am I able to bypass this error with some minor adjustment?

Thank you for your help, and your application has been excellent so far.
Is there any place where I can donate?

Regex search - encoding issue

Regex searching does not work with russian (most likely not only with russian) keyboard layout:
screenshot-2021-08-14-14:23:40
everything else works perfect and i really want to use THIS book reader

Can't install

I'm on Linux. When I try to install with pip3, it throws a syntax error:

File "/tmp/pip-req-build-xh4bvalo/epy.py", line 1113 PROGRESSTR = f"{int(PROGRESS*100)}%"

Full error:
ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-xh4bvalo/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-xh4bvalo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-xh4bvalo/pip-egg-info cwd: /tmp/pip-req-build-xh4bvalo/ Complete output (8 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-req-build-xh4bvalo/setup.py", line 3, in <module> from epy import __version__, __author__, __url__, __license__ File "/tmp/pip-req-build-xh4bvalo/epy.py", line 1113 PROGRESSTR = f"{int(PROGRESS*100)}%" ^ SyntaxError: invalid syntax ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Git tags for releases

I am currently creating an Alpine package for epr, and would like to do the same for epy. This will require making a package for mobi first, so I already made a similar issue on their repo. The distro's maintainers are not really fond of just building a package from a Git commit reference directly, and would definitely prefer the usual Git tags to denote releases. This allows the package to download the contents of the repo at a specific tag, making it clear which exact version we are downloading, and preventing me from picking for example the wrong commit for a specific version and causing a mess.

Another nice advantage of using Git tags is that it is possible to use the Atom feed GitHub provides for releases to be notified of releases; that way, I know when you make a release, and I can upgrade the package accordingly.

I guess adding a git tag to the .mkpkg file could help with automating this. In the meantime, you can just create a git tag for the last version that was built and sent on PyPI and that would be enough to get me started with the packaging.

This issue combined with the mobi issue could help get Arch users unstuck as well (#41), and the added Git tags can also help them get a epy package, not a epy-git, which could be more stable.

add support for .prc files

.prc files seems to be same as .mobi and can be supported by adding 2 lines in code in det_ebook_cls(file): segment

    elif MOBISUPPORT and filext == ".prc":
        return Mobi(file)

crashed for read epub

的人容易疏远,所以察选人才者经常被而忘记了考察他的品德。自古至今,国家的乱臣奸佞,家族的败家浪子,因为才有余而德不足,导致家国覆亡的多了,又何止 瑶呢!所以治国治家者如果能审察才与 no attribute 'close'
Traceback (most recent call last):
File "/usr/local/bin/epy", line 11, in
load_entry_point('epy-reader==2022.3.25', 'console_scripts', 'epy')()
File "/usr/local/lib/python3.6/site-packages/epy_reader-2022.3.25-py3.6.egg/epy.py", line 3987, in main
filepath = curses.wrapper(preread, filepath)
File "/usr/lib64/python3.6/curses/init.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python3.6/site-packages/epy_reader-2022.3.25-py3.6.egg/epy.py", line 3886, in preread
reading_state_or_ebook = reader.read(reading_state)
File "/usr/local/lib/python3.6/site-packages/epy_reader-2022.3.25-py3.6.egg/epy.py", line 3792, in read
self.try_assign_letters_count()
File "/usr/local/lib/python3.6/site-packages/epy_reader-2022.3.25-py3.6.egg/epy.py", line 2448, in try_assign_letters_count
self._process_counting_letter.close()
AttributeError: 'Process' object has no attribute 'close'

env: Centos 7, Python 3.6.8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.