epub2txt


Nameepub2txt JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/ffreemt/epub2txt
SummaryConvert epub to txt with additonal utils
upload_time2023-06-12 07:51:37
maintainer
docs_urlNone
authorfreemt
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ffreemt/epub2txt",
    "name": "epub2txt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "freemt",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c6/fb/f23228c10ae6675ec5e92b692c45ec504403dee9e7e3a765eb4bb5d46bd7/epub2txt-0.1.6.tar.gz",
    "platform": null,
    "description": "# 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)\n\nConvert epub to txt with additonal utils\n\n<!--- Refer to dualtext-epub\\der_fanger_de_en.py\n\t\t__main__.py refer to tmx2epub.__main__\n--->\n\n## Installation\n\n```bash\npip install epub2txt\n# pip install epub2txt -U  # to upgrade\n```\n## Fixes\n* More resilent to mismatched tags\n* Added `epub2txt.content_titles`, useful for creating metada when needed\n\n## Usage\n\n### From command line\n\n```bash\n# convert test.epub to test.txt\nepub2txt -f test.epub\n\n# browse for epub file, txt file will be in the same directory as the epub file\nepub2txt\n\n# show epub book info: title and toc\nepub2txt -i\n\n# show more epub book info: title, toc, metadata, spine (list of stuff packed into the epub)\nepub2txt -m\n\n# show epub2txt version\nepub2txt -V\n\n```\n\n### `python` code\n\n```python\nfrom epub2txt import epub2txt\n# from a url to epub\nurl = \"https://github.com/ffreemt/tmx2epub/raw/master/tests/1.tmx.epub\"\nres = epub2txt(url)\n\n# from a local epub file\nfilepath = r\"tests\\test.epub\"\nres = epub2txt(filepath)\n\n# output as a list of chapters\nch_list = epub2txt(filepath, outputlist=True)\n# chapter titles will be available as epub2txt.content_titles if available\n\n```\n\n## TODO\n*   Batch conversion of several epub files\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Convert epub to txt with additonal utils",
    "version": "0.1.6",
    "project_urls": {
        "Homepage": "https://github.com/ffreemt/epub2txt",
        "Repository": "https://github.com/ffreemt/epub2txt"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cdb24ff4b0f2d7d3382ee8b258c3633ef8b6e8228e0b8c3e61eaba14f3584f66",
                "md5": "ed68fb11323ace301094eda8e093fc55",
                "sha256": "d7af37cc261afe5d841d4e418f9da2903a0fdf44ba1800d74d850471caa4a0b6"
            },
            "downloads": -1,
            "filename": "epub2txt-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed68fb11323ace301094eda8e093fc55",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 8102,
            "upload_time": "2023-06-12T07:51:35",
            "upload_time_iso_8601": "2023-06-12T07:51:35.384412Z",
            "url": "https://files.pythonhosted.org/packages/cd/b2/4ff4b0f2d7d3382ee8b258c3633ef8b6e8228e0b8c3e61eaba14f3584f66/epub2txt-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c6fbf23228c10ae6675ec5e92b692c45ec504403dee9e7e3a765eb4bb5d46bd7",
                "md5": "8acfa2155b800153f99b802d1f3f5f9c",
                "sha256": "7012199839982c01d02ed8b527311465004d8275cc894ae0597bb0d4ccac65f8"
            },
            "downloads": -1,
            "filename": "epub2txt-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "8acfa2155b800153f99b802d1f3f5f9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 7122,
            "upload_time": "2023-06-12T07:51:37",
            "upload_time_iso_8601": "2023-06-12T07:51:37.587387Z",
            "url": "https://files.pythonhosted.org/packages/c6/fb/f23228c10ae6675ec5e92b692c45ec504403dee9e7e3a765eb4bb5d46bd7/epub2txt-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-12 07:51:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ffreemt",
    "github_project": "epub2txt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "epub2txt"
}
        
Elapsed time: 0.19283s