update requirements.txt

This commit is contained in:
swrneko
2025-09-09 14:23:28 +03:00
parent 74a15afded
commit 240c39cab2
2 changed files with 22 additions and 2 deletions

View File

@@ -2,12 +2,15 @@ aiofiles==24.1.0
annotated-types==0.7.0 annotated-types==0.7.0
anyio==4.10.0 anyio==4.10.0
av==15.1.0 av==15.1.0
beautifulsoup4==4.13.5
Brotli==1.1.0 Brotli==1.1.0
bs4==0.0.2
certifi==2025.8.3 certifi==2025.8.3
cffi==2.0.0 cffi==2.0.0
charset-normalizer==3.4.3 charset-normalizer==3.4.3
click==8.2.1 click==8.2.1
coloredlogs==15.0.1 coloredlogs==15.0.1
colour==0.1.5
cssselect2==0.8.0 cssselect2==0.8.0
ctranslate2==4.6.0 ctranslate2==4.6.0
distro==1.9.0 distro==1.9.0
@@ -19,6 +22,7 @@ ffmpeg-python==0.2.0
ffmpy==0.6.1 ffmpy==0.6.1
filelock==3.19.1 filelock==3.19.1
flatbuffers==25.2.10 flatbuffers==25.2.10
flatlatex==0.15
fonttools==4.59.2 fonttools==4.59.2
fsspec==2025.9.0 fsspec==2025.9.0
future==1.0.0 future==1.0.0
@@ -32,17 +36,23 @@ httpx==0.28.1
huggingface-hub==0.34.4 huggingface-hub==0.34.4
humanfriendly==10.0 humanfriendly==10.0
idna==3.10 idna==3.10
iso639-lang==2.6.3
Jinja2==3.1.6 Jinja2==3.1.6
jiter==0.10.0 jiter==0.10.0
joblib==1.5.2
langdetect==1.0.9
littleutils==0.2.4
markdown-it-py==3.0.0 markdown-it-py==3.0.0
markdown2==2.5.4 markdown_pdf==1.9
MarkupSafe==3.0.2 MarkupSafe==3.0.2
mdurl==0.1.2 mdurl==0.1.2
mpmath==1.3.0 mpmath==1.3.0
nltk==3.9.1
numpy==2.2.6 numpy==2.2.6
onnxruntime==1.22.1 onnxruntime==1.22.1
openai==1.106.1 openai==1.106.1
orjson==3.11.3 orjson==3.11.3
outdated==0.2.2
packaging==25.0 packaging==25.0
pandas==2.3.2 pandas==2.3.2
pillow==11.3.0 pillow==11.3.0
@@ -53,13 +63,17 @@ pydantic_core==2.33.2
pydub==0.25.1 pydub==0.25.1
pydyf==0.11.0 pydyf==0.11.0
Pygments==2.19.2 Pygments==2.19.2
pylatexenc==2.10
pymultidictionary==1.3.2
PyMuPDF==1.26.4 PyMuPDF==1.26.4
pyperclip==1.9.0
pyphen==0.17.2 pyphen==0.17.2
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
python-dotenv==1.1.1 python-dotenv==1.1.1
python-multipart==0.0.20 python-multipart==0.0.20
pytz==2025.2 pytz==2025.2
PyYAML==6.0.2 PyYAML==6.0.2
regex==2025.9.1
requests==2.32.5 requests==2.32.5
rich==14.1.0 rich==14.1.0
ruff==0.12.12 ruff==0.12.12
@@ -68,10 +82,12 @@ semantic-version==2.10.0
shellingham==1.5.4 shellingham==1.5.4
six==1.17.0 six==1.17.0
sniffio==1.3.1 sniffio==1.3.1
soupsieve==2.8
starlette==0.47.3 starlette==0.47.3
sympy==1.14.0 sympy==1.14.0
tinycss2==1.4.0 tinycss2==1.4.0
tinyhtml5==2.0.0 tinyhtml5==2.0.0
tkmacosx==1.0.5
tokenizers==0.22.0 tokenizers==0.22.0
tomlkit==0.13.3 tomlkit==0.13.3
tqdm==4.67.1 tqdm==4.67.1
@@ -81,7 +97,6 @@ typing_extensions==4.15.0
tzdata==2025.2 tzdata==2025.2
urllib3==2.5.0 urllib3==2.5.0
uvicorn==0.35.0 uvicorn==0.35.0
weasyprint==66.0
webencodings==0.5.1 webencodings==0.5.1
websockets==15.0.1 websockets==15.0.1
zopfli==0.2.3.post1 zopfli==0.2.3.post1

View File

@@ -1,5 +1,7 @@
import re import re
from pylatexenc.latex2text import LatexNodes2Text from pylatexenc.latex2text import LatexNodes2Text
from markdown_pdf import MarkdownPdf
from markdown_pdf import Section
class ConvertMdToPdf: class ConvertMdToPdf:
# Конвертирует md в pdf # Конвертирует md в pdf
@@ -11,6 +13,8 @@ class ConvertMdToPdf:
text, text,
flags=re.DOTALL flags=re.DOTALL
) )
pdf = MarkdownPdf(toc_level=2, optimize=True)
pdf.add_section(Section(text))
return text return text
def replace_math(self, match): def replace_math(self, match):
@@ -18,6 +22,7 @@ class ConvertMdToPdf:
try: try:
# Преобразуем только математическое выражение # Преобразуем только математическое выражение
converted = LatexNodes2Text().latex_to_text(math_content) converted = LatexNodes2Text().latex_to_text(math_content)
return converted return converted
except: except:
return math_content # В случае ошибки оставляем как есть return math_content # В случае ошибки оставляем как есть