document-manager 0.0.1__tar.gz → 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {document_manager-0.0.1 → document_manager-0.0.2}/PKG-INFO +2 -2
- {document_manager-0.0.1 → document_manager-0.0.2}/README.md +1 -1
- {document_manager-0.0.1 → document_manager-0.0.2}/pyproject.toml +1 -1
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/client/document_manager.py +22 -17
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/types/__init__.py +10 -12
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/types/articles.py +2 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/types/users.py +1 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/PKG-INFO +2 -2
- {document_manager-0.0.1 → document_manager-0.0.2}/setup.cfg +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/__init__.py +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/client/__init__.py +3 -3
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/client/errors.py +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/types/common.py +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/types/search.py +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/SOURCES.txt +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/dependency_links.txt +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/requires.txt +0 -0
- {document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: document_manager
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Library to interact with document management API
|
|
5
5
|
Author-email: Gergo Ferenczy <ifj.ferenczy.gergo@gmail.com>
|
|
6
6
|
License: Proprietary
|
|
@@ -25,7 +25,7 @@ A Python library for interacting with the Document Management API. Provides a cl
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
pip install
|
|
28
|
+
pip install document-manager
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Quick Start
|
{document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager/client/document_manager.py
RENAMED
|
@@ -4,37 +4,42 @@ for managing users, articles, and performing searches.
|
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
import logging
|
|
7
|
-
|
|
7
|
+
import warnings
|
|
8
|
+
from typing import List, Optional
|
|
8
9
|
from urllib.parse import urljoin
|
|
9
10
|
|
|
10
11
|
import requests
|
|
11
|
-
from pydantic import ValidationError
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
APIValidationError,
|
|
17
|
-
APIConnectionError,
|
|
18
|
-
)
|
|
13
|
+
# Hide XML parsing warnings from requests
|
|
14
|
+
from bs4 import XMLParsedAsHTMLWarning
|
|
15
|
+
from pydantic import ValidationError
|
|
19
16
|
|
|
20
17
|
from ..types import (
|
|
21
|
-
ListArticlesResponse,
|
|
22
|
-
IngestRequest,
|
|
23
18
|
ArticleResponse,
|
|
24
|
-
UpdateDoiRequest,
|
|
25
|
-
DeleteArticleRequest,
|
|
26
|
-
DeleteArticleResponse,
|
|
27
19
|
ArticleSearchRequest,
|
|
28
20
|
ArticleSearchResult,
|
|
29
21
|
ChunkSearchRequest,
|
|
30
22
|
ChunkSearchResult,
|
|
23
|
+
DeleteArticleRequest,
|
|
24
|
+
DeleteArticleResponse,
|
|
25
|
+
DeleteUserResponse,
|
|
26
|
+
IngestRequest,
|
|
27
|
+
ListArticlesResponse,
|
|
28
|
+
ListUsersResponse,
|
|
31
29
|
SummarizeRequest,
|
|
32
30
|
SummarizeResponse,
|
|
31
|
+
UpdateDoiRequest,
|
|
33
32
|
UserRequest,
|
|
34
33
|
UserResponse,
|
|
35
|
-
DeleteUserResponse,
|
|
36
|
-
ListUsersResponse,
|
|
37
34
|
)
|
|
35
|
+
from .errors import (
|
|
36
|
+
APIAuthenticationError,
|
|
37
|
+
APIConnectionError,
|
|
38
|
+
APIValidationError,
|
|
39
|
+
DocumentManagerClientError,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning)
|
|
38
43
|
|
|
39
44
|
# Configure module logger
|
|
40
45
|
logger = logging.getLogger(__name__)
|
|
@@ -68,7 +73,7 @@ class DocumentManagerClient:
|
|
|
68
73
|
base_url: str,
|
|
69
74
|
api_key: Optional[str] = None,
|
|
70
75
|
function_key: Optional[str] = None,
|
|
71
|
-
timeout: int =
|
|
76
|
+
timeout: int = 120,
|
|
72
77
|
):
|
|
73
78
|
"""Initialize the API client.
|
|
74
79
|
|
|
@@ -76,7 +81,7 @@ class DocumentManagerClient:
|
|
|
76
81
|
base_url: Base URL of the API (without trailing slash)
|
|
77
82
|
api_key: User API key for authenticated endpoints
|
|
78
83
|
function_key: Function key for admin endpoints
|
|
79
|
-
timeout: Request timeout in seconds (default:
|
|
84
|
+
timeout: Request timeout in seconds (default: 120)
|
|
80
85
|
"""
|
|
81
86
|
self.base_url = base_url.rstrip("/")
|
|
82
87
|
self.api_key = api_key
|
|
@@ -2,31 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
from .articles import (
|
|
4
4
|
ArticleListItem,
|
|
5
|
-
ListArticlesResponse,
|
|
6
|
-
IngestRequest,
|
|
7
5
|
ArticleResponse,
|
|
8
|
-
UpdateDoiRequest,
|
|
9
6
|
DeleteArticleRequest,
|
|
10
7
|
DeleteArticleResponse,
|
|
8
|
+
IngestRequest,
|
|
9
|
+
ListArticlesResponse,
|
|
10
|
+
UpdateDoiRequest,
|
|
11
11
|
)
|
|
12
|
-
from .common import
|
|
13
|
-
ErrorResponse,
|
|
14
|
-
)
|
|
12
|
+
from .common import ErrorResponse
|
|
15
13
|
from .search import (
|
|
16
|
-
ArticleSearchRequest,
|
|
17
14
|
ArticleMetadata,
|
|
15
|
+
ArticleSearchRequest,
|
|
18
16
|
ArticleSearchResult,
|
|
19
|
-
|
|
17
|
+
ArticleSummary,
|
|
20
18
|
ChunkMetadata,
|
|
19
|
+
ChunkSearchRequest,
|
|
21
20
|
ChunkSearchResult,
|
|
22
21
|
SummarizeRequest,
|
|
23
|
-
ArticleSummary,
|
|
24
22
|
SummarizeResponse,
|
|
25
23
|
)
|
|
26
24
|
from .users import (
|
|
27
|
-
UserRequest,
|
|
28
|
-
UserResponse,
|
|
29
25
|
DeleteUserResponse,
|
|
30
|
-
UserMetadata,
|
|
31
26
|
ListUsersResponse,
|
|
27
|
+
UserMetadata,
|
|
28
|
+
UserRequest,
|
|
29
|
+
UserResponse,
|
|
32
30
|
)
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"""Models for article-related API operations."""
|
|
2
2
|
|
|
3
3
|
from typing import List
|
|
4
|
+
|
|
4
5
|
from pydantic import BaseModel, Field
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class ArticleListItem(BaseModel):
|
|
8
9
|
"""Article list item model."""
|
|
9
10
|
|
|
11
|
+
article_id: str
|
|
10
12
|
file_name: str
|
|
11
13
|
authors: str
|
|
12
14
|
publisher: str
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: document_manager
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Library to interact with document management API
|
|
5
5
|
Author-email: Gergo Ferenczy <ifj.ferenczy.gergo@gmail.com>
|
|
6
6
|
License: Proprietary
|
|
@@ -25,7 +25,7 @@ A Python library for interacting with the Document Management API. Provides a cl
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
pip install
|
|
28
|
+
pip install document-manager
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Quick Start
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""API Client Handler for Document Management System."""
|
|
2
2
|
|
|
3
|
+
from .document_manager import DocumentManagerClient
|
|
3
4
|
from .errors import (
|
|
4
|
-
DocumentManagerClientError,
|
|
5
5
|
APIAuthenticationError,
|
|
6
|
-
APIValidationError,
|
|
7
6
|
APIConnectionError,
|
|
7
|
+
APIValidationError,
|
|
8
|
+
DocumentManagerClientError,
|
|
8
9
|
)
|
|
9
|
-
from .document_manager import DocumentManagerClient
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/requires.txt
RENAMED
|
File without changes
|
{document_manager-0.0.1 → document_manager-0.0.2}/src/document_manager.egg-info/top_level.txt
RENAMED
|
File without changes
|