txt2ebook 0.1.136__py3-none-any.whl → 0.1.138__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
txt2ebook/cli.py CHANGED
@@ -44,6 +44,13 @@ def build_parser() -> argparse.ArgumentParser:
44
44
  ),
45
45
  )
46
46
 
47
+ subparsers = parser.add_subparsers(
48
+ help="sub-command help",
49
+ dest="subcommand",
50
+ required=True,
51
+ )
52
+ txt2ebook.subcommands.build_subparser(subparsers)
53
+
47
54
  parser.add_argument(
48
55
  "-of",
49
56
  "--output-folder",
@@ -124,9 +131,6 @@ def build_parser() -> argparse.ArgumentParser:
124
131
  version=f"%(prog)s {__version__}",
125
132
  )
126
133
 
127
- subparsers = parser.add_subparsers(help="sub-command help")
128
- txt2ebook.subcommands.build_subparser(subparsers)
129
-
130
134
  return parser
131
135
 
132
136
 
@@ -136,16 +140,18 @@ def main(args: Optional[Sequence[str]] = None):
136
140
 
137
141
  try:
138
142
  parser = build_parser()
139
- if len(args) == 0:
140
- parser.print_help(sys.stderr)
141
- else:
142
- parsed_args = parser.parse_args(args)
143
- setup_logger(parsed_args)
143
+ parsed_args = parser.parse_args(args)
144
+ setup_logger(parsed_args)
144
145
 
146
+ if parsed_args.subcommand is not None:
147
+ logger.debug(parsed_args)
145
148
  if hasattr(parsed_args, "func"):
146
- logger.debug(parsed_args)
147
149
  parsed_args.func(parsed_args)
148
150
  else:
151
+ logger.error(
152
+ "subcommand '%s' is missing its execution function.",
153
+ parsed_args.command
154
+ )
149
155
  parser.print_help(sys.stderr)
150
156
 
151
157
  except Exception as error:
@@ -30,7 +30,8 @@ logger = logging.getLogger(__name__)
30
30
  def build_subparser(subparsers) -> None:
31
31
  """Build the subparser."""
32
32
  epub_parser = subparsers.add_parser(
33
- "epub", help="generate ebook in EPUB format"
33
+ "epub", help="generate ebook in EPUB format",
34
+ formatter_class=argparse.RawTextHelpFormatter
34
35
  )
35
36
 
36
37
  epub_parser.set_defaults(func=run)
@@ -1,45 +1,44 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: txt2ebook
3
- Version: 0.1.136
3
+ Version: 0.1.138
4
4
  Summary: CLI tool to convert txt file to ebook format
5
- Home-page: https://github.com/kianmeng/txt2ebook
6
- License: AGPL-3.0-or-later
7
- Keywords: txt,ebook,epub,cjk
8
- Author: Kian-Meng Ang
9
- Author-email: kianmeng@cpan.org
10
- Requires-Python: >=3.9,<4.0
5
+ Project-URL: Homepage, https://github.com/kianmeng/txt2ebook
6
+ Project-URL: Repository, https://github.com/kianmeng/txt2ebook
7
+ Author-email: Kian-Meng Ang <kianmeng@cpan.org>
8
+ License-Expression: AGPL-3.0-or-later
9
+ License-File: LICENSE.md
10
+ Keywords: cjk,ebook,epub,txt
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Environment :: Console
13
13
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
14
14
  Classifier: Natural Language :: Chinese (Simplified)
15
15
  Classifier: Natural Language :: Chinese (Traditional)
16
16
  Classifier: Programming Language :: Python
17
- Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
18
  Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Programming Language :: Python :: 3 :: Only
24
23
  Classifier: Topic :: Text Processing
25
24
  Classifier: Topic :: Text Processing :: Filters
26
25
  Classifier: Topic :: Text Processing :: General
27
26
  Classifier: Topic :: Text Processing :: Markup :: HTML
28
27
  Classifier: Topic :: Text Processing :: Markup :: Markdown
