poelis-sdk 0.1.8__tar.gz → 0.1.9__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.
Potentially problematic release.
This version of poelis-sdk might be problematic. Click here for more details.
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/PKG-INFO +1 -1
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/notebooks/try_poelis_sdk.ipynb +2 -50
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/pyproject.toml +1 -1
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/browser.py +31 -9
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/items.py +3 -12
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/uv.lock +1 -1
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/.github/workflows/ci.yml +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/.github/workflows/codeql.yml +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/.github/workflows/publish-on-push.yml +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/.gitignore +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/LICENSE +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/README.md +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/__init__.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/_transport.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/auth0.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/client.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/exceptions.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/logging.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/models.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/org_validation.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/products.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/search.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/poelis_sdk/workspaces.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/tests/test_client_basic.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/tests/test_errors_and_backoff.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/tests/test_items_client.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/tests/test_search_client.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/src/tests/test_transport_and_products.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/tests/__init__.py +0 -0
- {poelis_sdk-0.1.8 → poelis_sdk-0.1.9}/tests/test_integration_smoke.py +0 -0
|
@@ -45,57 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"cell_type": "code",
|
|
48
|
-
"execution_count":
|
|
48
|
+
"execution_count": null,
|
|
49
49
|
"metadata": {},
|
|
50
|
-
"outputs": [
|
|
51
|
-
{
|
|
52
|
-
"name": "stdout",
|
|
53
|
-
"output_type": "stream",
|
|
54
|
-
"text": [
|
|
55
|
-
"Requirement already satisfied: poelis-sdk in /opt/homebrew/lib/python3.11/site-packages (0.1.7)\n",
|
|
56
|
-
"Requirement already satisfied: build>=1.3.0 in /opt/homebrew/lib/python3.11/site-packages (from poelis-sdk) (1.3.0)\n",
|
|
57
|
-
"Requirement already satisfied: httpx>=0.27 in /opt/homebrew/lib/python3.11/site-packages (from poelis-sdk) (0.28.1)\n",
|
|
58
|
-
"Requirement already satisfied: pydantic>=2.7 in /opt/homebrew/lib/python3.11/site-packages (from poelis-sdk) (2.12.0)\n",
|
|
59
|
-
"Requirement already satisfied: twine>=6.2.0 in /opt/homebrew/lib/python3.11/site-packages (from poelis-sdk) (6.2.0)\n",
|
|
60
|
-
"Requirement already satisfied: packaging>=19.1 in /opt/homebrew/lib/python3.11/site-packages (from build>=1.3.0->poelis-sdk) (25.0)\n",
|
|
61
|
-
"Requirement already satisfied: pyproject_hooks in /opt/homebrew/lib/python3.11/site-packages (from build>=1.3.0->poelis-sdk) (1.2.0)\n",
|
|
62
|
-
"Requirement already satisfied: anyio in /opt/homebrew/lib/python3.11/site-packages (from httpx>=0.27->poelis-sdk) (4.11.0)\n",
|
|
63
|
-
"Requirement already satisfied: certifi in /opt/homebrew/lib/python3.11/site-packages (from httpx>=0.27->poelis-sdk) (2025.10.5)\n",
|
|
64
|
-
"Requirement already satisfied: httpcore==1.* in /opt/homebrew/lib/python3.11/site-packages (from httpx>=0.27->poelis-sdk) (1.0.9)\n",
|
|
65
|
-
"Requirement already satisfied: idna in /opt/homebrew/lib/python3.11/site-packages (from httpx>=0.27->poelis-sdk) (3.10)\n",
|
|
66
|
-
"Requirement already satisfied: h11>=0.16 in /opt/homebrew/lib/python3.11/site-packages (from httpcore==1.*->httpx>=0.27->poelis-sdk) (0.16.0)\n",
|
|
67
|
-
"Requirement already satisfied: annotated-types>=0.6.0 in /opt/homebrew/lib/python3.11/site-packages (from pydantic>=2.7->poelis-sdk) (0.7.0)\n",
|
|
68
|
-
"Requirement already satisfied: pydantic-core==2.41.1 in /opt/homebrew/lib/python3.11/site-packages (from pydantic>=2.7->poelis-sdk) (2.41.1)\n",
|
|
69
|
-
"Requirement already satisfied: typing-extensions>=4.14.1 in /opt/homebrew/lib/python3.11/site-packages (from pydantic>=2.7->poelis-sdk) (4.15.0)\n",
|
|
70
|
-
"Requirement already satisfied: typing-inspection>=0.4.2 in /opt/homebrew/lib/python3.11/site-packages (from pydantic>=2.7->poelis-sdk) (0.4.2)\n",
|
|
71
|
-
"Requirement already satisfied: readme-renderer>=35.0 in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (44.0)\n",
|
|
72
|
-
"Requirement already satisfied: requests>=2.20 in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (2.32.5)\n",
|
|
73
|
-
"Requirement already satisfied: requests-toolbelt!=0.9.0,>=0.8.0 in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (1.0.0)\n",
|
|
74
|
-
"Requirement already satisfied: urllib3>=1.26.0 in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (2.5.0)\n",
|
|
75
|
-
"Requirement already satisfied: keyring>=21.2.0 in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (25.6.0)\n",
|
|
76
|
-
"Requirement already satisfied: rfc3986>=1.4.0 in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (2.0.0)\n",
|
|
77
|
-
"Requirement already satisfied: rich>=12.0.0 in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (14.1.0)\n",
|
|
78
|
-
"Requirement already satisfied: id in /opt/homebrew/lib/python3.11/site-packages (from twine>=6.2.0->poelis-sdk) (1.5.0)\n",
|
|
79
|
-
"Requirement already satisfied: importlib_metadata>=4.11.4 in /opt/homebrew/lib/python3.11/site-packages (from keyring>=21.2.0->twine>=6.2.0->poelis-sdk) (8.7.0)\n",
|
|
80
|
-
"Requirement already satisfied: jaraco.classes in /opt/homebrew/lib/python3.11/site-packages (from keyring>=21.2.0->twine>=6.2.0->poelis-sdk) (3.4.0)\n",
|
|
81
|
-
"Requirement already satisfied: jaraco.functools in /opt/homebrew/lib/python3.11/site-packages (from keyring>=21.2.0->twine>=6.2.0->poelis-sdk) (4.3.0)\n",
|
|
82
|
-
"Requirement already satisfied: jaraco.context in /opt/homebrew/lib/python3.11/site-packages (from keyring>=21.2.0->twine>=6.2.0->poelis-sdk) (6.0.1)\n",
|
|
83
|
-
"Requirement already satisfied: zipp>=3.20 in /opt/homebrew/lib/python3.11/site-packages (from importlib_metadata>=4.11.4->keyring>=21.2.0->twine>=6.2.0->poelis-sdk) (3.23.0)\n",
|
|
84
|
-
"Requirement already satisfied: nh3>=0.2.14 in /opt/homebrew/lib/python3.11/site-packages (from readme-renderer>=35.0->twine>=6.2.0->poelis-sdk) (0.3.1)\n",
|
|
85
|
-
"Requirement already satisfied: docutils>=0.21.2 in /opt/homebrew/lib/python3.11/site-packages (from readme-renderer>=35.0->twine>=6.2.0->poelis-sdk) (0.22.2)\n",
|
|
86
|
-
"Requirement already satisfied: Pygments>=2.5.1 in /opt/homebrew/lib/python3.11/site-packages (from readme-renderer>=35.0->twine>=6.2.0->poelis-sdk) (2.19.2)\n",
|
|
87
|
-
"Requirement already satisfied: charset_normalizer<4,>=2 in /opt/homebrew/lib/python3.11/site-packages (from requests>=2.20->twine>=6.2.0->poelis-sdk) (3.4.3)\n",
|
|
88
|
-
"Requirement already satisfied: markdown-it-py>=2.2.0 in /opt/homebrew/lib/python3.11/site-packages (from rich>=12.0.0->twine>=6.2.0->poelis-sdk) (4.0.0)\n",
|
|
89
|
-
"Requirement already satisfied: mdurl~=0.1 in /opt/homebrew/lib/python3.11/site-packages (from markdown-it-py>=2.2.0->rich>=12.0.0->twine>=6.2.0->poelis-sdk) (0.1.2)\n",
|
|
90
|
-
"Requirement already satisfied: sniffio>=1.1 in /opt/homebrew/lib/python3.11/site-packages (from anyio->httpx>=0.27->poelis-sdk) (1.3.1)\n",
|
|
91
|
-
"Requirement already satisfied: more-itertools in /opt/homebrew/lib/python3.11/site-packages (from jaraco.classes->keyring>=21.2.0->twine>=6.2.0->poelis-sdk) (10.8.0)\n",
|
|
92
|
-
"Requirement already satisfied: backports.tarfile in /opt/homebrew/lib/python3.11/site-packages (from jaraco.context->keyring>=21.2.0->twine>=6.2.0->poelis-sdk) (1.2.0)\n",
|
|
93
|
-
"\n",
|
|
94
|
-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m25.1.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.2\u001b[0m\n",
|
|
95
|
-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49m/opt/homebrew/opt/python@3.11/bin/python3.11 -m pip install --upgrade pip\u001b[0m\n"
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
],
|
|
50
|
+
"outputs": [],
|
|
99
51
|
"source": [
|
|
100
52
|
"!pip install -U poelis-sdk"
|
|
101
53
|
]
|
|
@@ -99,11 +99,11 @@ class _Node:
|
|
|
99
99
|
if self._level != "item":
|
|
100
100
|
self._props_cache = []
|
|
101
101
|
return self._props_cache
|
|
102
|
-
# Try direct properties(
|
|
102
|
+
# Try direct properties(itemId: ...) first; fallback to searchProperties
|
|
103
103
|
q = (
|
|
104
104
|
"query($iid: ID!) {\n"
|
|
105
|
-
" properties(
|
|
106
|
-
" __typename
|
|
105
|
+
" properties(itemId: $iid) {\n"
|
|
106
|
+
" __typename\n"
|
|
107
107
|
" ... on NumericProperty { integerPart exponent category }\n"
|
|
108
108
|
" ... on TextProperty { value }\n"
|
|
109
109
|
" ... on DateProperty { value }\n"
|
|
@@ -121,7 +121,7 @@ class _Node:
|
|
|
121
121
|
q2 = (
|
|
122
122
|
"query($iid: ID!, $limit: Int!, $offset: Int!) {\n"
|
|
123
123
|
" searchProperties(q: \"*\", itemId: $iid, limit: $limit, offset: $offset) {\n"
|
|
124
|
-
" hits { id
|
|
124
|
+
" hits { id workspaceId productId itemId propertyType name category value owner }\n"
|
|
125
125
|
" }\n"
|
|
126
126
|
"}"
|
|
127
127
|
)
|
|
@@ -139,9 +139,19 @@ class _Node:
|
|
|
139
139
|
if self._level != "item":
|
|
140
140
|
return out
|
|
141
141
|
props = self.properties
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
used_names: Dict[str, int] = {}
|
|
143
|
+
for i, pr in enumerate(props):
|
|
144
|
+
# Try to get name from various possible fields
|
|
145
|
+
display = pr.get("name") or pr.get("id") or pr.get("category") or f"property_{i}"
|
|
144
146
|
safe = _safe_key(str(display))
|
|
147
|
+
|
|
148
|
+
# Handle duplicate names by adding a suffix
|
|
149
|
+
if safe in used_names:
|
|
150
|
+
used_names[safe] += 1
|
|
151
|
+
safe = f"{safe}_{used_names[safe]}"
|
|
152
|
+
else:
|
|
153
|
+
used_names[safe] = 0
|
|
154
|
+
|
|
145
155
|
out[safe] = _PropWrapper(pr)
|
|
146
156
|
return out
|
|
147
157
|
|
|
@@ -246,11 +256,23 @@ class _PropsNode:
|
|
|
246
256
|
if self._children_cache:
|
|
247
257
|
return
|
|
248
258
|
props = self._item.properties
|
|
249
|
-
|
|
250
|
-
|
|
259
|
+
used_names: Dict[str, int] = {}
|
|
260
|
+
names_list = []
|
|
261
|
+
for i, pr in enumerate(props):
|
|
262
|
+
# Try to get name from various possible fields
|
|
263
|
+
display = pr.get("name") or pr.get("id") or pr.get("category") or f"property_{i}"
|
|
251
264
|
safe = _safe_key(str(display))
|
|
265
|
+
|
|
266
|
+
# Handle duplicate names by adding a suffix
|
|
267
|
+
if safe in used_names:
|
|
268
|
+
used_names[safe] += 1
|
|
269
|
+
safe = f"{safe}_{used_names[safe]}"
|
|
270
|
+
else:
|
|
271
|
+
used_names[safe] = 0
|
|
272
|
+
|
|
252
273
|
self._children_cache[safe] = _PropWrapper(pr)
|
|
253
|
-
|
|
274
|
+
names_list.append(display)
|
|
275
|
+
self._names = names_list
|
|
254
276
|
|
|
255
277
|
def __dir__(self) -> List[str]: # pragma: no cover - notebook UX
|
|
256
278
|
self._ensure_loaded()
|
|
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|
|
3
3
|
from typing import Generator, Any, Optional, Dict, List
|
|
4
4
|
|
|
5
5
|
from ._transport import Transport
|
|
6
|
-
from .org_validation import validate_item_organization, filter_by_organization
|
|
7
6
|
|
|
8
7
|
"""Items resource client."""
|
|
9
8
|
|
|
@@ -22,7 +21,7 @@ class ItemsClient:
|
|
|
22
21
|
|
|
23
22
|
query = (
|
|
24
23
|
"query($pid: ID!, $q: String, $limit: Int!, $offset: Int!) {\n"
|
|
25
|
-
" items(productId: $pid, q: $q, limit: $limit, offset: $offset) { id name code description productId parentId owner
|
|
24
|
+
" items(productId: $pid, q: $q, limit: $limit, offset: $offset) { id name code description productId parentId owner }\n"
|
|
26
25
|
"}"
|
|
27
26
|
)
|
|
28
27
|
variables = {"pid": product_id, "q": q, "limit": int(limit), "offset": int(offset)}
|
|
@@ -34,11 +33,7 @@ class ItemsClient:
|
|
|
34
33
|
|
|
35
34
|
items = payload.get("data", {}).get("items", [])
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
expected_org_id = self._t._org_id
|
|
39
|
-
filtered_items = filter_by_organization(items, expected_org_id, "items")
|
|
40
|
-
|
|
41
|
-
return filtered_items
|
|
36
|
+
return items
|
|
42
37
|
|
|
43
38
|
def get(self, item_id: str) -> Dict[str, Any]:
|
|
44
39
|
"""Get a single item by id via GraphQL.
|
|
@@ -48,7 +43,7 @@ class ItemsClient:
|
|
|
48
43
|
|
|
49
44
|
query = (
|
|
50
45
|
"query($id: ID!) {\n"
|
|
51
|
-
" item(id: $id) { id name code description productId parentId owner
|
|
46
|
+
" item(id: $id) { id name code description productId parentId owner }\n"
|
|
52
47
|
"}"
|
|
53
48
|
)
|
|
54
49
|
resp = self._t.graphql(query=query, variables={"id": item_id})
|
|
@@ -61,10 +56,6 @@ class ItemsClient:
|
|
|
61
56
|
if item is None:
|
|
62
57
|
raise RuntimeError(f"Item with id '{item_id}' not found")
|
|
63
58
|
|
|
64
|
-
# Validate that the item belongs to the configured organization
|
|
65
|
-
expected_org_id = self._t._org_id
|
|
66
|
-
validate_item_organization(item, expected_org_id)
|
|
67
|
-
|
|
68
59
|
return item
|
|
69
60
|
|
|
70
61
|
def iter_all_by_product(self, *, product_id: str, q: Optional[str] = None, page_size: int = 100) -> Generator[dict, None, None]:
|
|
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
|
|
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
|