1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 flit-core,
6 pythonOlder,
7 typing-extensions,
8 unittestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "pypdf2";
13 version = "3.0.1";
14
15 format = "pyproject";
16
17 src = fetchPypi {
18 pname = "PyPDF2";
19 inherit version;
20 hash = "sha256-p0QI9pumJx9xuTUu9O0D3FOjGqQE0ptdMfU7/s/uFEA=";
21 };
22
23 nativeBuildInputs = [ flit-core ];
24
25 propagatedBuildInputs = lib.optionals (pythonOlder "3.10") [ typing-extensions ];
26
27 nativeCheckInputs = [ unittestCheckHook ];
28
29 pythonImportsCheck = [ "PyPDF2" ];
30
31 meta = with lib; {
32 description = "A Pure-Python library built as a PDF toolkit";
33 homepage = "https://pypdf2.readthedocs.io/";
34 changelog = "https://github.com/py-pdf/PyPDF2/raw/${version}/CHANGELOG.md";
35 license = licenses.bsd3;
36 maintainers = with maintainers; [
37 desiderius
38 vrthra
39 ];
40 };
41}