From a391e9469ae9291d7a5cdc106c0d7cae79bb70a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viorel-C=C4=83t=C4=83lin=20R=C4=83pi=C8=9Beanu?= Date: Mon, 4 Sep 2023 16:26:23 +0300 Subject: [PATCH] python3Packages.wikitextparser: init at 0.54.0 Add Python package wikitextparser. Homepage: https://github.com/5j9/wikitextparser Easily extract and/or manipulate templates, template parameters, parser functions, tables, external links, wikilinks, lists, etc. found in wikitexts. --- .../python-modules/wikitextparser/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/wikitextparser/default.nix diff --git a/pkgs/development/python-modules/wikitextparser/default.nix b/pkgs/development/python-modules/wikitextparser/default.nix new file mode 100644 index 000000000000..b65f18b6c6ec --- /dev/null +++ b/pkgs/development/python-modules/wikitextparser/default.nix @@ -0,0 +1,39 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, pytestCheckHook +, regex +, wcwidth +}: + +buildPythonPackage rec { + pname = "wikitextparser"; + version = "0.54.0"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "5j9"; + repo = "wikitextparser"; + rev = "v${version}"; + hash = "sha256-AGQfjUNxeleuTS200QMdZS8CSD2t4ah5NMm9TIYjVHk="; + }; + + propagatedBuildInputs = [ + wcwidth + regex + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "wikitextparser" ]; + + meta = { + homepage = "https://github.com/5j9/wikitextparser"; + description = "A simple parsing tool for MediaWiki's wikitext markup"; + changelog = "https://github.com/5j9/wikitextparser/blob/v${version}/CHANGELOG.rst"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ rapiteanu ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3c34eb74a62f..5e563a0faa5e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13776,6 +13776,8 @@ self: super: with self; { wikipedia = callPackage ../development/python-modules/wikipedia { }; + wikitextparser = callPackage ../development/python-modules/wikitextparser { }; + willow = callPackage ../development/python-modules/willow { }; winacl = callPackage ../development/python-modules/winacl { };