[project]
name = "megaparse"
version = "0.0.43"
description = "Parse complex files (PDF,Docx,PPTX) for LLM consumption"
authors = [
    { name = "Stan Girard", email = "stan@quivr.app" },
    { name = "Chloé Daems", email = "chloe@quivr.app" }
]

readme = "README.md"
requires-python = ">= 3.11"

dependencies = [
    "python-dotenv>=1.0.0",
    "uvloop>=0.18.0",
    "pydantic-settings>=2.6.1",
]

[project.optional-dependencies]
all = [
    "pycryptodome>=3.21.0",
    "llama-index>=0.10.0",
    "pdfplumber>=0.11.0",
    "backoff>=2.2.1",
    "pypdf>=5.0.1",
    "psutil>=6.1.0",
    "numpy<=2.0.0",
    "playwright>=1.47.0",
    "langchain-anthropic>=0.1.23",
    "python-magic>=0.4.27",
    "unstructured[all-docs]==0.15.0",
    "langchain>=0.2.14,<0.3.0",
    "langchain-community>=0.2.0",
    "langchain-openai>=0.1.21",
    "langchain-core>=0.2.38",
    "llama-parse>=0.4.0",
    "uvicorn>=0.25.0",
    "fastapi>=0.115.2",
    "ratelimit>=2.2.1",
    "requests>=2.32.3",
]

[tool.rye.workspace]
members = [
    ".",
]


[tool.hatch.metadata]
allow-direct-references = true

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
python = ">= 3.11"
managed = true
universal = true
dev-dependencies = [
    "mypy>=1.11.1",
    "pre-commit>=3.8.0",
    "ipykernel>=6.29.5",
    "ruff>=0.6.0",
    "flake8>=7.1.1",
    "flake8-black>=0.3.6",
    "pytest-asyncio>=0.23.8",
    "pytest>=8.3.3",
    "pytest-xdist>=3.6.1",
    "pytest-cov>=5.0.0",
]

[tool.ruff]
line-length = 88
exclude = [".git", "__pycache__", ".mypy_cache", ".pytest_cache"]

[tool.ruff.lint]
select = [
    "E", # pycodestyle errors
    "W", # pycodestyle warnings
    "F", # pyflakes
    "I", # isort
    "C", # flake8-comprehensions
    "B", # flake8-bugbear
]
ignore = [
    "B904",
    "B006",
    "E501", # line too long, handled by black
    "B008", # do not perform function calls in argument defaults
    "C901", # too complex
]

[tool.ruff.lint.isort]
order-by-type = true
relative-imports-order = "closest-to-furthest"
extra-standard-library = ["typing"]
section-order = [
    "future",
    "standard-library",
    "third-party",
    "first-party",
    "local-folder",
]
known-first-party = []

[tool.hatch.build.targets.wheel]
packages = ["megaparse"]
