poelis-sdk 0.3.5__tar.gz → 0.3.6__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.3.6/PKG-INFO +121 -0
- poelis_sdk-0.3.6/README.md +98 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/notebooks/try_poelis_sdk.ipynb +191 -24
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/pyproject.toml +5 -1
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/uv.lock +1 -1
- poelis_sdk-0.3.5/PKG-INFO +0 -99
- poelis_sdk-0.3.5/README.md +0 -76
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/.github/workflows/ci.yml +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/.github/workflows/codeql.yml +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/.github/workflows/publish-on-push.yml +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/.gitignore +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/LICENSE +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/__init__.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/_transport.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/browser.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/client.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/exceptions.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/items.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/logging.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/models.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/org_validation.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/products.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/search.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/poelis_sdk/workspaces.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/tests/test_client_basic.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/tests/test_errors_and_backoff.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/tests/test_items_client.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/tests/test_search_client.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/src/tests/test_transport_and_products.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/tests/__init__.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/tests/test_browser_navigation.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/tests/test_integration_smoke.py +0 -0
- {poelis_sdk-0.3.5 → poelis_sdk-0.3.6}/tests/test_typed_properties.py +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: poelis-sdk
|
|
3
|
+
Version: 0.3.6
|
|
4
|
+
Summary: Official Python SDK for Poelis
|
|
5
|
+
Project-URL: Homepage, https://poelis.com
|
|
6
|
+
Project-URL: Source, https://github.com/PoelisTechnologies/poelis-python-sdk
|
|
7
|
+
Project-URL: Issues, https://github.com/PoelisTechnologies/poelis-python-sdk/issues
|
|
8
|
+
Author-email: Matteo Braceschi <matteo@poelis.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api,client,poelis,sdk
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Requires-Dist: build>=1.3.0
|
|
19
|
+
Requires-Dist: httpx>=0.27
|
|
20
|
+
Requires-Dist: pydantic>=2.7
|
|
21
|
+
Requires-Dist: twine>=6.2.0
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# Poelis Python SDK
|
|
25
|
+
|
|
26
|
+
Python SDK for Poelis - explore your data with simple dot notation.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install -U poelis-sdk
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Requires Python 3.11+.
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from poelis_sdk import PoelisClient
|
|
40
|
+
|
|
41
|
+
# Create client
|
|
42
|
+
poelis = PoelisClient(
|
|
43
|
+
api_key="poelis_live_A1B2C3...", # Get from Organization Settings → API Keys
|
|
44
|
+
org_id="tenant_uci_001", # Same section
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Use the browser for easy exploration
|
|
48
|
+
poelis = poelis.browser # Now you can use dot notation!
|
|
49
|
+
|
|
50
|
+
# Explore your data
|
|
51
|
+
poelis.workspace_name.product_name.item_name
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Getting Your Credentials
|
|
55
|
+
|
|
56
|
+
1. Go to **Organization Settings → API Keys**
|
|
57
|
+
2. Click **"Create API key"** (read-only recommended)
|
|
58
|
+
3. Copy the key (shown only once) and your `org_id`
|
|
59
|
+
4. Store securely as environment variables:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
export POELIS_API_KEY=poelis_live_A1B2C3...
|
|
63
|
+
export POELIS_ORG_ID=tenant_uci_001
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Browser Usage
|
|
67
|
+
|
|
68
|
+
The browser lets you navigate your Poelis data with simple dot notation:
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
# Navigate through your data
|
|
72
|
+
poelis = poelis.browser
|
|
73
|
+
|
|
74
|
+
# List workspaces
|
|
75
|
+
poelis.names() # ['workspace1', 'workspace2', ...]
|
|
76
|
+
|
|
77
|
+
# Access workspace
|
|
78
|
+
ws = poelis.workspace1
|
|
79
|
+
|
|
80
|
+
# List products in workspace
|
|
81
|
+
ws.names() # ['product1', 'product2', ...]
|
|
82
|
+
|
|
83
|
+
# Access product
|
|
84
|
+
product = ws.product1
|
|
85
|
+
|
|
86
|
+
# List items in product
|
|
87
|
+
product.names() # ['item1', 'item2', ...]
|
|
88
|
+
|
|
89
|
+
# Access item and its properties
|
|
90
|
+
item = product.item1
|
|
91
|
+
item_value = item.some_property.value # Access property values directly
|
|
92
|
+
item_category = item.some_property.category # Access property categories directly
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## IDE Compatibility & Autocomplete
|
|
97
|
+
|
|
98
|
+
The Poelis SDK works in all Python environments, but autocomplete behavior varies by IDE:
|
|
99
|
+
|
|
100
|
+
### ✅ VS Code (Recommended for Notebooks)
|
|
101
|
+
- **Autocomplete**: Works perfectly with dynamic attributes
|
|
102
|
+
- **Setup**: No configuration needed
|
|
103
|
+
- **Experience**: Full autocomplete at all levels
|
|
104
|
+
|
|
105
|
+
### ⚠️ PyCharm (Jupyter Notebooks)
|
|
106
|
+
- **Autocomplete**: Limited - PyCharm uses static analysis and doesn't see dynamic attributes
|
|
107
|
+
- **Code execution**: Works perfectly (attributes are real and functional)
|
|
108
|
+
- **Workaround**: Call `names()` at each level to prime autocomplete
|
|
109
|
+
|
|
110
|
+
## Examples
|
|
111
|
+
|
|
112
|
+
See `notebooks/try_poelis_sdk.ipynb` for complete examples including authentication, data exploration, and search queries.
|
|
113
|
+
|
|
114
|
+
## Requirements
|
|
115
|
+
|
|
116
|
+
- Python >= 3.11
|
|
117
|
+
- API base URL reachable from your environment
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Poelis Python SDK
|
|
2
|
+
|
|
3
|
+
Python SDK for Poelis - explore your data with simple dot notation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install -U poelis-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Python 3.11+.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from poelis_sdk import PoelisClient
|
|
17
|
+
|
|
18
|
+
# Create client
|
|
19
|
+
poelis = PoelisClient(
|
|
20
|
+
api_key="poelis_live_A1B2C3...", # Get from Organization Settings → API Keys
|
|
21
|
+
org_id="tenant_uci_001", # Same section
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# Use the browser for easy exploration
|
|
25
|
+
poelis = poelis.browser # Now you can use dot notation!
|
|
26
|
+
|
|
27
|
+
# Explore your data
|
|
28
|
+
poelis.workspace_name.product_name.item_name
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Getting Your Credentials
|
|
32
|
+
|
|
33
|
+
1. Go to **Organization Settings → API Keys**
|
|
34
|
+
2. Click **"Create API key"** (read-only recommended)
|
|
35
|
+
3. Copy the key (shown only once) and your `org_id`
|
|
36
|
+
4. Store securely as environment variables:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
export POELIS_API_KEY=poelis_live_A1B2C3...
|
|
40
|
+
export POELIS_ORG_ID=tenant_uci_001
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Browser Usage
|
|
44
|
+
|
|
45
|
+
The browser lets you navigate your Poelis data with simple dot notation:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
# Navigate through your data
|
|
49
|
+
poelis = poelis.browser
|
|
50
|
+
|
|
51
|
+
# List workspaces
|
|
52
|
+
poelis.names() # ['workspace1', 'workspace2', ...]
|
|
53
|
+
|
|
54
|
+
# Access workspace
|
|
55
|
+
ws = poelis.workspace1
|
|
56
|
+
|
|
57
|
+
# List products in workspace
|
|
58
|
+
ws.names() # ['product1', 'product2', ...]
|
|
59
|
+
|
|
60
|
+
# Access product
|
|
61
|
+
product = ws.product1
|
|
62
|
+
|
|
63
|
+
# List items in product
|
|
64
|
+
product.names() # ['item1', 'item2', ...]
|
|
65
|
+
|
|
66
|
+
# Access item and its properties
|
|
67
|
+
item = product.item1
|
|
68
|
+
item_value = item.some_property.value # Access property values directly
|
|
69
|
+
item_category = item.some_property.category # Access property categories directly
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## IDE Compatibility & Autocomplete
|
|
74
|
+
|
|
75
|
+
The Poelis SDK works in all Python environments, but autocomplete behavior varies by IDE:
|
|
76
|
+
|
|
77
|
+
### ✅ VS Code (Recommended for Notebooks)
|
|
78
|
+
- **Autocomplete**: Works perfectly with dynamic attributes
|
|
79
|
+
- **Setup**: No configuration needed
|
|
80
|
+
- **Experience**: Full autocomplete at all levels
|
|
81
|
+
|
|
82
|
+
### ⚠️ PyCharm (Jupyter Notebooks)
|
|
83
|
+
- **Autocomplete**: Limited - PyCharm uses static analysis and doesn't see dynamic attributes
|
|
84
|
+
- **Code execution**: Works perfectly (attributes are real and functional)
|
|
85
|
+
- **Workaround**: Call `names()` at each level to prime autocomplete
|
|
86
|
+
|
|
87
|
+
## Examples
|
|
88
|
+
|
|
89
|
+
See `notebooks/try_poelis_sdk.ipynb` for complete examples including authentication, data exploration, and search queries.
|
|
90
|
+
|
|
91
|
+
## Requirements
|
|
92
|
+
|
|
93
|
+
- Python >= 3.11
|
|
94
|
+
- API base URL reachable from your environment
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
"## Table of Contents\n",
|
|
16
16
|
"\n",
|
|
17
17
|
"1. [Installation](#Installation)\n",
|
|
18
|
-
"2. [
|
|
19
|
-
"3. [
|
|
20
|
-
"4. [
|
|
18
|
+
"2. [IDE Compatibility & Autocomplete](#IDE-Compatibility--Autocomplete)\n",
|
|
19
|
+
"3. [PyCharm Users: How to Use the SDK](#PyCharm-Users-How-to-Use-the-SDK)\n",
|
|
20
|
+
"4. [VS Code Users: Perfect Autocomplete Experience](#VS-Code-Users-Perfect-Autocomplete-Experience)\n",
|
|
21
|
+
"5. [Authentication Setup](#Authentication-Setup)\n",
|
|
22
|
+
"6. [Basic Client Setup](#Basic-Client-Setup)\n",
|
|
23
|
+
"7. [Browser Interface](#Browser-Interface)\n",
|
|
21
24
|
"\n"
|
|
22
25
|
]
|
|
23
26
|
},
|
|
@@ -49,17 +52,26 @@
|
|
|
49
52
|
]
|
|
50
53
|
},
|
|
51
54
|
{
|
|
52
|
-
"cell_type": "
|
|
53
|
-
"execution_count": null,
|
|
55
|
+
"cell_type": "markdown",
|
|
54
56
|
"metadata": {},
|
|
55
|
-
"outputs": [],
|
|
56
57
|
"source": [
|
|
57
|
-
"
|
|
58
|
-
"from poelis_sdk import PoelisClient\n",
|
|
58
|
+
"## IDE Compatibility & Autocomplete\n",
|
|
59
59
|
"\n",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
60
|
+
"The Poelis SDK works great in both **VS Code** and **PyCharm**, but there are some differences in how autocomplete behaves:\n",
|
|
61
|
+
"\n",
|
|
62
|
+
"### VS Code (Recommended for Best Experience)\n",
|
|
63
|
+
"- ✅ **Perfect autocomplete**: Dynamic attributes work automatically\n",
|
|
64
|
+
"- ✅ **No setup required**: Just start typing and press TAB\n",
|
|
65
|
+
"- ✅ **Fast and responsive**: Real-time completion suggestions\n",
|
|
66
|
+
"- ✅ **Works in Jupyter notebooks**: Full autocomplete support\n",
|
|
67
|
+
"\n",
|
|
68
|
+
"### PyCharm (Good, but with limitations)\n",
|
|
69
|
+
"- ⚠️ **Limited autocomplete**: Uses static analysis, not runtime introspection\n",
|
|
70
|
+
"- ⚠️ **Requires priming**: Call `names()` at each level for autocomplete\n",
|
|
71
|
+
"- ✅ **Code works perfectly**: All functionality works, just autocomplete is limited\n",
|
|
72
|
+
"- ✅ **Workarounds available**: Interactive selectors and helper functions\n",
|
|
73
|
+
"\n",
|
|
74
|
+
"**Recommendation**: Use **VS Code** for the best autocomplete experience, especially in Jupyter notebooks.\n"
|
|
63
75
|
]
|
|
64
76
|
},
|
|
65
77
|
{
|
|
@@ -95,8 +107,27 @@
|
|
|
95
107
|
"source": [
|
|
96
108
|
"## 3. Basic Client Setup\n",
|
|
97
109
|
"\n",
|
|
98
|
-
"There are two ways to initialize the Poelis client
|
|
110
|
+
"There are two ways to initialize the Poelis client:"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"cell_type": "code",
|
|
115
|
+
"execution_count": null,
|
|
116
|
+
"metadata": {},
|
|
117
|
+
"outputs": [],
|
|
118
|
+
"source": [
|
|
119
|
+
"# Import the SDK\n",
|
|
120
|
+
"from poelis_sdk import PoelisClient\n",
|
|
99
121
|
"\n",
|
|
122
|
+
"# Check if the SDK is properly installed\n",
|
|
123
|
+
"print(\"Poelis SDK imported successfully!\")\n",
|
|
124
|
+
"print(f\"PoelisClient class: {PoelisClient}\")\n"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"cell_type": "markdown",
|
|
129
|
+
"metadata": {},
|
|
130
|
+
"source": [
|
|
100
131
|
"### Method 1: Direct Initialization (Simplified)\n"
|
|
101
132
|
]
|
|
102
133
|
},
|
|
@@ -164,6 +195,12 @@
|
|
|
164
195
|
"- `client.browser.<workspace>.<product>` - Access a specific product\n",
|
|
165
196
|
"- `client.browser.<workspace>.<product>.<item>` - Access a specific item\n",
|
|
166
197
|
"- And so on...\n",
|
|
198
|
+
"\n",
|
|
199
|
+
"### IDE Differences\n",
|
|
200
|
+
"\n",
|
|
201
|
+
"**VS Code**: Perfect autocomplete works automatically - just press TAB after each dot.\n",
|
|
202
|
+
"\n",
|
|
203
|
+
"**PyCharm**: Autocomplete is limited due to static analysis. Use the workarounds shown above (interactive selectors, print helpers, etc.).\n",
|
|
167
204
|
"\n"
|
|
168
205
|
]
|
|
169
206
|
},
|
|
@@ -179,13 +216,46 @@
|
|
|
179
216
|
"poelis = PoelisClient(\n",
|
|
180
217
|
" api_key=\"YOUR_API_KEY\",\n",
|
|
181
218
|
" org_id=\"YOUR_ORG_ID\",\n",
|
|
219
|
+
")"
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"cell_type": "markdown",
|
|
224
|
+
"metadata": {},
|
|
225
|
+
"source": [
|
|
226
|
+
"## VS Code Users: Perfect Autocomplete Experience\n",
|
|
227
|
+
"\n",
|
|
228
|
+
"If you're using VS Code, you get the full autocomplete experience automatically:\n",
|
|
229
|
+
"\n",
|
|
230
|
+
"### Step 1: Initialize Client\n",
|
|
231
|
+
"```python\n",
|
|
232
|
+
"from poelis_sdk import PoelisClient\n",
|
|
233
|
+
"\n",
|
|
234
|
+
"poelis = PoelisClient(\n",
|
|
235
|
+
" api_key=\"your_api_key\",\n",
|
|
236
|
+
" org_id=\"your_org_id\"\n",
|
|
182
237
|
")\n",
|
|
238
|
+
"```\n",
|
|
239
|
+
"\n",
|
|
240
|
+
"### Step 2: Use TAB Completion\n",
|
|
241
|
+
"```python\n",
|
|
242
|
+
"# Type this and press TAB after the dot:\n",
|
|
243
|
+
"poelis.browser. # ← TAB shows all workspaces\n",
|
|
244
|
+
"\n",
|
|
245
|
+
"# Select a workspace and continue:\n",
|
|
246
|
+
"ws = poelis.browser.demoWS\n",
|
|
247
|
+
"ws. # ← TAB shows all products\n",
|
|
248
|
+
"\n",
|
|
249
|
+
"# Continue navigating:\n",
|
|
250
|
+
"prod = ws.my_product\n",
|
|
251
|
+
"prod. # ← TAB shows all items\n",
|
|
183
252
|
"\n",
|
|
184
|
-
"#
|
|
185
|
-
"
|
|
186
|
-
"#
|
|
187
|
-
"
|
|
188
|
-
"
|
|
253
|
+
"# Access properties:\n",
|
|
254
|
+
"item = prod.demoItem\n",
|
|
255
|
+
"item.property_name.value # ← TAB shows all properties\n",
|
|
256
|
+
"```\n",
|
|
257
|
+
"\n",
|
|
258
|
+
"**That's it!** VS Code automatically discovers dynamic attributes and provides perfect autocomplete.\n"
|
|
189
259
|
]
|
|
190
260
|
},
|
|
191
261
|
{
|
|
@@ -196,7 +266,7 @@
|
|
|
196
266
|
"source": [
|
|
197
267
|
"# 3) Access a property’s value and category via dot paths\n",
|
|
198
268
|
"# Example (replace names with your actual names shown by TAB):\n",
|
|
199
|
-
"workspace = poelis.browser.
|
|
269
|
+
"workspace = poelis.browser.demoWS"
|
|
200
270
|
]
|
|
201
271
|
},
|
|
202
272
|
{
|
|
@@ -205,11 +275,75 @@
|
|
|
205
275
|
"metadata": {},
|
|
206
276
|
"outputs": [],
|
|
207
277
|
"source": [
|
|
208
|
-
"
|
|
209
|
-
"
|
|
278
|
+
"# 4) Access a property’s value and category via dot paths\n",
|
|
279
|
+
"mass_value = workspace.demoProduct.demoItem.demoSubItem.demoPropertyMass.value\n",
|
|
280
|
+
"mass_category = workspace.demoProduct.demoItem.demoSubItem.demoPropertyMass.category\n",
|
|
210
281
|
"\n",
|
|
211
|
-
"print(\"property value:\",
|
|
212
|
-
"print(\"property category:\",
|
|
282
|
+
"print(\"property value:\", mass_value)\n",
|
|
283
|
+
"print(\"property category:\", mass_category)"
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"cell_type": "markdown",
|
|
288
|
+
"metadata": {},
|
|
289
|
+
"source": [
|
|
290
|
+
"## PyCharm Users: How to Use the SDK\n",
|
|
291
|
+
"\n",
|
|
292
|
+
"If you're using PyCharm (especially in Jupyter notebooks), here are the best ways to work with the SDK:\n",
|
|
293
|
+
"\n",
|
|
294
|
+
"\n",
|
|
295
|
+
"### Method 1: Print and Copy-Paste\n",
|
|
296
|
+
"```python\n",
|
|
297
|
+
"# Print available workspaces\n",
|
|
298
|
+
"workspaces = poelis.browser.names()\n",
|
|
299
|
+
"print(workspaces)\n",
|
|
300
|
+
"```\n",
|
|
301
|
+
"Output:\n",
|
|
302
|
+
"\n",
|
|
303
|
+
"\n",
|
|
304
|
+
"['demoWS', 'universal_hydrogen']\n",
|
|
305
|
+
"\n",
|
|
306
|
+
"```python\n",
|
|
307
|
+
"# Copy-paste the line you need:\n",
|
|
308
|
+
"ws = poelis.browser.demoWS # Works perfectly!\n",
|
|
309
|
+
"```\n",
|
|
310
|
+
"\n",
|
|
311
|
+
"```python\n",
|
|
312
|
+
"# Print available products\n",
|
|
313
|
+
"products = ws.names()\n",
|
|
314
|
+
"print(products)\n",
|
|
315
|
+
"```\n",
|
|
316
|
+
"Output:\n",
|
|
317
|
+
"\n",
|
|
318
|
+
"\n",
|
|
319
|
+
"['demoProduct', 'prod1']\n",
|
|
320
|
+
"\n",
|
|
321
|
+
"```python\n",
|
|
322
|
+
"# Copy-paste the line you need:\n",
|
|
323
|
+
"prod = ws.demoProduct \n",
|
|
324
|
+
"```\n",
|
|
325
|
+
"\n",
|
|
326
|
+
"### Method 2: Dictionary Access (Always Works)\n",
|
|
327
|
+
"```python\n",
|
|
328
|
+
"# Always works in any IDE\n",
|
|
329
|
+
"workspaces = poelis.browser.names()\n",
|
|
330
|
+
"ws = poelis.browser[workspaces[0]] # Access by name\n",
|
|
331
|
+
"\n",
|
|
332
|
+
"products = ws.names()\n",
|
|
333
|
+
"prod = ws[products[0]] # Access by name\n",
|
|
334
|
+
"```\n",
|
|
335
|
+
"\n",
|
|
336
|
+
"**The code works perfectly in PyCharm** - these are just workarounds for when autocomplete doesn't show the dynamic attributes.\n"
|
|
337
|
+
]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"cell_type": "code",
|
|
341
|
+
"execution_count": null,
|
|
342
|
+
"metadata": {},
|
|
343
|
+
"outputs": [],
|
|
344
|
+
"source": [
|
|
345
|
+
"workspaces = poelis.browser.names()\n",
|
|
346
|
+
"print(workspaces)"
|
|
213
347
|
]
|
|
214
348
|
},
|
|
215
349
|
{
|
|
@@ -218,8 +352,41 @@
|
|
|
218
352
|
"metadata": {},
|
|
219
353
|
"outputs": [],
|
|
220
354
|
"source": [
|
|
221
|
-
"
|
|
222
|
-
|
|
355
|
+
"ws = poelis.browser.demoWS # Replace with your workspace name"
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"cell_type": "code",
|
|
360
|
+
"execution_count": null,
|
|
361
|
+
"metadata": {},
|
|
362
|
+
"outputs": [],
|
|
363
|
+
"source": [
|
|
364
|
+
"products = ws.names()\n",
|
|
365
|
+
"print(products)"
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"cell_type": "code",
|
|
370
|
+
"execution_count": null,
|
|
371
|
+
"metadata": {},
|
|
372
|
+
"outputs": [],
|
|
373
|
+
"source": [
|
|
374
|
+
"prod = ws.demoProduct # Replace with your product name"
|
|
375
|
+
]
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"cell_type": "code",
|
|
379
|
+
"execution_count": null,
|
|
380
|
+
"metadata": {},
|
|
381
|
+
"outputs": [],
|
|
382
|
+
"source": [
|
|
383
|
+
"item = prod.demoItem # Replace with your item name\n",
|
|
384
|
+
"\n",
|
|
385
|
+
"property_value = item.demoProperty.value # Replace with your property name\n",
|
|
386
|
+
"property_category = item.demoProperty.category # Replace with your property name\n",
|
|
387
|
+
"\n",
|
|
388
|
+
"print(\"Property value:\", property_value)\n",
|
|
389
|
+
"print(\"Property category:\", property_category)"
|
|
223
390
|
]
|
|
224
391
|
}
|
|
225
392
|
],
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "poelis-sdk"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.6"
|
|
8
8
|
description = "Official Python SDK for Poelis"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -45,6 +45,10 @@ testpaths = ["tests"]
|
|
|
45
45
|
|
|
46
46
|
[tool.hatch.build.targets.wheel]
|
|
47
47
|
packages = ["src/poelis_sdk"]
|
|
48
|
+
include = [
|
|
49
|
+
"src/poelis_sdk/**/*.pyi",
|
|
50
|
+
"src/poelis_sdk/py.typed",
|
|
51
|
+
]
|
|
48
52
|
|
|
49
53
|
[dependency-groups]
|
|
50
54
|
dev = [
|
poelis_sdk-0.3.5/PKG-INFO
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: poelis-sdk
|
|
3
|
-
Version: 0.3.5
|
|
4
|
-
Summary: Official Python SDK for Poelis
|
|
5
|
-
Project-URL: Homepage, https://poelis.com
|
|
6
|
-
Project-URL: Source, https://github.com/PoelisTechnologies/poelis-python-sdk
|
|
7
|
-
Project-URL: Issues, https://github.com/PoelisTechnologies/poelis-python-sdk/issues
|
|
8
|
-
Author-email: Matteo Braceschi <matteo@poelis.com>
|
|
9
|
-
License-Expression: MIT
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Keywords: api,client,poelis,sdk
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
-
Requires-Python: >=3.11
|
|
18
|
-
Requires-Dist: build>=1.3.0
|
|
19
|
-
Requires-Dist: httpx>=0.27
|
|
20
|
-
Requires-Dist: pydantic>=2.7
|
|
21
|
-
Requires-Dist: twine>=6.2.0
|
|
22
|
-
Description-Content-Type: text/markdown
|
|
23
|
-
|
|
24
|
-
# Poelis Python SDK
|
|
25
|
-
|
|
26
|
-
Python SDK for Poelis.
|
|
27
|
-
|
|
28
|
-
## Installation
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
pip install -U poelis-sdk
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Requires Python 3.11+.
|
|
35
|
-
|
|
36
|
-
## Quickstart (API key + org ID)
|
|
37
|
-
|
|
38
|
-
```python
|
|
39
|
-
from poelis_sdk import PoelisClient
|
|
40
|
-
|
|
41
|
-
client = PoelisClient(
|
|
42
|
-
api_key="poelis_live_A1B2C3...", # Organization Settings → API Keys
|
|
43
|
-
org_id="tenant_uci_001", # same section
|
|
44
|
-
)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Configuration
|
|
48
|
-
|
|
49
|
-
### Getting your API key and org ID
|
|
50
|
-
|
|
51
|
-
1. Navigate to Organization Settings → API Keys.
|
|
52
|
-
2. Click “Create API key”, choose a name and scopes (read-only by default recommended).
|
|
53
|
-
3. Copy the full key when shown (it will be visible only once). Keep it secret.
|
|
54
|
-
4. The `org_id` for your organization is displayed in the same section.
|
|
55
|
-
5. You can rotate or revoke keys anytime. Prefer storing as env vars:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
export POELIS_API_KEY=poelis_live_A1B2C3...
|
|
59
|
-
export POELIS_ORG_ID=tenant_id_001
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### How authentication works
|
|
64
|
-
|
|
65
|
-
The SDK does not talk to Auth0. It sends your API key directly to the Poelis backend for validation on every request.
|
|
66
|
-
|
|
67
|
-
- Default headers sent by the SDK:
|
|
68
|
-
|
|
69
|
-
- `X-API-Key: <api_key>` (and `X-Poelis-Api-Key` as a compatibility alias)
|
|
70
|
-
- `Authorization: Api-Key <api_key>` (compatibility for gateways expecting Authorization-only)
|
|
71
|
-
- `X-Poelis-Org: <org_id>`
|
|
72
|
-
|
|
73
|
-
You can opt into Bearer mode (legacy) by setting `POELIS_AUTH_MODE=bearer`, which will send:
|
|
74
|
-
|
|
75
|
-
- `Authorization: Bearer <api_key>`
|
|
76
|
-
- `X-Poelis-Org: <org_id>`
|
|
77
|
-
|
|
78
|
-
The backend validates the API key against your organization, applies authorization and filtering, and returns data.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Dot-path browser (Notebook UX)
|
|
82
|
-
|
|
83
|
-
The SDK exposes a dot-path browser for easy exploration:
|
|
84
|
-
|
|
85
|
-
```python
|
|
86
|
-
client.browser # then use TAB to explore
|
|
87
|
-
# client.browser.<workspace>.<product>.<item>.<child>.properties
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
See the example notebook in `notebooks/try_poelis_sdk.ipynb` for an end-to-end walkthrough (authentication, listing workspaces/products/items, and simple search queries). The client defaults to `https://api.poelis.ai` unless `POELIS_BASE_URL` is set.
|
|
91
|
-
|
|
92
|
-
## Requirements
|
|
93
|
-
|
|
94
|
-
- Python >= 3.11
|
|
95
|
-
- API base URL reachable from your environment
|
|
96
|
-
|
|
97
|
-
## License
|
|
98
|
-
|
|
99
|
-
MIT
|
poelis_sdk-0.3.5/README.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Poelis Python SDK
|
|
2
|
-
|
|
3
|
-
Python SDK for Poelis.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pip install -U poelis-sdk
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Requires Python 3.11+.
|
|
12
|
-
|
|
13
|
-
## Quickstart (API key + org ID)
|
|
14
|
-
|
|
15
|
-
```python
|
|
16
|
-
from poelis_sdk import PoelisClient
|
|
17
|
-
|
|
18
|
-
client = PoelisClient(
|
|
19
|
-
api_key="poelis_live_A1B2C3...", # Organization Settings → API Keys
|
|
20
|
-
org_id="tenant_uci_001", # same section
|
|
21
|
-
)
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Configuration
|
|
25
|
-
|
|
26
|
-
### Getting your API key and org ID
|
|
27
|
-
|
|
28
|
-
1. Navigate to Organization Settings → API Keys.
|
|
29
|
-
2. Click “Create API key”, choose a name and scopes (read-only by default recommended).
|
|
30
|
-
3. Copy the full key when shown (it will be visible only once). Keep it secret.
|
|
31
|
-
4. The `org_id` for your organization is displayed in the same section.
|
|
32
|
-
5. You can rotate or revoke keys anytime. Prefer storing as env vars:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
export POELIS_API_KEY=poelis_live_A1B2C3...
|
|
36
|
-
export POELIS_ORG_ID=tenant_id_001
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### How authentication works
|
|
41
|
-
|
|
42
|
-
The SDK does not talk to Auth0. It sends your API key directly to the Poelis backend for validation on every request.
|
|
43
|
-
|
|
44
|
-
- Default headers sent by the SDK:
|
|
45
|
-
|
|
46
|
-
- `X-API-Key: <api_key>` (and `X-Poelis-Api-Key` as a compatibility alias)
|
|
47
|
-
- `Authorization: Api-Key <api_key>` (compatibility for gateways expecting Authorization-only)
|
|
48
|
-
- `X-Poelis-Org: <org_id>`
|
|
49
|
-
|
|
50
|
-
You can opt into Bearer mode (legacy) by setting `POELIS_AUTH_MODE=bearer`, which will send:
|
|
51
|
-
|
|
52
|
-
- `Authorization: Bearer <api_key>`
|
|
53
|
-
- `X-Poelis-Org: <org_id>`
|
|
54
|
-
|
|
55
|
-
The backend validates the API key against your organization, applies authorization and filtering, and returns data.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
## Dot-path browser (Notebook UX)
|
|
59
|
-
|
|
60
|
-
The SDK exposes a dot-path browser for easy exploration:
|
|
61
|
-
|
|
62
|
-
```python
|
|
63
|
-
client.browser # then use TAB to explore
|
|
64
|
-
# client.browser.<workspace>.<product>.<item>.<child>.properties
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
See the example notebook in `notebooks/try_poelis_sdk.ipynb` for an end-to-end walkthrough (authentication, listing workspaces/products/items, and simple search queries). The client defaults to `https://api.poelis.ai` unless `POELIS_BASE_URL` is set.
|
|
68
|
-
|
|
69
|
-
## Requirements
|
|
70
|
-
|
|
71
|
-
- Python >= 3.11
|
|
72
|
-
- API base URL reachable from your environment
|
|
73
|
-
|
|
74
|
-
## License
|
|
75
|
-
|
|
76
|
-
MIT
|
|
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
|
|
File without changes
|
|
File without changes
|