summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/twscrape/default.nix
blob: a36b698555cca47c99b6f3394136590a6f551f5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  aiosqlite,
  beautifulsoup4,
  buildPythonPackage,
  fake-useragent,
  fetchFromGitHub,
  hatchling,
  httpx,
  loguru,
  pyotp,
  pytestCheckHook,
  pytest-asyncio,
  pytest-httpx,
}:

buildPythonPackage rec {
  pname = "twscrape";
  version = "0.17.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "vladkens";
    repo = "twscrape";
    tag = "v${version}";
    hash = "sha256-0j6nE8V0CWTuIHMS+2p5Ncz7d+D6VagjtyfMbQuI8Eg=";
  };

  build-system = [ hatchling ];

  pythonRelaxDeps = [ "beautifulsoup4" ];

  dependencies = [
    aiosqlite
    beautifulsoup4
    fake-useragent
    httpx
    loguru
    pyotp
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-asyncio
    pytest-httpx
  ];

  pythonImportsCheck = [ "twscrape" ];

  meta = {
    description = "Twitter API scrapper with authorization support";
    homepage = "https://github.com/vladkens/twscrape";
    changelog = "https://github.com/vladkens/twscrape/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.amadejkastelic ];
  };
}