1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 hatchling,
8 hatch-vcs,
9
10 # dependencies
11 importlib-resources,
12 iso3166,
13 pycountry,
14 rstr,
15
16 # optional-dependencies
17 pydantic,
18
19 # tests
20 pytestCheckHook,
21 pythonOlder,
22}:
23
24buildPythonPackage rec {
25 pname = "schwifty";
26 version = "2025.9.0";
27 pyproject = true;
28
29 disabled = pythonOlder "3.9";
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-QoO4pMAtrsgaJ1yUYHc+otG3eMpw67W8sS7B/H3AoJk=";
34 };
35
36 build-system = [
37 hatchling
38 hatch-vcs
39 ];
40
41 dependencies = [
42 iso3166
43 pycountry
44 rstr
45 ]
46 ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ];
47
48 optional-dependencies = {
49 pydantic = [ pydantic ];
50 };
51
52 nativeCheckInputs = [
53 pytestCheckHook
54 ]
55 ++ lib.flatten (lib.attrValues optional-dependencies);
56
57 pythonImportsCheck = [ "schwifty" ];
58
59 meta = with lib; {
60 changelog = "https://github.com/mdomke/schwifty/blob/${version}/CHANGELOG.rst";
61 description = "Validate/generate IBANs and BICs";
62 homepage = "https://github.com/mdomke/schwifty";
63 license = licenses.mit;
64 maintainers = with maintainers; [ milibopp ];
65 };
66}