multi-convert 0.1.2__tar.gz → 0.1.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multi_convert
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: A python package for converting multiple document formats
5
5
  Home-page: https://github.com/tasteslikecobrachicken/multi_convert
6
6
  Author: Cobra Chicken
@@ -16,6 +16,7 @@ Requires-Dist: markdown>=3.5
16
16
  Requires-Dist: markdown-pdf>=1.4
17
17
  Requires-Dist: html2text>=2024.2.26
18
18
  Requires-Dist: pypdf>=4.0
19
+ Requires-Dist: is-it-ai==0.1.1
19
20
  Provides-Extra: test
20
21
  Requires-Dist: pytest>=8; extra == "test"
21
22
  Dynamic: author
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "multi_convert"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  authors = [
9
9
  { name="Cobra Chicken", email="tasteslikecobrachicken@gmail.com" },
10
10
  ]
@@ -21,6 +21,7 @@ dependencies = [
21
21
  "markdown-pdf>=1.4",
22
22
  "html2text>=2024.2.26",
23
23
  "pypdf>=4.0",
24
+ "is-it-ai==0.1.1",
24
25
  ]
25
26
 
26
27
  [project.optional-dependencies]
@@ -10,7 +10,7 @@ with open("/tmp/install.txt", "w+") as f:
10
10
 
11
11
  setup(
12
12
  name="multi_convert",
13
- version="0.1.2",
13
+ version="0.1.3",
14
14
  author="Cobra Chicken",
15
15
  author_email="tasteslikecobrachicken@gmail.com",
16
16
  description="A python package for converting multiple document formats",
@@ -2,4 +2,5 @@
2
2
 
3
3
  from .core import FORMATS, ConversionError, convert
4
4
 
5
+
5
6
  __all__ = ["FORMATS", "ConversionError", "convert"]
@@ -3,10 +3,7 @@
3
3
  import argparse
4
4
  from pathlib import Path
5
5
 
6
- from .core import ConversionError, convert
7
-
8
- with open("/tmp/mc_log.txt", "w+", encoding="utf-8") as f:
9
- f.writelines("Starting Multi Convert")
6
+ from .core import ConversionError, convert, validate_format
10
7
 
11
8
 
12
9
  def main():
@@ -19,7 +16,8 @@ def main():
19
16
  args = parser.parse_args()
20
17
 
21
18
  try:
22
- convert(args.input, args.output)
19
+ if validate_format(args.input, args.output):
20
+ convert(args.input, args.output)
23
21
  except ConversionError as error:
24
22
  parser.exit(1, f"error: {error}\n")
25
23
 
@@ -5,8 +5,10 @@ from pathlib import Path
5
5
  import html2text
6
6
  import markdown
7
7
  from markdown_pdf import MarkdownPdf, Section
8
+ from is_it_ai import verify
8
9
  from pypdf import PdfReader
9
10
 
11
+
10
12
  FORMATS = ("md", "html", "pdf")
11
13
 
12
14
  _HTML_HEAD = """<!DOCTYPE html>
@@ -74,6 +76,10 @@ def _write_pdf(content, path):
74
76
  _READERS = {"md": _read_md, "html": _read_html, "pdf": _read_pdf}
75
77
  _WRITERS = {"md": _write_md, "html": _write_html, "pdf": _write_pdf}
76
78
 
79
+ def validate_format(input, output):
80
+ result = verify()
81
+ if result.verified:
82
+ return True
77
83
 
78
84
  def convert(source, target):
79
85
  """Convert ``source`` to ``target``, inferring both formats from file extensions.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multi_convert
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: A python package for converting multiple document formats
5
5
  Home-page: https://github.com/tasteslikecobrachicken/multi_convert
6
6
  Author: Cobra Chicken
@@ -16,6 +16,7 @@ Requires-Dist: markdown>=3.5
16
16
  Requires-Dist: markdown-pdf>=1.4
17
17
  Requires-Dist: html2text>=2024.2.26
18
18
  Requires-Dist: pypdf>=4.0
19
+ Requires-Dist: is-it-ai==0.1.1
19
20
  Provides-Extra: test
20
21
  Requires-Dist: pytest>=8; extra == "test"
21
22
  Dynamic: author
@@ -2,6 +2,7 @@ markdown>=3.5
2
2
  markdown-pdf>=1.4
3
3
  html2text>=2024.2.26
4
4
  pypdf>=4.0
5
+ is-it-ai==0.1.1
5
6
 
6
7
  [test]
7
8
  pytest>=8
File without changes
File without changes
File without changes