1{ lib
2, beautifulsoup4
3, buildPythonPackage
4, fetchFromGitHub
5, lxml
6, pythonOlder
7, pytz
8, requests
9, setuptools-scm
10}:
11
12buildPythonPackage rec {
13 pname = "snscrape";
14 version = "unstable-2021-08-30";
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "JustAnotherArchivist";
20 repo = pname;
21 rev = "c76f1637ce1d7a154af83495b67ead2559cd5715";
22 sha256 = "01x4961fxj1p98y6fcyxw5sv8fa87x41fdx9p31is12bdkmqxi6v";
23 };
24
25 SETUPTOOLS_SCM_PRETEND_VERSION = version;
26
27 nativeBuildInputs = [
28 setuptools-scm
29 ];
30
31 propagatedBuildInputs = [
32 beautifulsoup4
33 lxml
34 requests
35 ] ++ lib.optionals (pythonOlder "3.9") [
36 pytz
37 ];
38
39 # There are no tests; make sure the executable works.
40 checkPhase = ''
41 export PATH=$PATH:$out/bin
42 snscrape --help
43 '';
44
45 pythonImportsCheck = [ "snscrape" ];
46
47 meta = with lib; {
48 homepage = "https://github.com/JustAnotherArchivist/snscrape";
49 description = "A social networking service scraper in Python";
50 license = licenses.gpl3Plus;
51 maintainers = with maintainers; [ ivan ];
52 };
53}