Skip to main content

Convert epub to txt with additonal utils

Project description

epub2txt Codacy BadgeCode style: blackLicense: MITPyPI version

Convert epub to txt with additonal utils

Installation

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

# 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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epub2txt-0.1.4.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

epub2txt-0.1.4-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file epub2txt-0.1.4.tar.gz.

File metadata

  • Download URL: epub2txt-0.1.4.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.10 Windows/10

File hashes

Hashes for epub2txt-0.1.4.tar.gz
Algorithm Hash digest
SHA256 63a34b73444084a92a98df088128e7dcc88150d7a67b196f9cc3444aba056474
MD5 8e175a0054710c565bad9f28d1f28ba6
BLAKE2b-256 88fe67fb7d4028fd123fb5fb6cf9b746121eca656a8f6933082734b3518c59ad

See more details on using hashes here.

File details

Details for the file epub2txt-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: epub2txt-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.10 Windows/10

File hashes

Hashes for epub2txt-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c3e558e1fafe29854aec2bb8a1814840473a73ac5e10adde3797cc6858314c36
MD5 6c8a8df5772a48537bb29d8d95a0a7e3
BLAKE2b-256 634632c655eda7c572a9e89b2c0136fc27903b02cb8ecc67c3ab08cc8266d321

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page