Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
951 B
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
fetchFromGitHub,
python3Packages,
openai,
pdfminer,
withOpenai ? false,
}:
python3Packages.buildPythonApplication rec {
pname = "pdftitle";
version = "0.20";
pyproject = true;
src = fetchFromGitHub {
owner = "metebalci";
repo = "pdftitle";
tag = "v${version}";
hash = "sha256-05SaAXYJ7l0ZldYufj0x9mYRwwGT7vlmq9a+ZF4pYiA=";
};
build-system = with python3Packages; [ setuptools ];
dependencies =
with python3Packages;
[
pdfminer
python-dotenv
]
++ lib.optional withOpenai openai;
pythonImportsCheck = [ "pdftitle" ];
meta = {
description = "Utility to extract the title from a PDF file";
homepage = "https://github.com/metebalci/pdftitle";
changelog = "https://github.com/metebalci/pdftitle/blob/v${version}/CHANGELOG.md";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ dansbandit ];
mainProgram = "pdftitle";
};
}