baca


Namebaca JSON
Version 0.1.16 PyPI version JSON
download
home_page
SummaryTUI Ebook Reader
upload_time2023-06-08 09:53:48
maintainer
docs_urlNone
authorBenawi Adha
requires_python>=3.10,<4.0
licenseGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `baca`: TUI E-book Reader

![baca_screenshots](https://github.com/wustho/baca/assets/43810055/82d5beb0-d061-4e4c-82ed-a3bd84074d2f)

Meet `baca`, [epy](https://github.com/wustho/epy)'s lovely sister who lets you indulge
in your favorite e-books in the comfort of your terminal.
But with a sleek and contemporary appearance that's sure to captivate you!

## Features

- Formats supported: Epub, Epub3, Mobi & Azw
- Remembers last reading position
- Show images as ANSI image & you can click it for more detail
- Scroll animations
- Clean & modern looks
- Text justification
- Dark & light color scheme
- Regex search
- Hyperlinks

## Requirements

- `python>=3.10`

## Installation

- Via pip: `pip install baca`
- Via git: `pip install git+https://github.com/wustho/baca`
- Via AUR: `yay -S baca-ereader-git`

## Usage

```sh
# to read an ebook
baca path/to/your/ebook.epub

# to read your last read ebook, just run baca without any argument
baca

# to see your reading history use -r as an argument
baca -r

# say you want to read an ebook from your reading history,
# but you forgot the path to your ebook
# just type any words you remember about your ebook
# and baca will try to match it to path or title+author
baca doc ebook.epub
baca alice wonder lewis carroll
```

## Opening an Image

To open an image, when you encounter an ANSI image (when `ShowImageAsANSI=yes`) or some thing like this
(if `ShowImageAsANSI=no`):

```
┌──────────────────────────────────────────────────────────────────────────────┐
│                                    IMAGE                                     │
└──────────────────────────────────────────────────────────────────────────────┘
```

just click on it using mouse and it will open the image using system app.
Yeah, I know you want to use keyboard for this, me too, but bear with this for now.

> "Why show the images as ANSI images instead of render it directly on terminal like ranger does?"

1. The main reason is that currently, rendering images directly on the terminal
   doesn't allow for partial scrolling of the image.
   This means that we can't display only a portion (e.g., 30%) of the image when scrolling,
   resulting in a broken and non-seamless scrolling experience.

2. My primary intention in developing this app is for reading fiction e-books rather than technical ones,
   and most fiction e-books don't contain many images.

3. Displaying images on the terminal requires different implementations for various terminal emulators,
   which requires a lot of maintenance.

## Configurations

![pretty_yes_no_cap](https://user-images.githubusercontent.com/43810055/228417623-ac78fb84-0ee0-4930-a843-752ef693822d.png)

Configuration file available at `~/.config/baca/config.ini` for linux users. Here is the default:

```ini
[General]
# pick your favorite image viewer
PreferredImageViewer = auto

# int or css value string like 90%%
# (escape percent with double percent %%)
MaxTextWidth = 80

# 'justify', 'center', 'left', 'right'
TextJustification = justify

# currently using pretty=yes is slow
# and taking huge amount of memory
Pretty = no

PageScrollDuration = 0.2

# either show image as ansii image
# or text 'IMAGE' as a placehoder
# (showing ansii image will affect
# performance & resource usage)
ShowImageAsANSII = yes

[Color Dark]
Background = #1e1e1e
Foreground = #f5f5f5
Accent = #0178d4

[Color Light]
Background = #f5f5f5
Foreground = #1e1e1e
Accent = #0178d4

[Keymaps]
ToggleLightDark = c
ScrollDown = down,j
ScrollUp = up,k
PageDown = ctrl+f,pagedown,l,space
PageUp = ctrl+b,pageup,h
Home = home,g
End = end,G
OpenToc = tab
OpenMetadata = M
OpenHelp = f1
SearchForward = slash
SearchBackward = question_mark
NextMatch = n
PreviousMatch = N
Confirm = enter
CloseOrQuit = q,escape
Screenshot = f12
```

## Known Limitations

- When searching for specific phrases in `baca`,
  keep in mind that it may not be able to find them if they span across two lines,
  much like in the search behavior of editor vi(m).

  For example, `baca` won't be able to find the phrase `"for it"` because it is split into two lines
  in this example.

  ```
  ...
  she had forgotten the little golden key, and when she went back to the table for
  it, she found she could not possibly reach it: she could see  it  quite  plainly
  ...
  ```


  Additionally, `baca` may struggle to locate certain phrases due to adjustments made for text justification.
  See the example above, `"see_it"` may become `"see__it"` due to adjusted spacing between words.
  In this case, it may be more effective to use a regex search for `"see +it"` or simply search for the word `"see"` alone.

  Overall, `baca`'s search feature is most effective for locating individual words
  rather than phrases that may be split across multiple lines or impacted by text justification.

- Compared to [epy](https://github.com/wustho/epy), currently `baca` has some missing features.
  But these are planned to be implemented to `baca` in the near future:

  - [ ] **TODO** Bookmarks
  - [ ] **TODO** FictionBook support
  - [ ] **TODO** URL reading support

## Credits

- Thanks to awesome [Textual Project](https://github.com/Textualize/textual)
- [Kindle Unpack](https://github.com/kevinhendricks/KindleUnpack)
- And many others!

## License

GPL-3


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "baca",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Benawi Adha",
    "author_email": "benawiadha@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/22/24/1ac614b9a76e4b1b2182101fec302db86462ecc204c5e17997eb26f92b7d/baca-0.1.16.tar.gz",
    "platform": null,
    "description": "# `baca`: TUI E-book Reader\n\n![baca_screenshots](https://github.com/wustho/baca/assets/43810055/82d5beb0-d061-4e4c-82ed-a3bd84074d2f)\n\nMeet `baca`, [epy](https://github.com/wustho/epy)'s lovely sister who lets you indulge\nin your favorite e-books in the comfort of your terminal.\nBut with a sleek and contemporary appearance that's sure to captivate you!\n\n## Features\n\n- Formats supported: Epub, Epub3, Mobi & Azw\n- Remembers last reading position\n- Show images as ANSI image & you can click it for more detail\n- Scroll animations\n- Clean & modern looks\n- Text justification\n- Dark & light color scheme\n- Regex search\n- Hyperlinks\n\n## Requirements\n\n- `python>=3.10`\n\n## Installation\n\n- Via pip: `pip install baca`\n- Via git: `pip install git+https://github.com/wustho/baca`\n- Via AUR: `yay -S baca-ereader-git`\n\n## Usage\n\n```sh\n# to read an ebook\nbaca path/to/your/ebook.epub\n\n# to read your last read ebook, just run baca without any argument\nbaca\n\n# to see your reading history use -r as an argument\nbaca -r\n\n# say you want to read an ebook from your reading history,\n# but you forgot the path to your ebook\n# just type any words you remember about your ebook\n# and baca will try to match it to path or title+author\nbaca doc ebook.epub\nbaca alice wonder lewis carroll\n```\n\n## Opening an Image\n\nTo open an image, when you encounter an ANSI image (when `ShowImageAsANSI=yes`) or some thing like this\n(if `ShowImageAsANSI=no`):\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                                    IMAGE                                     \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\njust click on it using mouse and it will open the image using system app.\nYeah, I know you want to use keyboard for this, me too, but bear with this for now.\n\n> \"Why show the images as ANSI images instead of render it directly on terminal like ranger does?\"\n\n1. The main reason is that currently, rendering images directly on the terminal\n   doesn't allow for partial scrolling of the image.\n   This means that we can't display only a portion (e.g., 30%) of the image when scrolling,\n   resulting in a broken and non-seamless scrolling experience.\n\n2. My primary intention in developing this app is for reading fiction e-books rather than technical ones,\n   and most fiction e-books don't contain many images.\n\n3. Displaying images on the terminal requires different implementations for various terminal emulators,\n   which requires a lot of maintenance.\n\n## Configurations\n\n![pretty_yes_no_cap](https://user-images.githubusercontent.com/43810055/228417623-ac78fb84-0ee0-4930-a843-752ef693822d.png)\n\nConfiguration file available at `~/.config/baca/config.ini` for linux users. Here is the default:\n\n```ini\n[General]\n# pick your favorite image viewer\nPreferredImageViewer = auto\n\n# int or css value string like 90%%\n# (escape percent with double percent %%)\nMaxTextWidth = 80\n\n# 'justify', 'center', 'left', 'right'\nTextJustification = justify\n\n# currently using pretty=yes is slow\n# and taking huge amount of memory\nPretty = no\n\nPageScrollDuration = 0.2\n\n# either show image as ansii image\n# or text 'IMAGE' as a placehoder\n# (showing ansii image will affect\n# performance & resource usage)\nShowImageAsANSII = yes\n\n[Color Dark]\nBackground = #1e1e1e\nForeground = #f5f5f5\nAccent = #0178d4\n\n[Color Light]\nBackground = #f5f5f5\nForeground = #1e1e1e\nAccent = #0178d4\n\n[Keymaps]\nToggleLightDark = c\nScrollDown = down,j\nScrollUp = up,k\nPageDown = ctrl+f,pagedown,l,space\nPageUp = ctrl+b,pageup,h\nHome = home,g\nEnd = end,G\nOpenToc = tab\nOpenMetadata = M\nOpenHelp = f1\nSearchForward = slash\nSearchBackward = question_mark\nNextMatch = n\nPreviousMatch = N\nConfirm = enter\nCloseOrQuit = q,escape\nScreenshot = f12\n```\n\n## Known Limitations\n\n- When searching for specific phrases in `baca`,\n  keep in mind that it may not be able to find them if they span across two lines,\n  much like in the search behavior of editor vi(m).\n\n  For example, `baca` won't be able to find the phrase `\"for it\"` because it is split into two lines\n  in this example.\n\n  ```\n  ...\n  she had forgotten the little golden key, and when she went back to the table for\n  it, she found she could not possibly reach it: she could see  it  quite  plainly\n  ...\n  ```\n\n\n  Additionally, `baca` may struggle to locate certain phrases due to adjustments made for text justification.\n  See the example above, `\"see_it\"` may become `\"see__it\"` due to adjusted spacing between words.\n  In this case, it may be more effective to use a regex search for `\"see +it\"` or simply search for the word `\"see\"` alone.\n\n  Overall, `baca`'s search feature is most effective for locating individual words\n  rather than phrases that may be split across multiple lines or impacted by text justification.\n\n- Compared to [epy](https://github.com/wustho/epy), currently `baca` has some missing features.\n  But these are planned to be implemented to `baca` in the near future:\n\n  - [ ] **TODO** Bookmarks\n  - [ ] **TODO** FictionBook support\n  - [ ] **TODO** URL reading support\n\n## Credits\n\n- Thanks to awesome [Textual Project](https://github.com/Textualize/textual)\n- [Kindle Unpack](https://github.com/kevinhendricks/KindleUnpack)\n- And many others!\n\n## License\n\nGPL-3\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "TUI Ebook Reader",
    "version": "0.1.16",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca603d0eea00748810e061e19bd1e0fd11fd80cbb4100d9bac6a1b8f93da8502",
                "md5": "e617fb238e6356c9c3f4c9ccd255f8e4",
                "sha256": "ffc1815500f5e90499e912e65d648d72a4173f84f30229edd4d672240a7b0076"
            },
            "downloads": -1,
            "filename": "baca-0.1.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e617fb238e6356c9c3f4c9ccd255f8e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 126784,
            "upload_time": "2023-06-08T09:53:45",
            "upload_time_iso_8601": "2023-06-08T09:53:45.077315Z",
            "url": "https://files.pythonhosted.org/packages/ca/60/3d0eea00748810e061e19bd1e0fd11fd80cbb4100d9bac6a1b8f93da8502/baca-0.1.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22241ac614b9a76e4b1b2182101fec302db86462ecc204c5e17997eb26f92b7d",
                "md5": "4109729019cb52195a04231f5f2607a1",
                "sha256": "3488746ebf6bab1eb611a715da24a120c620b35fd15d49ba9ecc33965b95001e"
            },
            "downloads": -1,
            "filename": "baca-0.1.16.tar.gz",
            "has_sig": false,
            "md5_digest": "4109729019cb52195a04231f5f2607a1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 111744,
            "upload_time": "2023-06-08T09:53:48",
            "upload_time_iso_8601": "2023-06-08T09:53:48.462323Z",
            "url": "https://files.pythonhosted.org/packages/22/24/1ac614b9a76e4b1b2182101fec302db86462ecc204c5e17997eb26f92b7d/baca-0.1.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-08 09:53:48",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "baca"
}
        
Elapsed time: 0.19419s