poelis-sdk 0.1.0__tar.gz → 0.1.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.
- poelis_sdk-0.1.1/.github/workflows/ci.yml +51 -0
- poelis_sdk-0.1.1/.github/workflows/codeql.yml +39 -0
- poelis_sdk-0.1.1/.github/workflows/publish-on-push.yml +69 -0
- poelis_sdk-0.1.1/.github/workflows/publish-pypi.yml +42 -0
- poelis_sdk-0.1.1/.github/workflows/publish-testpypi.yml +11 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/.gitignore +5 -1
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/PKG-INFO +8 -6
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/README.md +7 -5
- poelis_sdk-0.1.1/notebooks/try_poelis_sdk.ipynb +844 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/pyproject.toml +11 -1
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/_transport.py +6 -7
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/client.py +15 -17
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/tests/test_client_basic.py +24 -9
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/tests/test_errors_and_backoff.py +1 -5
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/tests/test_items_client.py +1 -5
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/tests/test_search_client.py +0 -4
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/tests/test_transport_and_products.py +0 -5
- poelis_sdk-0.1.1/tests/__init__.py +2 -0
- poelis_sdk-0.1.1/tests/test_integration_smoke.py +27 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/uv.lock +220 -1
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/LICENSE +0 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/.github/workflows/sdk-ci.yml +0 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/.github/workflows/sdk-docs.yml +0 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/.github/workflows/sdk-publish-testpypi.yml +0 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/__init__.py +0 -0
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/browser.py +3 -3
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/exceptions.py +2 -2
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/items.py +2 -2
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/models.py +2 -2
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/products.py +2 -2
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/search.py +2 -2
- {poelis_sdk-0.1.0 → poelis_sdk-0.1.1}/src/poelis_sdk/workspaces.py +2 -2
|
@@ -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,69 @@
|
|
|
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: Publish to PyPI
|
|
65
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
66
|
+
with:
|
|
67
|
+
user: __token__
|
|
68
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
69
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Publish (PyPI)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-publish:
|
|
10
|
+
if: ${{ !contains(github.ref_name, 'rc') }}
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: '3.12'
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v3
|
|
26
|
+
with:
|
|
27
|
+
version: 'latest'
|
|
28
|
+
|
|
29
|
+
- name: Install build tooling
|
|
30
|
+
run: |
|
|
31
|
+
uv sync --dev
|
|
32
|
+
|
|
33
|
+
- name: Build sdist and wheel
|
|
34
|
+
run: |
|
|
35
|
+
uv run python -m build
|
|
36
|
+
|
|
37
|
+
- name: Publish to PyPI
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
39
|
+
with:
|
|
40
|
+
user: __token__
|
|
41
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
42
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: poelis-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Official Python SDK for Poelis
|
|
5
5
|
Project-URL: Homepage, https://poelis.ai
|
|
6
6
|
Project-URL: Source, https://github.com/PoelisTechnologies/poelis-python-sdk
|
|
@@ -31,9 +31,9 @@ GraphQL-first Python SDK for Poelis with a focus on great developer experience.
|
|
|
31
31
|
from poelis_sdk import PoelisClient
|
|
32
32
|
|
|
33
33
|
client = PoelisClient(
|
|
34
|
-
base_url="https://api.poelis.ai", # or your environment
|
|
35
34
|
api_key="poelis_live_A1B2C3...", # Organization Settings → API Keys
|
|
36
35
|
org_id="tenant_uci_001", # same section
|
|
36
|
+
# base_url defaults to https://api.poelis.ai
|
|
37
37
|
)
|
|
38
38
|
|
|
39
39
|
# Workspaces → Products (GraphQL)
|
|
@@ -57,9 +57,11 @@ print(props["total"], len(props["hits"]))
|
|
|
57
57
|
|
|
58
58
|
### Base URL
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
60
|
+
The SDK defaults to the production API (`https://api.poelis.ai`). You can override this for different environments:
|
|
61
|
+
|
|
62
|
+
- Local development: `base_url="http://localhost:8000"`
|
|
63
|
+
- Staging (example): `base_url="https://api.staging.poelis.ai"`
|
|
64
|
+
- Production (default): No need to specify, uses `https://api.poelis.ai`
|
|
63
65
|
|
|
64
66
|
Confirm the exact URLs for your environments.
|
|
65
67
|
|
|
@@ -74,9 +76,9 @@ Note: Multi-tenancy uses `org_id` for scoping. When using API keys, the SDK sets
|
|
|
74
76
|
5. You can rotate or revoke keys anytime. Prefer storing as env vars:
|
|
75
77
|
|
|
76
78
|
```bash
|
|
77
|
-
export POELIS_BASE_URL=https://api.poelis.ai
|
|
78
79
|
export POELIS_API_KEY=poelis_live_A1B2C3...
|
|
79
80
|
export POELIS_ORG_ID=tenant_uci_001
|
|
81
|
+
# POELIS_BASE_URL is optional - defaults to https://api.poelis.ai
|
|
80
82
|
```
|
|
81
83
|
|
|
82
84
|
|
|
@@ -8,9 +8,9 @@ GraphQL-first Python SDK for Poelis with a focus on great developer experience.
|
|
|
8
8
|
from poelis_sdk import PoelisClient
|
|
9
9
|
|
|
10
10
|
client = PoelisClient(
|
|
11
|
-
base_url="https://api.poelis.ai", # or your environment
|
|
12
11
|
api_key="poelis_live_A1B2C3...", # Organization Settings → API Keys
|
|
13
12
|
org_id="tenant_uci_001", # same section
|
|
13
|
+
# base_url defaults to https://api.poelis.ai
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
# Workspaces → Products (GraphQL)
|
|
@@ -34,9 +34,11 @@ print(props["total"], len(props["hits"]))
|
|
|
34
34
|
|
|
35
35
|
### Base URL
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
37
|
+
The SDK defaults to the production API (`https://api.poelis.ai`). You can override this for different environments:
|
|
38
|
+
|
|
39
|
+
- Local development: `base_url="http://localhost:8000"`
|
|
40
|
+
- Staging (example): `base_url="https://api.staging.poelis.ai"`
|
|
41
|
+
- Production (default): No need to specify, uses `https://api.poelis.ai`
|
|
40
42
|
|
|
41
43
|
Confirm the exact URLs for your environments.
|
|
42
44
|
|
|
@@ -51,9 +53,9 @@ Note: Multi-tenancy uses `org_id` for scoping. When using API keys, the SDK sets
|
|
|
51
53
|
5. You can rotate or revoke keys anytime. Prefer storing as env vars:
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
|
-
export POELIS_BASE_URL=https://api.poelis.ai
|
|
55
56
|
export POELIS_API_KEY=poelis_live_A1B2C3...
|
|
56
57
|
export POELIS_ORG_ID=tenant_uci_001
|
|
58
|
+
# POELIS_BASE_URL is optional - defaults to https://api.poelis.ai
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
|