2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-09-18 10:52:07 +00:00
|
|
|
, beautifulsoup4
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-09-18 10:52:07 +00:00
|
|
|
, fetchFromGitHub
|
2022-06-26 10:26:21 +00:00
|
|
|
, filelock
|
2020-04-24 23:36:52 +00:00
|
|
|
, lxml
|
2021-09-18 10:52:07 +00:00
|
|
|
, 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
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
beautifulsoup4
|
2022-06-26 10:26:21 +00:00
|
|
|
filelock
|
2021-09-18 10:52:07 +00:00
|
|
|
lxml
|
|
|
|
requests
|
2022-06-26 10:26:21 +00:00
|
|
|
]
|
|
|
|
++ requests.optional-dependencies.socks
|
|
|
|
++ lib.optionals (pythonOlder "3.9") [
|
2021-09-18 10:52:07 +00:00
|
|
|
pytz
|
|
|
|
];
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"snscrape"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-26 10:26:21 +00:00
|
|
|
description = "A 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 ];
|
|
|
|
};
|
|
|
|
}
|