collibra-connector 1.1.0__tar.gz → 1.1.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.
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/PKG-INFO +1 -1
- collibra_connector-1.1.2/collibra_connector/api/UserGroup.py +95 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Workflow.py +50 -16
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/__init__.py +15 -13
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/connector.py +15 -13
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/PKG-INFO +1 -1
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/SOURCES.txt +1 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/pyproject.toml +1 -1
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/LICENSE +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/README.md +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/__init__.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Asset.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Attribute.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Base.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Comment.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Community.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Domain.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Exceptions.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Metadata.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/OutputModule.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Relation.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Responsibility.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Search.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/User.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Utils.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/async_connector.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/cli.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/helpers.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/lineage.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/models.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/py.typed +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/telemetry.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/testing.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/dependency_links.txt +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/entry_points.txt +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/requires.txt +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/top_level.txt +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/setup.cfg +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_asset.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_connector.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_exceptions.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_helpers.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_lineage.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_models.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_search.py +0 -0
- {collibra_connector-1.1.0 → collibra_connector-1.1.2}/tests/test_testing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: collibra-connector
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: An UNOFFICIAL standard Python connector for the Collibra Data Governance Center API with full type safety, async support, and enterprise features.
|
|
5
5
|
Author-email: Raul Dalgamonni <rauldalgamonnialonso@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/rauldaal/collibra-python-connector
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
from .Base import BaseAPI
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class UserGroup(BaseAPI):
|
|
6
|
+
def __init__(self, connector):
|
|
7
|
+
super().__init__(connector)
|
|
8
|
+
self.__base_api = connector.api + "/userGroups"
|
|
9
|
+
|
|
10
|
+
def find_user_groups(
|
|
11
|
+
self,
|
|
12
|
+
count_limit: int = -1,
|
|
13
|
+
include_everyone: bool = None,
|
|
14
|
+
limit: int = 0,
|
|
15
|
+
name: str = None,
|
|
16
|
+
name_match_mode: str = "ANYWHERE",
|
|
17
|
+
offset: int = 0,
|
|
18
|
+
user_id: str = None
|
|
19
|
+
):
|
|
20
|
+
"""
|
|
21
|
+
Find user groups matching the given search criteria.
|
|
22
|
+
|
|
23
|
+
Returns user groups matching the given search criteria. Only parameters that are specified
|
|
24
|
+
in this request and have not null values are used for filtering. All other parameters are
|
|
25
|
+
ignored. By default a result containing 1000 user groups is returned.
|
|
26
|
+
|
|
27
|
+
:param count_limit: Limit the number of elements that will be counted. -1 counts everything,
|
|
28
|
+
0 skips count. Default: -1
|
|
29
|
+
:param include_everyone: Indicates if we should include the everyone group or not.
|
|
30
|
+
:param limit: Maximum number of results to retrieve (0 = default limit, max 1000). Default: 0
|
|
31
|
+
:param name: The name of the user group.
|
|
32
|
+
:param name_match_mode: The match mode used to compare name. If the match mode is EXACT
|
|
33
|
+
the search is case-sensitive, otherwise case-insensitive.
|
|
34
|
+
Allowed values: START, END, ANYWHERE, EXACT. Default: ANYWHERE
|
|
35
|
+
:param offset: First result to retrieve (0-based). Default: 0
|
|
36
|
+
:param user_id: The ID of the user who should belong to searched user groups.
|
|
37
|
+
:return: Search results with user groups matching the criteria.
|
|
38
|
+
"""
|
|
39
|
+
# Validate count_limit
|
|
40
|
+
if not isinstance(count_limit, int):
|
|
41
|
+
raise ValueError("count_limit must be an integer")
|
|
42
|
+
|
|
43
|
+
# Validate include_everyone
|
|
44
|
+
if include_everyone is not None and not isinstance(include_everyone, bool):
|
|
45
|
+
raise ValueError("include_everyone must be a boolean")
|
|
46
|
+
|
|
47
|
+
# Validate limit
|
|
48
|
+
if not isinstance(limit, int) or limit < 0:
|
|
49
|
+
raise ValueError("limit must be a non-negative integer")
|
|
50
|
+
if limit > 1000:
|
|
51
|
+
raise ValueError("limit cannot exceed 1000")
|
|
52
|
+
|
|
53
|
+
# Validate name
|
|
54
|
+
if name is not None and not isinstance(name, str):
|
|
55
|
+
raise ValueError("name must be a string")
|
|
56
|
+
|
|
57
|
+
# Validate name_match_mode
|
|
58
|
+
valid_match_modes = ["START", "END", "ANYWHERE", "EXACT"]
|
|
59
|
+
if name_match_mode not in valid_match_modes:
|
|
60
|
+
raise ValueError(f"Invalid name_match_mode: {name_match_mode}. "
|
|
61
|
+
f"Allowed values: {valid_match_modes}")
|
|
62
|
+
|
|
63
|
+
# Validate offset
|
|
64
|
+
if not isinstance(offset, int) or offset < 0:
|
|
65
|
+
raise ValueError("offset must be a non-negative integer")
|
|
66
|
+
|
|
67
|
+
# Validate user_id if provided
|
|
68
|
+
if user_id is not None:
|
|
69
|
+
if not isinstance(user_id, str):
|
|
70
|
+
raise ValueError("user_id must be a string")
|
|
71
|
+
try:
|
|
72
|
+
uuid.UUID(user_id)
|
|
73
|
+
except ValueError as exc:
|
|
74
|
+
raise ValueError("user_id must be a valid UUID") from exc
|
|
75
|
+
|
|
76
|
+
# Build parameters
|
|
77
|
+
params = {
|
|
78
|
+
"countLimit": count_limit,
|
|
79
|
+
"limit": limit,
|
|
80
|
+
"nameMatchMode": name_match_mode,
|
|
81
|
+
"offset": offset
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# Add optional parameters
|
|
85
|
+
if include_everyone is not None:
|
|
86
|
+
params["includeEveryone"] = include_everyone
|
|
87
|
+
|
|
88
|
+
if name is not None:
|
|
89
|
+
params["name"] = name
|
|
90
|
+
|
|
91
|
+
if user_id is not None:
|
|
92
|
+
params["userId"] = user_id
|
|
93
|
+
|
|
94
|
+
response = self._get(url=self.__base_api, params=params)
|
|
95
|
+
return self._handle_response(response)
|
|
@@ -10,15 +10,26 @@ class Workflow(BaseAPI):
|
|
|
10
10
|
def start_workflow_instance(
|
|
11
11
|
self,
|
|
12
12
|
workflow_definition_id: str,
|
|
13
|
-
|
|
13
|
+
business_item_ids: list[str] = None,
|
|
14
|
+
business_item_type: str = None,
|
|
15
|
+
form_properties: dict[str, str] = None,
|
|
16
|
+
guest_user_id: str = None,
|
|
17
|
+
send_notification: bool = False,
|
|
14
18
|
return_all: bool = False
|
|
15
19
|
):
|
|
16
20
|
"""
|
|
17
|
-
Start
|
|
18
|
-
|
|
19
|
-
:param
|
|
21
|
+
Start multiple workflow instances based on the provided request.
|
|
22
|
+
|
|
23
|
+
:param workflow_definition_id: The ID of the workflow definition (required).
|
|
24
|
+
:param business_item_ids: The list of IDs for the business items (optional).
|
|
25
|
+
:param business_item_type: The resource type of the passed in business items.
|
|
26
|
+
Allowed values: ASSET, DOMAIN, COMMUNITY, GLOBAL, USER (optional).
|
|
27
|
+
:param form_properties: The properties of the workflow as a dictionary (optional).
|
|
28
|
+
:param guest_user_id: The ID of the guest user starting the workflow (optional).
|
|
29
|
+
:param send_notification: Whether a mail notification on starting the workflows should be sent.
|
|
30
|
+
This notification is only used in the asynchronous api version (optional).
|
|
20
31
|
:param return_all: Whether to return all workflow data or just the ID.
|
|
21
|
-
:return: Workflow instance ID or full response data.
|
|
32
|
+
:return: Workflow instance ID or full response data (array of workflow instances).
|
|
22
33
|
"""
|
|
23
34
|
if not workflow_definition_id:
|
|
24
35
|
raise ValueError("workflow_definition_id is required")
|
|
@@ -32,21 +43,44 @@ class Workflow(BaseAPI):
|
|
|
32
43
|
|
|
33
44
|
data = {
|
|
34
45
|
"workflowDefinitionId": workflow_definition_id,
|
|
35
|
-
"sendNotification":
|
|
46
|
+
"sendNotification": send_notification
|
|
36
47
|
}
|
|
37
48
|
|
|
38
|
-
if
|
|
39
|
-
if not isinstance(
|
|
40
|
-
raise ValueError("
|
|
49
|
+
if business_item_ids is not None:
|
|
50
|
+
if not isinstance(business_item_ids, list):
|
|
51
|
+
raise ValueError("business_item_ids must be a list")
|
|
52
|
+
if not all(isinstance(item_id, str) for item_id in business_item_ids):
|
|
53
|
+
raise ValueError("All business_item_ids must be strings")
|
|
54
|
+
for item_id in business_item_ids:
|
|
55
|
+
try:
|
|
56
|
+
uuid.UUID(item_id)
|
|
57
|
+
except ValueError as exc:
|
|
58
|
+
raise ValueError(f"business_item_id '{item_id}' must be a valid UUID") from exc
|
|
59
|
+
data["businessItemIds"] = business_item_ids
|
|
60
|
+
|
|
61
|
+
if business_item_type is not None:
|
|
62
|
+
if not isinstance(business_item_type, str):
|
|
63
|
+
raise ValueError("business_item_type must be a string")
|
|
64
|
+
valid_types = ["ASSET", "DOMAIN", "COMMUNITY", "GLOBAL", "USER"]
|
|
65
|
+
if business_item_type not in valid_types:
|
|
66
|
+
raise ValueError(f"business_item_type must be one of: {', '.join(valid_types)}")
|
|
67
|
+
data["businessItemType"] = business_item_type
|
|
68
|
+
|
|
69
|
+
if form_properties is not None:
|
|
70
|
+
if not isinstance(form_properties, dict):
|
|
71
|
+
raise ValueError("form_properties must be a dictionary")
|
|
72
|
+
if not all(isinstance(k, str) and isinstance(v, str) for k, v in form_properties.items()):
|
|
73
|
+
raise ValueError("All form_properties keys and values must be strings")
|
|
74
|
+
data["formProperties"] = form_properties
|
|
75
|
+
|
|
76
|
+
if guest_user_id is not None:
|
|
77
|
+
if not isinstance(guest_user_id, str):
|
|
78
|
+
raise ValueError("guest_user_id must be a string")
|
|
41
79
|
try:
|
|
42
|
-
uuid.UUID(
|
|
80
|
+
uuid.UUID(guest_user_id)
|
|
43
81
|
except ValueError as exc:
|
|
44
|
-
raise ValueError("
|
|
45
|
-
|
|
46
|
-
data.update({
|
|
47
|
-
"businessItemIds": [asset_id],
|
|
48
|
-
"businessItemType": "ASSET",
|
|
49
|
-
})
|
|
82
|
+
raise ValueError("guest_user_id must be a valid UUID") from exc
|
|
83
|
+
data["guestUserId"] = guest_user_id
|
|
50
84
|
|
|
51
85
|
response = self._post(url=f"{self.__base_api}/workflowInstances", data=data)
|
|
52
86
|
result = self._handle_response(response)
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
from .Asset import Asset
|
|
2
2
|
from .Attribute import Attribute
|
|
3
|
+
from .Comment import Comment
|
|
3
4
|
from .Community import Community
|
|
4
5
|
from .Domain import Domain
|
|
5
|
-
from .User import User
|
|
6
|
-
from .Responsibility import Responsibility
|
|
7
|
-
from .Workflow import Workflow
|
|
8
6
|
from .Metadata import Metadata
|
|
9
|
-
from .Comment import Comment
|
|
10
|
-
from .Relation import Relation
|
|
11
7
|
from .OutputModule import OutputModule
|
|
12
|
-
from .
|
|
8
|
+
from .Relation import Relation
|
|
9
|
+
from .Responsibility import Responsibility
|
|
13
10
|
from .Search import Search
|
|
11
|
+
from .User import User
|
|
12
|
+
from .UserGroup import UserGroup
|
|
13
|
+
from .Utils import Utils
|
|
14
|
+
from .Workflow import Workflow
|
|
14
15
|
|
|
15
16
|
__all__ = [
|
|
16
17
|
"Asset",
|
|
17
18
|
"Attribute",
|
|
19
|
+
"Comment",
|
|
18
20
|
"Community",
|
|
19
21
|
"Domain",
|
|
20
|
-
"User",
|
|
21
|
-
"Responsibility",
|
|
22
|
-
"Workflow",
|
|
23
22
|
"Metadata",
|
|
24
|
-
"Comment",
|
|
25
|
-
"Relation",
|
|
26
23
|
"OutputModule",
|
|
24
|
+
"Relation",
|
|
25
|
+
"Responsibility",
|
|
26
|
+
"Search",
|
|
27
|
+
"User",
|
|
28
|
+
"UserGroup",
|
|
27
29
|
"Utils",
|
|
28
|
-
"
|
|
29
|
-
]
|
|
30
|
+
"Workflow",
|
|
31
|
+
]
|
|
@@ -16,17 +16,18 @@ from requests.auth import HTTPBasicAuth
|
|
|
16
16
|
from .api import (
|
|
17
17
|
Asset,
|
|
18
18
|
Attribute,
|
|
19
|
+
Comment,
|
|
19
20
|
Community,
|
|
20
21
|
Domain,
|
|
21
|
-
User,
|
|
22
|
-
Responsibility,
|
|
23
|
-
Workflow,
|
|
24
22
|
Metadata,
|
|
25
|
-
Comment,
|
|
26
|
-
Relation,
|
|
27
23
|
OutputModule,
|
|
24
|
+
Relation,
|
|
25
|
+
Responsibility,
|
|
26
|
+
Search,
|
|
27
|
+
User,
|
|
28
|
+
UserGroup,
|
|
28
29
|
Utils,
|
|
29
|
-
|
|
30
|
+
Workflow,
|
|
30
31
|
)
|
|
31
32
|
|
|
32
33
|
if TYPE_CHECKING:
|
|
@@ -85,7 +86,7 @@ class CollibraConnector:
|
|
|
85
86
|
) -> None:
|
|
86
87
|
"""
|
|
87
88
|
Initialize the CollibraConnector with API URL and authentication credentials.
|
|
88
|
-
|
|
89
|
+
|
|
89
90
|
Credentials can be provided as arguments or via environment variables:
|
|
90
91
|
COLLIBRA_URL, COLLIBRA_USERNAME, COLLIBRA_PASSWORD.
|
|
91
92
|
|
|
@@ -130,18 +131,19 @@ class CollibraConnector:
|
|
|
130
131
|
# Initialize all API classes
|
|
131
132
|
self.asset: Asset = Asset(self)
|
|
132
133
|
self.attribute: Attribute = Attribute(self)
|
|
134
|
+
self.comment: Comment = Comment(self)
|
|
133
135
|
self.community: Community = Community(self)
|
|
134
136
|
self.domain: Domain = Domain(self)
|
|
135
|
-
self.user: User = User(self)
|
|
136
137
|
self.responsibility: Responsibility = Responsibility(self)
|
|
137
|
-
self.workflow: Workflow = Workflow(self)
|
|
138
138
|
self.metadata: Metadata = Metadata(self)
|
|
139
|
-
self.comment: Comment = Comment(self)
|
|
140
|
-
self.relation: Relation = Relation(self)
|
|
141
139
|
self.output_module: OutputModule = OutputModule(self)
|
|
142
|
-
self.
|
|
140
|
+
self.relation: Relation = Relation(self)
|
|
143
141
|
self.search: Search = Search(self)
|
|
144
|
-
|
|
142
|
+
self.user: User = User(self)
|
|
143
|
+
self.user_group: UserGroup = UserGroup(self)
|
|
144
|
+
self.utils: Utils = Utils(self)
|
|
145
|
+
self.workflow: Workflow = Workflow(self)
|
|
146
|
+
|
|
145
147
|
# Initialize Logger without basicConfig
|
|
146
148
|
self.logger: logging.Logger = logging.getLogger(__name__)
|
|
147
149
|
self.logger.addHandler(logging.NullHandler())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: collibra-connector
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: An UNOFFICIAL standard Python connector for the Collibra Data Governance Center API with full type safety, async support, and enterprise features.
|
|
5
5
|
Author-email: Raul Dalgamonni <rauldalgamonnialonso@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/rauldaal/collibra-python-connector
|
{collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/SOURCES.txt
RENAMED
|
@@ -30,6 +30,7 @@ collibra_connector/api/Relation.py
|
|
|
30
30
|
collibra_connector/api/Responsibility.py
|
|
31
31
|
collibra_connector/api/Search.py
|
|
32
32
|
collibra_connector/api/User.py
|
|
33
|
+
collibra_connector/api/UserGroup.py
|
|
33
34
|
collibra_connector/api/Utils.py
|
|
34
35
|
collibra_connector/api/Workflow.py
|
|
35
36
|
collibra_connector/api/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/OutputModule.py
RENAMED
|
File without changes
|
|
File without changes
|
{collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector/api/Responsibility.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/requires.txt
RENAMED
|
File without changes
|
{collibra_connector-1.1.0 → collibra_connector-1.1.2}/collibra_connector.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|