poelis-sdk 0.5.1__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.

Files changed (32) hide show
  1. poelis_sdk-0.5.1/.github/workflows/ci.yml +51 -0
  2. poelis_sdk-0.5.1/.github/workflows/codeql.yml +39 -0
  3. poelis_sdk-0.5.1/.github/workflows/publish-on-push.yml +87 -0
  4. poelis_sdk-0.5.1/.gitignore +218 -0
  5. poelis_sdk-0.5.1/LICENSE +21 -0
  6. poelis_sdk-0.5.1/PKG-INFO +108 -0
  7. poelis_sdk-0.5.1/README.md +85 -0
  8. poelis_sdk-0.5.1/notebooks/try_poelis_sdk.ipynb +284 -0
  9. poelis_sdk-0.5.1/pyproject.toml +58 -0
  10. poelis_sdk-0.5.1/src/poelis_sdk/__init__.py +30 -0
  11. poelis_sdk-0.5.1/src/poelis_sdk/_transport.py +147 -0
  12. poelis_sdk-0.5.1/src/poelis_sdk/browser.py +1494 -0
  13. poelis_sdk-0.5.1/src/poelis_sdk/client.py +121 -0
  14. poelis_sdk-0.5.1/src/poelis_sdk/exceptions.py +44 -0
  15. poelis_sdk-0.5.1/src/poelis_sdk/items.py +121 -0
  16. poelis_sdk-0.5.1/src/poelis_sdk/logging.py +73 -0
  17. poelis_sdk-0.5.1/src/poelis_sdk/models.py +179 -0
  18. poelis_sdk-0.5.1/src/poelis_sdk/org_validation.py +163 -0
  19. poelis_sdk-0.5.1/src/poelis_sdk/products.py +120 -0
  20. poelis_sdk-0.5.1/src/poelis_sdk/search.py +88 -0
  21. poelis_sdk-0.5.1/src/poelis_sdk/versions.py +123 -0
  22. poelis_sdk-0.5.1/src/poelis_sdk/workspaces.py +50 -0
  23. poelis_sdk-0.5.1/src/tests/test_client_basic.py +91 -0
  24. poelis_sdk-0.5.1/src/tests/test_errors_and_backoff.py +80 -0
  25. poelis_sdk-0.5.1/src/tests/test_items_client.py +69 -0
  26. poelis_sdk-0.5.1/src/tests/test_search_client.py +46 -0
  27. poelis_sdk-0.5.1/src/tests/test_transport_and_products.py +80 -0
  28. poelis_sdk-0.5.1/tests/__init__.py +2 -0
  29. poelis_sdk-0.5.1/tests/test_browser_navigation.py +493 -0
  30. poelis_sdk-0.5.1/tests/test_integration_smoke.py +27 -0
  31. poelis_sdk-0.5.1/tests/test_typed_properties.py +258 -0
  32. poelis_sdk-0.5.1/uv.lock +949 -0
