Skip to content

Commit 1ade638

Browse files
committed
TR updates, second round
1 parent 0d1b24f commit 1ade638

File tree

8 files changed

+28
-7
lines changed

8 files changed

+28
-7
lines changed

python-markitdown/batch_converter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ def main(
2020
result = md.convert(file_path)
2121
except Exception as e:
2222
print(f"✗ Error converting {file_path.name}: {e}")
23+
continue
2324

24-
output_file = output_path / f"{file_path.stem}.md"
25+
output_file = (
26+
output_path / f"{file_path.stem}{file_path.suffix}.md"
27+
)
2528
output_file.write_text(result.markdown, encoding="utf-8")
2629
print(f"✓ Converted {file_path.name}{output_file.name}")
2730

File renamed without changes.
File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<h2>The Zen of Python, by Tim Peters</h2>
2+
<ul>
3+
<li>Beautiful is better than ugly.</li>
4+
<li>Explicit is better than implicit.</li>
5+
<li>Simple is better than complex.</li>
6+
<li>Complex is better than complicated.</li>
7+
<li>Flat is better than nested.</li>
8+
<li>Sparse is better than dense.</li>
9+
<li>Readability counts.</li>
10+
<li>Special cases aren't special enough to break the rules.</li>
11+
<li>Although practicality beats purity.</li>
12+
<li>Errors should never pass silently.</li>
13+
<li>Unless explicitly silenced.</li>
14+
<li>In the face of ambiguity, refuse the temptation to guess.</li>
15+
<li>There should be one-- and preferably only one --obvious way to do it.</li>
16+
<li>Although that way may not be obvious at first unless you're Dutch.</li>
17+
<li>Now is better than never.</li>
18+
<li>Although never is often better than <em>right</em> now.</li>
19+
<li>If the implementation is hard to explain, it's a bad idea.</li>
20+
<li>If the implementation is easy to explain, it may be a good idea.</li>
21+
<li>Namespaces are one honking great idea -- let's do more of those!</li>
22+
</ul>

python-markitdown/img_description.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
from markitdown import MarkItDown
44
from openai import OpenAI
55

6-
api_key = os.getenv("OPENAI_API_KEY")
7-
8-
client = OpenAI(api_key=api_key)
6+
client = OpenAI()
97
md = MarkItDown(
108
llm_client=client,
119
llm_model="gpt-4o",

python-markitdown/ocr.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
from markitdown import MarkItDown
44
from openai import OpenAI
55

6-
api_key = os.getenv("OPENAI_API_KEY")
7-
8-
client = OpenAI(api_key=api_key)
6+
client = OpenAI()
97
md = MarkItDown(
108
llm_client=client,
119
llm_model="gpt-4o",

0 commit comments

Comments
 (0)