# txt2ebook
Console tool to convert txt file to different ebook format.
## Installation
Stable version From PyPI:
```console
python3 -m pip install txt2ebook
```
Latest development version from GitHub:
```console
python3 -m pip install -e git+https://github.com/kianmeng/txt2ebook.git
```
## Usage
Showing help message of command-line options:
```console
txt2ebook --help
```
```console
usage: txt2ebook [-f {epub,txt}] [-t TITLE] [-l LANGUAGE] [-a AUTHOR]
[-c IMAGE_FILENAME] [-w WIDTH] [-ps SEPARATOR] [-rd REGEX]
[-rvc REGEX] [-rv REGEX] [-rc REGEX] [-rt REGEX] [-ra REGEX]
[-rl REGEX] [-rr REGEX REGEX] [-et {clean,noindent,condense}]
[-vp] [-tp] [-sp] [-toc] [-hn] [-fw] [-rw] [-ow] [-v] [-d]
[-h] [-V]
TXT_FILENAME [EBOOK_FILENAME]
txt2ebook/tte is a cli tool to convert txt file to ebook format.
website: https://github.com/kianmeng/txt2ebook
issues: https://github.com/kianmeng/txt2ebook/issues
positional arguments:
TXT_FILENAME
source text filename
EBOOK_FILENAME
converted ebook filename (default: 'TXT_FILENAME.epub')
optional arguments:
-f {epub,txt}, --format {epub,txt}
ebook format (default: 'epub')
-t TITLE, --title TITLE
title of the ebook (default: 'None')
-l LANGUAGE, --language LANGUAGE
language of the ebook (default: 'None')
-a AUTHOR, --author AUTHOR
author of the ebook (default: '[]')
-ps SEPARATOR, --paragraph_separator SEPARATOR
paragraph separator (default: '\n\n')
-rd REGEX, --regex-delete REGEX
regex to delete word or phrase (default: '[]')
-rvc REGEX, --regex-volume-chapter REGEX
regex to parse volume and chapter header (default: by LANGUAGE)
-rv REGEX, --regex-volume REGEX
regex to parse volume header (default: by LANGUAGE)
-rc REGEX, --regex-chapter REGEX
regex to parse chapter header (default: by LANGUAGE)
-rt REGEX, --regex-title REGEX
regex to parse title of the book (default: by LANGUAGE)
-ra REGEX, --regex-author REGEX
regex to parse author of the book (default: by LANGUAGE)
-rl REGEX, --regex-delete-line REGEX
regex to delete whole line (default: '[]')
-rr REGEX REGEX, --regex-replace REGEX REGEX
regex to search and replace (default: '[]')
-tp, --test-parsing
test parsing for volume/chapter header
-rw, --raise-on-warning
raise exception and stop parsing upon warning
-ow, --overwrite
overwrite massaged TXT_FILENAME
-v, --verbose
show verbosity of debugging log, use -vv, -vvv for more details
-d, --debug
show debugging log and stacktrace
-h, --help
show this help message and exit
-V, --version
show program's version number and exit
--format epub:
-c IMAGE_FILENAME, --cover IMAGE_FILENAME
cover of the ebook
-et {clean,noindent,condense}, --epub-template {clean,noindent,condense}
CSS template for epub ebook (default: 'clean')
-vp, --volume-page
generate each volume as separate page
--format txt:
-w WIDTH, --width WIDTH
width for line wrapping
-sp, --split-volume-and-chapter
split volume or chapter into separate file and ignore the --overwrite option
-toc, --table-of-content
add table of content
--language zh-cn / --language zh-tw:
-hn, --header-number
convert section header from words to numbers
-fw, --fullwidth
convert ASCII character from halfwidth to fullwidth
```
Convert a txt file into epub:
```console
txt2book ebook.txt
```
## Copyright and License
Copyright (c) 2021,2022,2023 Kian-Meng Ang
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>.
Raw data
{
"_id": null,
"home_page": "https://github.com/kianmeng/txt2ebook",
"name": "txt2ebook",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "txt,ebook,epub,cjk",
"author": "Kian-Meng Ang",
"author_email": "kianmeng@cpan.org",
"download_url": "https://files.pythonhosted.org/packages/c8/6d/95f95ad9ac28618b049995c112cdeaa8c951eedb355a04c22ee19fe21a36/txt2ebook-0.1.28.tar.gz",
"platform": null,
"description": "# txt2ebook\n\nConsole tool to convert txt file to different ebook format.\n\n## Installation\n\nStable version From PyPI:\n\n```console\npython3 -m pip install txt2ebook\n```\n\nLatest development version from GitHub:\n\n```console\npython3 -m pip install -e git+https://github.com/kianmeng/txt2ebook.git\n```\n\n## Usage\n\nShowing help message of command-line options:\n\n```console\ntxt2ebook --help\n```\n\n```console\nusage: txt2ebook [-f {epub,txt}] [-t TITLE] [-l LANGUAGE] [-a AUTHOR]\n [-c IMAGE_FILENAME] [-w WIDTH] [-ps SEPARATOR] [-rd REGEX]\n [-rvc REGEX] [-rv REGEX] [-rc REGEX] [-rt REGEX] [-ra REGEX]\n [-rl REGEX] [-rr REGEX REGEX] [-et {clean,noindent,condense}]\n [-vp] [-tp] [-sp] [-toc] [-hn] [-fw] [-rw] [-ow] [-v] [-d]\n [-h] [-V]\n TXT_FILENAME [EBOOK_FILENAME]\n\ntxt2ebook/tte is a cli tool to convert txt file to ebook format.\n website: https://github.com/kianmeng/txt2ebook\n issues: https://github.com/kianmeng/txt2ebook/issues\n\npositional arguments:\n TXT_FILENAME\n source text filename\n EBOOK_FILENAME\n converted ebook filename (default: 'TXT_FILENAME.epub')\n\noptional arguments:\n -f {epub,txt}, --format {epub,txt}\n ebook format (default: 'epub')\n -t TITLE, --title TITLE\n title of the ebook (default: 'None')\n -l LANGUAGE, --language LANGUAGE\n language of the ebook (default: 'None')\n -a AUTHOR, --author AUTHOR\n author of the ebook (default: '[]')\n -ps SEPARATOR, --paragraph_separator SEPARATOR\n paragraph separator (default: '\\n\\n')\n -rd REGEX, --regex-delete REGEX\n regex to delete word or phrase (default: '[]')\n -rvc REGEX, --regex-volume-chapter REGEX\n regex to parse volume and chapter header (default: by LANGUAGE)\n -rv REGEX, --regex-volume REGEX\n regex to parse volume header (default: by LANGUAGE)\n -rc REGEX, --regex-chapter REGEX\n regex to parse chapter header (default: by LANGUAGE)\n -rt REGEX, --regex-title REGEX\n regex to parse title of the book (default: by LANGUAGE)\n -ra REGEX, --regex-author REGEX\n regex to parse author of the book (default: by LANGUAGE)\n -rl REGEX, --regex-delete-line REGEX\n regex to delete whole line (default: '[]')\n -rr REGEX REGEX, --regex-replace REGEX REGEX\n regex to search and replace (default: '[]')\n -tp, --test-parsing\n test parsing for volume/chapter header\n -rw, --raise-on-warning\n raise exception and stop parsing upon warning\n -ow, --overwrite\n overwrite massaged TXT_FILENAME\n -v, --verbose\n show verbosity of debugging log, use -vv, -vvv for more details\n -d, --debug\n show debugging log and stacktrace\n -h, --help\n show this help message and exit\n -V, --version\n show program's version number and exit\n\n--format epub:\n -c IMAGE_FILENAME, --cover IMAGE_FILENAME\n cover of the ebook\n -et {clean,noindent,condense}, --epub-template {clean,noindent,condense}\n CSS template for epub ebook (default: 'clean')\n -vp, --volume-page\n generate each volume as separate page\n\n--format txt:\n -w WIDTH, --width WIDTH\n width for line wrapping\n -sp, --split-volume-and-chapter\n split volume or chapter into separate file and ignore the --overwrite option\n -toc, --table-of-content\n add table of content\n\n--language zh-cn / --language zh-tw:\n -hn, --header-number\n convert section header from words to numbers\n -fw, --fullwidth\n convert ASCII character from halfwidth to fullwidth\n```\n\nConvert a txt file into epub:\n\n```console\ntxt2book ebook.txt\n```\n\n## Copyright and License\n\nCopyright (c) 2021,2022,2023 Kian-Meng Ang\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the Free\nSoftware Foundation, either version 3 of the License, or (at your option) any\nlater version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along\nwith this program. If not, see <https://www.gnu.org/licenses/>.\n",
"bugtrack_url": null,
"license": "AGPL-3.0-or-later",
"summary": "CLI tool to convert txt file to ebook format",
"version": "0.1.28",
"split_keywords": [
"txt",
"ebook",
"epub",
"cjk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f57472a2b798e6aadfd721368c15e121257e6805ca7a2ace881c318a82eca6b4",
"md5": "9ea9282ca49710aab823a17b9f32e4dd",
"sha256": "a7047b5f60c490c0b4c43297b9524debc8668fac6101a8d80e9365426803ebee"
},
"downloads": -1,
"filename": "txt2ebook-0.1.28-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ea9282ca49710aab823a17b9f32e4dd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 64867,
"upload_time": "2023-03-26T09:27:04",
"upload_time_iso_8601": "2023-03-26T09:27:04.195553Z",
"url": "https://files.pythonhosted.org/packages/f5/74/72a2b798e6aadfd721368c15e121257e6805ca7a2ace881c318a82eca6b4/txt2ebook-0.1.28-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c86d95f95ad9ac28618b049995c112cdeaa8c951eedb355a04c22ee19fe21a36",
"md5": "4b345d9545559d65d843060cdb6b750f",
"sha256": "99f63136dc4701774346aadc8f559749e8636b5c2f783f887a6ddb07fa5b7e0a"
},
"downloads": -1,
"filename": "txt2ebook-0.1.28.tar.gz",
"has_sig": false,
"md5_digest": "4b345d9545559d65d843060cdb6b750f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 38225,
"upload_time": "2023-03-26T09:27:05",
"upload_time_iso_8601": "2023-03-26T09:27:05.839469Z",
"url": "https://files.pythonhosted.org/packages/c8/6d/95f95ad9ac28618b049995c112cdeaa8c951eedb355a04c22ee19fe21a36/txt2ebook-0.1.28.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-26 09:27:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "kianmeng",
"github_project": "txt2ebook",
"lcname": "txt2ebook"
}