[build-system] requires = ["hatchling"] build-backend = "hatchling.build" [project] name = "mdcx" version = "1.31.0" description = "Convert a document collection to verified Markdown, package it encrypted with its search index and provenance, and serve it to agents over MCP" readme = "README.md" requires-python = ">=3.11" license = "Apache-2.0" license-files = ["LICENSE", "NOTICE"] authors = [{ name = "Jorge Ellena G." }] keywords = ["markdown", "document-conversion", "retrieval", "mcp", "provenance", "rag"] classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Legal Industry", "Intended Audience :: Science/Research", "Topic :: Text Processing :: Markup :: Markdown", "Topic :: Text Processing :: Indexing", "Topic :: Office/Business", "Topic :: Scientific/Engineering :: Information Analysis", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", "Environment :: Console", "Typing :: Typed", ] # Querying a package requires almost nothing: SQLite and LZMA are in the standard # library, and only decryption needs a third-party module. Conversion is what pulls in # heavy dependencies, so it is an extra rather than a default: a user who receives an # .mdcx file and wants to query it should not install 1.4 GB to do so. dependencies = [ "cryptography>=41.0", ] [project.optional-dependencies] # Document conversion. Docling brings PyTorch and its model stack. convert = [ "docling>=2.0", "pypdfium2>=4.0", "python-docx>=1.0", "openpyxl>=3.1", "python-pptx>=1.0", ] # Model Context Protocol server. mcp = ["mcp>=1.0"] # Packages compressed with zstd. Opening is what a server pays before it can # answer anything, and on a large body zstd reads back in a fraction of the # time LZMA takes. Optional because LZMA is in the standard library and every # package written before this is compressed with it. zstd = ["zstandard>=0.22"] # Retrieval across languages. A query written in one language reaches documents # written in another, which word matching cannot do: the words are not shared. # It brings a multilingual embedding model and its runtime. multilingual = [ "sentence-transformers>=3.0", "numpy>=1.24", ] # Optical character recognition, for collections containing scanned documents. # # `onnxruntime` and `onnxruntime-gpu` are two distributions publishing the same # module, so they cannot coexist: whichever pip wrote last wins, and in practice # that is the CPU one. Declaring the CPU build here means `pip install --upgrade # "mdcx[all]"` silently removes CUDA from an environment that had prepared it -- # measured on three consecutive releases, in two environments each time, with no # error, nothing in any log, and optical recognition simply costing tens of # times more. # # pip cannot express "either of these distributions", so `ocr-gpu` exists: the # same extra without the runtime pinned, for an environment that installs # `onnxruntime-gpu` itself. `mdcx[all-gpu]` is the same idea for the whole set. # # `rapidocr-onnxruntime` is gone rather than replaced. It is the package that # pulled `onnxruntime` in, nothing requires it, mdcx never imports it, and # docling has moved to `rapidocr` 3.x. ocr = ["rapidocr>=3.0", "onnxruntime>=1.16"] ocr-gpu = ["rapidocr>=3.0"] # Tables a page does not draw. Most tables in printed material are found from # the rules drawn around them, which costs nothing; what is left is the # borderless kind, and those are read by a model that reports where the rows # and columns run. It reads the shape only -- the words still come from the # text layer -- and it is small: twenty-nine million parameters, run on the few # pages that reached it. Licences are compatible with distributing a library: # code and weights MIT, PubTables-1M CDLA-Permissive-2.0. tables = [ "transformers>=4.40", "timm>=1.0", "torch>=2.0", ] # Everything. all = [ "docling>=2.0", "pypdfium2>=4.0", "python-docx>=1.0", "openpyxl>=3.1", "python-pptx>=1.0", "mcp>=1.0", "rapidocr>=3.0", "onnxruntime>=1.16", "sentence-transformers>=3.0", "numpy>=1.24", "transformers>=4.40", "timm>=1.0", "torch>=2.0", "zstandard>=0.22", ] # Everything, on a machine that keeps its own accelerated onnxruntime. The only # difference is that the CPU runtime is not pinned, so upgrading does not put it # back over `onnxruntime-gpu`. all-gpu = [ "docling>=2.0", "pypdfium2>=4.0", "python-docx>=1.0", "openpyxl>=3.1", "python-pptx>=1.0", "mcp>=1.0", "rapidocr>=3.0", "zstandard>=0.22", "sentence-transformers>=3.0", "numpy>=1.24", "transformers>=4.40", "timm>=1.0", "torch>=2.0", ] [project.scripts] mdcx = "mdcx.archive:main" mdcx-convert = "mdcx.cli:main" mdcx-search = "mdcx.search:main" [project.urls] Homepage = "https://github.com/jorgell23-sys/mdcx" Repository = "https://github.com/jorgell23-sys/mdcx" Issues = "https://github.com/jorgell23-sys/mdcx/issues" Changelog = "https://github.com/jorgell23-sys/mdcx/releases" [tool.hatch.build.targets.wheel] packages = ["src/mdcx"] [tool.hatch.build.targets.sdist] include = ["src/mdcx", "tests", "tools", "README.md", "CHANGELOG.md", "LICENSE", "NOTICE", "CITATION.cff"]