1{
2 aiofiles,
3 buildPythonPackage,
4 cryptography,
5 deepdiff,
6 eval-type-backport,
7 fetchFromGitHub,
8 httpx,
9 lib,
10 nest-asyncio,
11 poetry-core,
12 pydantic,
13 pypdf,
14 pytest-asyncio,
15 pytestCheckHook,
16 python,
17 python-dateutil,
18 requests-toolbelt,
19 typing-inspection,
20}:
21
22buildPythonPackage rec {
23 pname = "unstructured-client";
24 version = "0.35.0";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "Unstructured-IO";
29 repo = "unstructured-python-client";
30 tag = "v${version}";
31 hash = "sha256-f1sJei3OnLxVahsirZFUzdIpkEEMc8rZR3+8JfihCuM=";
32 };
33
34 preBuild = ''
35 ${python.interpreter} scripts/prepare_readme.py
36 '';
37
38 build-system = [ poetry-core ];
39
40 pythonRelaxDeps = [
41 "pydantic"
42 ];
43
44 dependencies = [
45 aiofiles
46 cryptography
47 eval-type-backport
48 httpx
49 nest-asyncio
50 pydantic
51 pypdf
52 python-dateutil
53 requests-toolbelt
54 typing-inspection
55 ];
56
57 pythonImportsCheck = [ "unstructured_client" ];
58
59 nativeCheckInputs = [
60 deepdiff
61 pytest-asyncio
62 pytestCheckHook
63 ];
64
65 pytestFlagsArray = [
66 # see test-unit in Makefile
67 "_test_unstructured_client"
68 "-k"
69 "unit"
70 ];
71
72 meta = {
73 changelog = "https://github.com/Unstructured-IO/unstructured-python-client/blob/${src.tag}/RELEASES.md";
74 description = "Python Client SDK for Unstructured API";
75 homepage = "https://github.com/Unstructured-IO/unstructured-python-client";
76 license = lib.licenses.mit;
77 maintainers = with lib.maintainers; [ dotlambda ];
78 };
79}