collibra-connector 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl

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.
@@ -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)
@@ -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 .Utils import Utils
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
- "Search"
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
- Search
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.utils: Utils = Utils(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.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
@@ -1,7 +1,7 @@
1
1
  collibra_connector/__init__.py,sha256=_v9ZZdcmpiqO_sRHxH91iQ9j5EybGHKGzzjn6mmM6uI,8455
2
2
  collibra_connector/async_connector.py,sha256=u90fNMkEfrhaWV7E4Jmy6MIwq_MSFrHOZTuF22Gfw6Q,30035
3
3
  collibra_connector/cli.py,sha256=xQ4sv8lOSdEqJh_l8u3yUJ5J90nfwWtaGtaH3lhzMTg,21070
4
- collibra_connector/connector.py,sha256=FexvbCc3u2b35OC6OoMVOqLXziUNEweMM8KLPpsUAJc,10902
4
+ collibra_connector/connector.py,sha256=AlKg-qYdbOahLStaXlcF5a9N11ZYwLvINckQL9nUgwQ,10955
5
5
  collibra_connector/helpers.py,sha256=rI_ktaSoBJJHAPfHS2BkNhiaD-QUTYerTpMKyxcokgQ,27284
6
6
  collibra_connector/lineage.py,sha256=nKHEslyW_EQDVCZPTBKQezGFYnc_myQivZhpBtUB5Xg,23752
7
7
  collibra_connector/models.py,sha256=eQzHwg8y7iUjUG7TkZ9zS5gPAdLHgMLJGJyIbv8YPEo,33116
@@ -21,12 +21,13 @@ collibra_connector/api/Relation.py,sha256=JigNrLBCtisQnoA1BMzHapilfmkY2Mgg67kVoR
21
21
  collibra_connector/api/Responsibility.py,sha256=sUJw3IB5IQmMRw1Iur2ZieZg-4MDu4j7gfQc90FaD0c,14146
22
22
  collibra_connector/api/Search.py,sha256=0Trq03PnuroX9FFHxM1Herdqnq0ObY0Tsp5FaOgPgSs,3255
23
23
  collibra_connector/api/User.py,sha256=rUfnR0x_vnIk8h2SJ0RITpC4nKPw-e3-zwKIK8ZEuKc,7776
24
+ collibra_connector/api/UserGroup.py,sha256=9mUkEpAbjhRW-t33nzqYhFHiTS_XrLabROfBdCTCvt8,3795
24
25
  collibra_connector/api/Utils.py,sha256=W_XC-ypF_dh0zeqN2RMdyJIQzuQJ0nBysKctee8jZAg,5262
25
26
  collibra_connector/api/Workflow.py,sha256=H3bWwp6QsxkSAXzELspLFzxUkLi7kL026TFf1CyO98E,12729
26
- collibra_connector/api/__init__.py,sha256=wPQd8yaA1BHVzdVtHMPoLjU6nFRJ0EYAuQPAbvrmcms,615
27
- collibra_connector-1.1.1.dist-info/licenses/LICENSE,sha256=6KmWWtAu_q58gerPlrnkgsmGM2l8j6Wc_VL0y4S_ip4,1079
28
- collibra_connector-1.1.1.dist-info/METADATA,sha256=CjQXgwrBWRawKv70iSwD7cvyxeg3goPBARrkG_Oe5I8,14545
29
- collibra_connector-1.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
30
- collibra_connector-1.1.1.dist-info/entry_points.txt,sha256=zlG5yxZgcgj760CjxUGt4bPrwzvYHThedSs0WAIBhWY,61
31
- collibra_connector-1.1.1.dist-info/top_level.txt,sha256=Vs-kR64zf__ebL2j3_AEx7rhO6xkwgmHUFRzxlQPgTQ,19
32
- collibra_connector-1.1.1.dist-info/RECORD,,
27
+ collibra_connector/api/__init__.py,sha256=qNnVU_A8C8T-yNAdcCXJAQVpECtbYJeXs9xLUG7-xjM,667
28
+ collibra_connector-1.1.2.dist-info/licenses/LICENSE,sha256=6KmWWtAu_q58gerPlrnkgsmGM2l8j6Wc_VL0y4S_ip4,1079
29
+ collibra_connector-1.1.2.dist-info/METADATA,sha256=FL_Xz3d9pTb5Ged2iZZvDIA0bLyRvGKIsCiOPqzddHY,14545
30
+ collibra_connector-1.1.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
31
+ collibra_connector-1.1.2.dist-info/entry_points.txt,sha256=zlG5yxZgcgj760CjxUGt4bPrwzvYHThedSs0WAIBhWY,61
32
+ collibra_connector-1.1.2.dist-info/top_level.txt,sha256=Vs-kR64zf__ebL2j3_AEx7rhO6xkwgmHUFRzxlQPgTQ,19
33
+ collibra_connector-1.1.2.dist-info/RECORD,,