{
  lib,
  python3,
  fetchFromGitHub,
  callPackage,
}:

python3.pkgs.buildPythonApplication rec {
  pname = "qbit-manage";
  version = "4.1.14";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "StuffAnThings";
    repo = "qbit_manage";
    rev = "v${version}";
    hash = "sha256-JTQZlJ2d0oOpT8lIf9mgQ/onTs5jiWfvzFx0XBjbCQo=";
  };

  build-system = [
    python3.pkgs.setuptools
    python3.pkgs.wheel
  ];

  dependencies = with python3.pkgs; [
    croniter
    gitpython
    humanize
    pytimeparse2
    qbittorrent-api
    requests
    retrying
    ruamel-yaml
    schedule
    (callPackage ./bencodepy.nix { })
  ];

  meta = {
    description = "This tool will help manage tedious tasks in qBittorrent and automate them. Tag, categorize, remove Orphaned data, remove unregistered torrents and much much more";
    homepage = "https://github.com/StuffAnThings/qbit_manage";
    changelog = "https://github.com/StuffAnThings/qbit_manage/blob/${src.rev}/CHANGELOG";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ CaptainJawZ ];
    mainProgram = "qbit-manage";
  };
}
