Unverified Commit 8974da03 authored by Anton Mosich's avatar Anton Mosich
Browse files

python3Packages.ingredient-parser-nlp: init at 2.0.0

parent 63bf01db
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,

  setuptools,

  nltk,
  python-crfsuite,
  pint,
  floret,

  pytestCheckHook,
  nltk-data,
}:
buildPythonPackage rec {
  pname = "ingredient-parser-nlp";
  version = "2.0.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "strangetom";
    repo = "ingredient-parser";
    tag = version;
    hash = "sha256-i14RKBcvU56pDNGxNVBvvpQ65FCbitMIfvN5eLLJCWU=";
  };

  build-system = [ setuptools ];

  dependencies = [
    nltk
    python-crfsuite
    pint
    floret
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "ingredient_parser"
  ];

  # Needed for tests
  preCheck = ''
    export NLTK_DATA=${nltk-data.averaged_perceptron_tagger_eng}
  '';

  meta = {
    description = "Parse structured information from recipe ingredient sentences";
    license = lib.licenses.mit;
    homepage = "https://github.com/strangetom/ingredient-parser/";
    changelog = "https://github.com/strangetom/ingredient-parser/releases/tag/${version}";
    maintainers = with lib.maintainers; [ antonmosich ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -6630,6 +6630,8 @@ self: super: with self; {
  inform = callPackage ../development/python-modules/inform { };
  ingredient-parser-nlp = callPackage ../development/python-modules/ingredient-parser-nlp { };
  iniconfig = callPackage ../development/python-modules/iniconfig { };
  inifile = callPackage ../development/python-modules/inifile { };