29
- Requires-Dist: CJKwrap (>=2.2,<3.0)
30
- Requires-Dist: EbookLib (>=0.17.1,<0.18.0)
31
- Requires-Dist: bs4 (>=0.0.1,<0.0.2)
32
- Requires-Dist: importlib-resources (>=6.1.1,<7.0.0)
33
- Requires-Dist: jieba (>=0.42.1,<0.43.0)
34
- Requires-Dist: langdetect (>=1.0.9,<2.0.0)
35
- Requires-Dist: lxml (>=5.2.2,<6.0.0)
36
- Requires-Dist: pylatex (>=1.4.2,<2.0.0)
37
- Requires-Dist: pypandoc (>=1.11,<2.0)
38
- Requires-Dist: regex (>=2021.11.10,<2022.0.0)
39
- Requires-Dist: reportlab (>=4.0.0,<5.0.0)
40
- Requires-Dist: typing-extensions (>=4.5.0,<5.0.0)
41
- Requires-Dist: typst (>=0.12.0,<0.13.0)
42
- Project-URL: Repository, https://github.com/kianmeng/txt2ebook
28
+ Requires-Python: ~=3.9
29
+ Requires-Dist: bs4<0.0.2,>=0.0.1
30
+ Requires-Dist: cjkwrap~=2.2
31
+ Requires-Dist: ebooklib<0.18,>=0.17.1
32
+ Requires-Dist: importlib-resources<7,>=6.1.1
33
+ Requires-Dist: jieba<0.43,>=0.42.1
34
+ Requires-Dist: langdetect<2,>=1.0.9
35
+ Requires-Dist: lxml<6,>=5.2.2
36
+ Requires-Dist: pylatex<2,>=1.4.2
37
+ Requires-Dist: pypandoc~=1.11
38
+ Requires-Dist: regex<2022,>=2021.11.10
39
+ Requires-Dist: reportlab<5,>=4.0.0
40
+ Requires-Dist: typing-extensions<5,>=4.5.0
41
+ Requires-Dist: typst<0.13,>=0.12.0
43
42
  Description-Content-Type: text/markdown
44
43
 
45
44
  # txt2ebook
@@ -158,4 +157,3 @@ The fish logo used in the documentation generated by Sphinx is a public domain
158
157
  drawing of Troschel's parrotfish (Chlorurus troschelii Var. A.) from
159
158
  <https://commons.wikimedia.org/entity/M18506436>.
160
159
  18506436>.
161
-
@@ -1,29 +1,32 @@
1
1
  txt2ebook/__init__.py,sha256=wnrJownTB3sKXv3BpcXn4exkpWRSCXhKYWKJib5APNI,3073
2
2
  txt2ebook/__main__.py,sha256=L29rlfPSx9XMnVaHBYP2dyYgDmutJvONR3yUejjYwRY,855
3
- txt2ebook/cli.py,sha256=BrlP9fKoebb6UjiOoYaZOLI6hks3fQLmGCJu7aaHGm4,4244
3
+ txt2ebook/cli.py,sha256=X91GnzdSTZI4Cl2ttskMmQpBy6QuyENuX_VnwOHtA7Q,4423
4
4
  txt2ebook/exceptions.py,sha256=PT3m85PE5QopHHUfRwEQzp0kJ4AA9yjLO6V6lYC8WhQ,858
5
+ txt2ebook/parser.py,sha256=IOSTbkvLQ9Uvo1hUBDTKozMQagA547N3qr-xU8aE0RI,9009
6
+ txt2ebook/tokenizer.py,sha256=H9AaZVmNP43L3ONvj58u_5weZAjFG9SzQSeS9upGN1U,9642
7
+ txt2ebook/zh_utils.py,sha256=0Yq9r-JL4HntW68vFR6TBP9yQim1a07mfsh_sp-XmaE,4887
5
8
  txt2ebook/formats/__init__.py,sha256=yNF426_jHKNCKenKj1JTbOs22vEBuGScEk6TKhFaZUk,1716
6
9
  txt2ebook/formats/base.py,sha256=ODguJ7OBPXfRQLLeoL-G66NZihroXb4kG5-56ZrlygI,5819
7
10
  txt2ebook/formats/epub.py,sha256=IVz-FmYQlcChOw38YqfKy46bPVSIrHyxA_94iz06N3Y,6941
8
11
  txt2ebook/formats/gmi.py,sha256=kKyYzqS4NkucyhdBmT8cPEu6DGnNf95vVvXYdFnC6-s,6791
9
12
  txt2ebook/formats/md.py,sha256=9RWv_7cfXfAGC1MdYm0WTkjpgtXKQJTQjYOf0MqQmsc,6537
