1{
2 lib,
3 aiosqlite,
4 beautifulsoup4,
5 buildPythonPackage,
6 fake-useragent,
7 fetchFromGitHub,
8 hatchling,
9 httpx,
10 loguru,
11 pyotp,
12 pytestCheckHook,
13 pytest-httpx,
14 pythonOlder,
15}:
16
17buildPythonPackage rec {
18 pname = "twscrape";
19 version = "0.17.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.10";
23
24 src = fetchFromGitHub {
25 owner = "vladkens";
26 repo = "twscrape";
27 tag = "v${version}";
28 hash = "sha256-0j6nE8V0CWTuIHMS+2p5Ncz7d+D6VagjtyfMbQuI8Eg=";
29 };
30
31 build-system = [ hatchling ];
32
33 pythonRelaxDeps = [ "beautifulsoup4" ];
34
35 dependencies = [
36 aiosqlite
37 beautifulsoup4
38 fake-useragent
39 httpx
40 loguru
41 pyotp
42 ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 pytest-httpx
47 ];
48
49 pythonImportsCheck = [ "twscrape" ];
50
51 meta = {
52 description = "Twitter API scrapper with authorization support";
53 homepage = "https://github.com/vladkens/twscrape";
54 changelog = "https://github.com/vladkens/twscrape/releases/tag/v${version}";
55 license = lib.licenses.mit;
56 maintainers = [ lib.maintainers.amadejkastelic ];
57 };
58}