2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
beautifulsoup4,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
filelock,
|
|
|
|
lxml,
|
|
|
|
pythonOlder,
|
|
|
|
pytz,
|
|
|
|
requests,
|
|
|
|
setuptools-scm,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "snscrape";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.7.0.20230622";
|
2023-03-08 16:32:21 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JustAnotherArchivist";
|
|
|
|
repo = pname;
|
2023-03-08 16:32:21 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-9xAUMr1SWFePEvIz6DFEexk9Txex3u8wPNfMAdxEUCA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
beautifulsoup4
|
2022-06-26 10:26:21 +00:00
|
|
|
filelock
|
2021-09-18 10:52:07 +00:00
|
|
|
lxml
|
|
|
|
requests
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ requests.optional-dependencies.socks ++ lib.optionals (pythonOlder "3.9") [ pytz ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# There are no tests; make sure the executable works.
|
|
|
|
checkPhase = ''
|
|
|
|
export PATH=$PATH:$out/bin
|
|
|
|
snscrape --help
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "snscrape" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Social networking service scraper";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "snscrape";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/JustAnotherArchivist/snscrape";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ ivan ];
|
|
|
|
};
|
|
|
|
}
|