10
13
  txt2ebook/formats/pdf.py,sha256=tr_ozVlL976yo7Ggny71zjOwzSd6tSnHTl7mcsLII_g,7263
14
+ txt2ebook/formats/tex.py,sha256=V5B1nPR-WzGc4jqWu-BqxfQhtQsUTKM_sZZJsCcDBAk,5897
15
+ txt2ebook/formats/txt.py,sha256=j5RWF41WQfLdm-APwi8u-OE8snenDEJLzxHD_i9mxeg,7541
16
+ txt2ebook/formats/typ.py,sha256=_a3PKFh5jlHvaqRes6XvtPoDJI_HJaH7pCBbBRFeYyM,6647
11
17
  txt2ebook/formats/templates/__init__.py,sha256=f3K7pJByNmmvu-wvziks6qb2QnnLmkDjUACXyw2s60E,760
12
18
  txt2ebook/formats/templates/epub/__init__.py,sha256=-XVLvnknTJTmQZY9UTH705vMcHgy56rQVRTusYawEZ4,766
13
19
  txt2ebook/formats/templates/epub/clean.css,sha256=AnEwMckzUSKcjKsDiWtJW1oaceuklt2tyuS1VbpVK1s,462
14
20
  txt2ebook/formats/templates/epub/condense.css,sha256=Fz80ZqkPsFRmGdURduAxqMV8drD0CCUlrv41P8rUsm8,477
15
21
  txt2ebook/formats/templates/epub/noindent.css,sha256=_O5Tv90TKyyPBRdgjuNKFwtKFbdheh2V9PtDhgRUg3U,483
16
- txt2ebook/formats/tex.py,sha256=V5B1nPR-WzGc4jqWu-BqxfQhtQsUTKM_sZZJsCcDBAk,5897
17
- txt2ebook/formats/txt.py,sha256=j5RWF41WQfLdm-APwi8u-OE8snenDEJLzxHD_i9mxeg,7541
18
- txt2ebook/formats/typ.py,sha256=_a3PKFh5jlHvaqRes6XvtPoDJI_HJaH7pCBbBRFeYyM,6647
19
22
  txt2ebook/helpers/__init__.py,sha256=-Awv2qDnsDHnku_XunOCsn-HDLvkBDpI0b24WFs0H74,1379
20
23
  txt2ebook/languages/__init__.py,sha256=1AfDn-D0q-dvODGP-9KxPHY_Wtk-ifZdN1FutZMT9-Q,763
21
24
  txt2ebook/languages/en.py,sha256=e5VzZwfrO2kABMwEB0l--eo4XbOre6f6uJ-ySU3ORT8,960
22
25
  txt2ebook/languages/zh_cn.py,sha256=lcbgPFO4Uaog8sKHKF5fQtvRwkKiQ3v5wMvYNEvNk9k,1943
23
26
  txt2ebook/languages/zh_tw.py,sha256=_fdXOOSLK0nTMuBe1Om2qjb4zr2PVd6N4xi2rrYkNTI,1515
27
+ txt2ebook/locales/txt2ebook.pot,sha256=NyqRL3frKSw9bry_vriA1pdXh1gh1qAUpi5_wzLb7jc,641
24
28
  txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo,sha256=Ym6soeijV3zsv9FUPWlJnu18-CNb5tcOTN5JsMOfV9c,672
25
29
  txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=YhI4ZnZVWIqR3WpbLL940xXdLwAAp9-OBQShD6QtSWU,698
26
- txt2ebook/locales/txt2ebook.pot,sha256=NyqRL3frKSw9bry_vriA1pdXh1gh1qAUpi5_wzLb7jc,641
27
30
  txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo,sha256=rRGW7HByDVZV8WpQkhyIFOWYNTQc4NnStrn0eGJX8Wc,675
28
31
  txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=zVvD8AEL6gcxg4QPfc_NnDy22Qf9_AdeYejiVzbLsFc,698
29
32
  txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo,sha256=1GIuOcO_bISiFcfhFez-A7mSi11Mo-x3PBobBENgMEc,675
@@ -32,10 +35,9 @@ txt2ebook/models/__init__.py,sha256=Z3zClWLj08Q8HgaWV1RRgIKatEhIUfYBAVWm-j4m05w,
32
35
  txt2ebook/models/book.py,sha256=OkYg9ogOyH6mizP4qACTBTq4x6OAfY01gmaEzlerhLw,2788
