Metadata-Version: 2.1
Name: epub2txt
Version: 0.1.6
Summary: Convert epub to txt with additonal utils
Home-page: https://github.com/ffreemt/epub2txt
License: MIT
Author: freemt
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: absl-py (>=0.11.0,<0.12.0)
Requires-Dist: ebooklib (>=0.17.1,<0.18.0)
Requires-Dist: httpx
Requires-Dist: logzero (>=1.6.3,<2.0.0)
Requires-Dist: tqdm (>=4.56.0,<5.0.0)
Project-URL: Repository, https://github.com/ffreemt/epub2txt
Description-Content-Type: text/markdown

# epub2txt [![Codacy Badge](https://app.codacy.com/project/badge/Grade/05c422da73a14c23b87b0657af9c8df7)](https://www.codacy.com/gh/ffreemt/epub2txt/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ffreemt/epub2txt&amp;utm_campaign=Badge_Grade)[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)[![PyPI version](https://badge.fury.io/py/epub2txt.svg)](https://badge.fury.io/py/epub2txt)

Convert epub to txt with additonal utils

<!--- Refer to dualtext-epub\der_fanger_de_en.py
		__main__.py refer to tmx2epub.__main__
--->

## Installation

```bash
pip install epub2txt
# pip install epub2txt -U  # to upgrade
```
## Fixes
* More resilent to mismatched tags
* Added `epub2txt.content_titles`, useful for creating metada when needed

## Usage

### From command line

```bash
# convert test.epub to test.txt
epub2txt -f test.epub

# browse for epub file, txt file will be in the same directory as the epub file
epub2txt

# show epub book info: title and toc
epub2txt -i

# show more epub book info: title, toc, metadata, spine (list of stuff packed into the epub)
epub2txt -m

# show epub2txt version
epub2txt -V

```

### `python` code

```python
from epub2txt import epub2txt
# from a url to epub
url = "https://github.com/ffreemt/tmx2epub/raw/master/tests/1.tmx.epub"
res = epub2txt(url)

# from a local epub file
filepath = r"tests\test.epub"
res = epub2txt(filepath)

# output as a list of chapters
ch_list = epub2txt(filepath, outputlist=True)
# chapter titles will be available as epub2txt.content_titles if available

```

## TODO
*   Batch conversion of several epub files