@@ -0,0 +1,51 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v4
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v3
26
+ with:
27
+ version: "latest"
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ uv sync --dev
32
+
33
+ - name: Run linting with Ruff
34
+ run: |
35
+ uv run ruff check .
36
+
37
+ - name: Run import sort fix (I001) and type checks
38
+ run: |
39
+ uv run ruff check --select I --fix .
40
+
41
+ - name: Run tests with pytest (temporarily allow failures)
42
+ run: |
43
+ uv run pytest src/tests tests --maxfail=1 --disable-warnings --cov=src/poelis_sdk --cov-report=xml --cov-report=term --cov-fail-under=0 || true
44
+
45
+ - name: Upload coverage to Codecov
46
+ uses: codecov/codecov-action@v3
47
+ with:
48
+ file: ./coverage.xml
49
+ flags: unittests
50
+ name: codecov-umbrella
51
+ fail_ci_if_error: false
@@ -0,0 +1,39 @@
1
+ name: CodeQL
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+ schedule:
9
+ - cron: '0 2 * * 1'
10
+
11
+ jobs:
12
+ analyze:
13
+ name: Analyze
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ actions: read
17
+ contents: read
18
+ security-events: write
19
+
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ language: [ 'python' ]
24
+
25
+ steps:
26
+ - name: Checkout repository
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Initialize CodeQL
30
+ uses: github/codeql-action/init@v3
31
+ with:
32
+ languages: ${{ matrix.language }}
33
+
34
+ - name: Autobuild
35
+ uses: github/codeql-action/autobuild@v3
36
+
37
+ - name: Perform CodeQL Analysis
38
+ uses: github/codeql-action/analyze@v3
39
+
@@ -0,0 +1,87 @@
1
+ name: Publish on version bump
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ paths:
7
+ - 'pyproject.toml'
8
+ workflow_dispatch: {}
9
+
10
+ jobs:
11
+ build-and-publish:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: '3.12'
26
+
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v3
29
+ with:
30
+ version: 'latest'
31
+
32
+ - name: Extract version
33
+ id: v
34
+ run: |
35
+ VER=$(python -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
36
+ echo "version=$VER" >> $GITHUB_OUTPUT
37
+
38
+ - name: Check if tag exists
39
+ id: tag
40
+ run: |
41
+ if git rev-parse --verify --quiet refs/tags/v${{ steps.v.outputs.version }}; then
42
+ echo "exists=true" >> $GITHUB_OUTPUT
43
+ else
44
+ echo "exists=false" >> $GITHUB_OUTPUT
45
+ fi
46
+
47
+ - name: Create tag
48
+ if: steps.tag.outputs.exists == 'false'
49
+ run: |
50
+ git config user.name "github-actions"
51
+ git config user.email "github-actions@users.noreply.github.com"
52
+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
53
+ git tag v${{ steps.v.outputs.version }}
54
+ git push origin v${{ steps.v.outputs.version }}
55
+
56
+ - name: Install build tooling
57
+ run: |
58
+ uv sync --dev
59
+
60
+ - name: Build sdist and wheel
61
+ run: |
62
+ uv run python -m build
63
+
64
+ - name: List built packages
65
+ run: |
66
+ ls -la dist/
67
+ echo "Package contents:"
68
+ for pkg in dist/*; do
69
+ echo "Package: $pkg"
70
+ if [[ $pkg == *.whl ]]; then
71
+ unzip -l "$pkg" | head -10
72
+ elif [[ $pkg == *.tar.gz ]]; then
73
+ tar -tzf "$pkg" | head -10
74
+ fi
75
+ done
76
+
77
+ - name: Install twine
78
+ run: |
79
+ uv add twine
80
+
81
+ - name: Publish to PyPI with twine
82
+ env:
83
+ TWINE_USERNAME: __token__
84
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
85
+ run: |
86
+ uv run twine upload --skip-existing --verbose dist/*
87
+
@@ -0,0 +1,218 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+ *.DS_Store
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py.cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ #uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ #poetry.lock
110
+ #poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ #pdm.lock
117
+ #pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ #pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi
127
+
128
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
129
+ __pypackages__/
130
+
131
+ # Celery stuff
132
+ celerybeat-schedule
133
+ celerybeat.pid
134
+
135
+ # SageMath parsed files
136
+ *.sage.py
137
+
138
+ # Environments
139
+ .env
140
+ .envrc
141
+ .venv
142
+ env/
143
+ venv/
144
+ ENV/
145
+ env.bak/
146
+ venv.bak/
147
+
148
+ # Spyder project settings
149
+ .spyderproject
150
+ .spyproject
151
+
152
+ # Rope project settings
153
+ .ropeproject
154
+
155
+ # mkdocs documentation
156
+ /site
157
+
158
+ # mypy
159
+ .mypy_cache/
160
+ .dmypy.json
161
+ dmypy.json
162
+
163
+ # Pyre type checker
164
+ .pyre/
165
+
166
+ # pytype static type analyzer
167
+ .pytype/
168
+
169
+ # Cython debug symbols
170
+ cython_debug/
171
+
172
+ # PyCharm
173
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
174
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
175
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
176
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
177
+ #.idea/
178
+
179
+ # Abstra
180
+ # Abstra is an AI-powered process automation framework.
181
+ # Ignore directories containing user credentials, local state, and settings.
182
+ # Learn more at https://abstra.io/docs
183
+ .abstra/
184
+
185
+ # Visual Studio Code
186
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
187
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
188
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
189
+ # you could uncomment the following to ignore the entire vscode folder
190
+ # .vscode/
191
+
192
+ # Ruff stuff:
193
+ .ruff_cache/
194
+
195
+ # PyPI configuration file
196
+ .pypirc
197
+
198
+ # Cursor
199
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
200
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
201
+ # refer to https://docs.cursor.com/context/ignore-files
202
+ .cursorignore
203
+ .cursorindexingignore
204
+
205
+ # Marimo
206
+ marimo/_static/
207
+ marimo/_lsp/
208
+ __marimo__/
209
+
210
+
211
+ # Others
212
+ .cursor/
213
+ tmp/
214
+
215
+ # Allow GitHub workflows
216
+ !/.github/
217
+ !/.github/workflows/
218
+ !/.github/workflows/*.yml
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 PoelisTechnologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: poelis-sdk
3
+ Version: 0.5.1
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
+ ## IDE Compatibility & Autocomplete
29
+
30
+ The Poelis SDK works in all Python environments, but autocomplete behavior varies by IDE:
31
+
32
+ ### ✅ VS Code (Recommended for Notebooks)
33
+ - **Autocomplete**: Works perfectly with dynamic attributes
34
+ - **Setup**: No configuration needed
35
+ - **Experience**: Full autocomplete at all levels
36
+
37
+ ### ⚠️ PyCharm (Jupyter Notebooks)
38
+ - **Autocomplete**: Limited - PyCharm uses static analysis and doesn't see dynamic attributes
39
+ - **Code execution**: Works perfectly (attributes are real and functional)
40
+ - **Workaround**: Call the relevant `list_*().names` at each level to prime autocomplete
41
+
42
+ ## Examples
43
+
44
+ See `notebooks/try_poelis_sdk.ipynb` for complete examples including authentication, data exploration, and search queries.
45
+
46
+ ## Installation
47
+
48
+ - Python >= 3.11
49
+ - API base URL reachable from your environment
50
+
51
+ ```bash
52
+ pip install -U poelis-sdk
53
+ ```
54
+
55
+ ## Quick Start
56
+
57
+ 1. Go to **Organization Settings → API Keys**
58
+ 2. Click **\"Create API key\"**
59
+ 3. Copy the key (shown only once) and store it securely, for example as an environment variable:
60
+
61
+ ```python
62
+ from poelis_sdk import PoelisClient
63
+
64
+ # Create client
65
+ poelis_client = PoelisClient(
66
+ api_key="poelis_live_A1B2C3...", # Get from Organization Settings → API Keys
67
+ )
68
+ ```
69
+
70
+ ## Browser Usage
71
+
72
+ The browser lets you navigate your Poelis data with simple dot notation:
73
+
74
+ ```python
75
+ # Navigate through your data
76
+ poelis = poelis_client.browser
77
+
78
+ # List workspaces
79
+ poelis.list_workspaces().names # ['workspace1', 'workspace2', ...]
80
+
81
+ # Access workspace
82
+ ws = poelis.workspace1
83
+
84
+ # List products in workspace
85
+ ws.list_products().names # ['product1', 'product2', ...]
86
+
87
+ # Access product
88
+ product = ws.product1
89
+
90
+ # List items in product
91
+ product.list_items().names # ['item1', 'item2', ...]
92
+
93
+ # Access item and its properties
94
+ item = product.item1
95
+
96
+ # List children by type for more control
97
+ item.list_items().names # ['child_item1', 'child_item2'] - only child items
98
+ item.list_properties().names # ['Color', 'Weight', ...] - only properties
99
+
100
+ # Access property values directly
101
+ item_value = item.some_property.value # Access property values directly
102
+ item_category = item.some_property.category # Access property categories directly
103
+ item_unit = item.some_property.unit # Access property units directly
104
+ ```
105
+
106
+ ## License
107
+
108
+ MIT
@@ -0,0 +1,85 @@
1
+ # Poelis Python SDK
2
+
3
+ Python SDK for Poelis - explore your data with simple dot notation.
4
+
5
+ ## IDE Compatibility & Autocomplete
6
+
7
+ The Poelis SDK works in all Python environments, but autocomplete behavior varies by IDE:
8
+
9
+ ### ✅ VS Code (Recommended for Notebooks)
10
+ - **Autocomplete**: Works perfectly with dynamic attributes
11
+ - **Setup**: No configuration needed
12
+ - **Experience**: Full autocomplete at all levels
13
+
14
+ ### ⚠️ PyCharm (Jupyter Notebooks)
15
+ - **Autocomplete**: Limited - PyCharm uses static analysis and doesn't see dynamic attributes
16
+ - **Code execution**: Works perfectly (attributes are real and functional)
17
+ - **Workaround**: Call the relevant `list_*().names` at each level to prime autocomplete
18
+
19
+ ## Examples
20
+
21
+ See `notebooks/try_poelis_sdk.ipynb` for complete examples including authentication, data exploration, and search queries.
22
+
23
+ ## Installation
24
+
25
+ - Python >= 3.11
26
+ - API base URL reachable from your environment
27
+
28
+ ```bash
29
+ pip install -U poelis-sdk
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ 1. Go to **Organization Settings → API Keys**
35
+ 2. Click **\"Create API key\"**
36
+ 3. Copy the key (shown only once) and store it securely, for example as an environment variable:
37
+
38
+ ```python
39
+ from poelis_sdk import PoelisClient
40
+
41
+ # Create client
42
+ poelis_client = PoelisClient(
43
+ api_key="poelis_live_A1B2C3...", # Get from Organization Settings → API Keys
44
+ )
45
+ ```
46
+
47
+ ## Browser Usage
48
+
49
+ The browser lets you navigate your Poelis data with simple dot notation:
50
+
51
+ ```python
52
+ # Navigate through your data
53
+ poelis = poelis_client.browser
54
+
55
+ # List workspaces
56
+ poelis.list_workspaces().names # ['workspace1', 'workspace2', ...]
57
+
58
+ # Access workspace
59
+ ws = poelis.workspace1
60
+
61
+ # List products in workspace
62
+ ws.list_products().names # ['product1', 'product2', ...]
63
+
64
+ # Access product
65
+ product = ws.product1
66
+
67
+ # List items in product
68
+ product.list_items().names # ['item1', 'item2', ...]
69
+
70
+ # Access item and its properties
71
+ item = product.item1
72
+
73
+ # List children by type for more control
74
+ item.list_items().names # ['child_item1', 'child_item2'] - only child items
75
+ item.list_properties().names # ['Color', 'Weight', ...] - only properties
76
+
77
+ # Access property values directly
78
+ item_value = item.some_property.value # Access property values directly
79
+ item_category = item.some_property.category # Access property categories directly
80
+ item_unit = item.some_property.unit # Access property units directly
81
+ ```
82
+
83
+ ## License
84
+
85
+ MIT