33
36
  txt2ebook/models/chapter.py,sha256=6YvUDHzR6amGMZgkQl_xHWrYZUmlfpF7mnDLilG2BpA,1686
34
37
  txt2ebook/models/volume.py,sha256=koz1KfWjvGWLFbmGEQlZ23frsP93cDsuBMySYBHiXm8,1597
35
- txt2ebook/parser.py,sha256=IOSTbkvLQ9Uvo1hUBDTKozMQagA547N3qr-xU8aE0RI,9009
36
38
  txt2ebook/subcommands/__init__.py,sha256=ldhzvsrMsR8lZmhZef77JFz0jValpV3pytFfwJSkjls,1146
37
39
  txt2ebook/subcommands/env.py,sha256=gEzra4b6guy7pRZUTCWX1_eiR7JmrtR1Z-J-vxljvMY,1549
38
- txt2ebook/subcommands/epub.py,sha256=JDDucrRiiQW1B7ycKz5zS1X5SMQZ82GBtlE2_SBYIdw,3507
40
+ txt2ebook/subcommands/epub.py,sha256=WiCah28BV3iS-MjgS7wLWvrInTrglTVcLpRK8mFxfLs,3562
39
41
  txt2ebook/subcommands/gmi.py,sha256=IE6NsQJz7Rz8mXmYgJJXuaaPP7gznf0ZNhxhWFxjjm0,3319
40
42
  txt2ebook/subcommands/massage.py,sha256=EuC-C03NMJk9V1_PEUOa-n4SmQCRpj1TJ_GwSJE8_Ss,11809
41
43
  txt2ebook/subcommands/md.py,sha256=P-oFtb2u-v2F_KU8t249-f5Ihjb_TCT_NWMlOYoq5p4,3330
@@ -43,10 +45,8 @@ txt2ebook/subcommands/parse.py,sha256=FaYTWa2yqkowwPAmHWJC7iCii2Rnus3SUHG10GjjJp
43
45
  txt2ebook/subcommands/pdf.py,sha256=KS3rzxPJG6ovt8GPJj8u1Bum5ye3zrEI0LPz21EMLZo,2981
44
46
  txt2ebook/subcommands/tex.py,sha256=X6ZBfuAs_mcJe8PNjzoW339ecPynZduVbcCq0henjiA,3131
45
47
  txt2ebook/subcommands/typ.py,sha256=r4Xf7xSINbYfaIKkVzdyQDlUMWPvOIcbvOwC71spu6w,3682
46
- txt2ebook/tokenizer.py,sha256=H9AaZVmNP43L3ONvj58u_5weZAjFG9SzQSeS9upGN1U,9642
47
- txt2ebook/zh_utils.py,sha256=0Yq9r-JL4HntW68vFR6TBP9yQim1a07mfsh_sp-XmaE,4887
48
- txt2ebook-0.1.136.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
49
- txt2ebook-0.1.136.dist-info/METADATA,sha256=Mr1DGhpE6Mbu5gM_0-m444HRmRNQ_-65FpzLHJmcyVk,4968
50
- txt2ebook-0.1.136.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
51
- txt2ebook-0.1.136.dist-info/entry_points.txt,sha256=AFikuCV6fqf8_GHwsvWuo9jTGNrCkWY1TJWk5GfMWSk,71
52
- txt2ebook-0.1.136.dist-info/RECORD,,
48
+ txt2ebook-0.1.138.dist-info/METADATA,sha256=G7pFnLaDciAOsy4QaboVHeT6_MGWvIwvEWnLBviBt-A,4873
49
+ txt2ebook-0.1.138.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
+ txt2ebook-0.1.138.dist-info/entry_points.txt,sha256=3jm5vpUsDRgoM6S3CQVMMiP7tJQqfq1vfV0sh_KaK9s,74
51
+ txt2ebook-0.1.138.dist-info/licenses/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
52
+ txt2ebook-0.1.138.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ tte = txt2ebook.cli:main
3
+ txt2ebook = txt2ebook.cli:main
@@ -1,4 +0,0 @@
1
- [console_scripts]
2
- tte=txt2ebook.cli:main
3
- txt2ebook=txt2ebook.cli:main
4
-