vortex-python-sdk 0.0.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 vortex-python-sdk might be problematic. Click here for more details.

@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.0.1] - 2024-10-10
11
+
12
+ ### Added
13
+ - Initial release of Vortex Python SDK
14
+ - JWT generation with HMAC-SHA256 signing
15
+ - Complete invitation management API
16
+ - Async and sync HTTP client methods
17
+ - Type safety with Pydantic models
18
+ - Context manager support for resource cleanup
19
+ - Comprehensive error handling with VortexApiError
20
+ - Full compatibility with Node.js SDK API
21
+
22
+ ### Features
23
+ - `generate_jwt()` - Generate Vortex JWT tokens
24
+ - `get_invitations_by_target()` - Get invitations by email/username/phone
25
+ - `accept_invitations()` - Accept multiple invitations
26
+ - `get_invitation()` - Get specific invitation by ID
27
+ - `revoke_invitation()` - Revoke invitation
28
+ - `get_invitations_by_group()` - Get invitations for a group
29
+ - `delete_invitations_by_group()` - Delete all group invitations
30
+ - `reinvite()` - Reinvite functionality
31
+ - Both async and sync versions of all methods
32
+ - Python 3.8+ support
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 TeamVortexSoftware
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,9 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ recursive-include src/vortex_sdk *.py
5
+ recursive-include src/vortex_sdk py.typed
6
+ exclude tests/
7
+ exclude .github/
8
+ exclude *.pyc
9
+ exclude __pycache__/
@@ -0,0 +1,233 @@
1
+ Metadata-Version: 2.4
2
+ Name: vortex-python-sdk
3
+ Version: 0.0.1
4
+ Summary: Vortex Python SDK for invitation management and JWT generation
5
+ Author-email: TeamVortexSoftware <support@vortexsoftware.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/teamvortexsoftware/vortex-python-sdk
8
+ Project-URL: Repository, https://github.com/teamvortexsoftware/vortex-python-sdk.git
9
+ Project-URL: Documentation, https://docs.vortexsoftware.com/python-sdk
10
+ Project-URL: Changelog, https://github.com/teamvortexsoftware/vortex-python-sdk/blob/main/CHANGELOG.md
11
+ Keywords: vortex,invitations,jwt,api,sdk
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: httpx>=0.27.0
27
+ Requires-Dist: pydantic>=2.8.0
28
+ Requires-Dist: typing-extensions>=4.8.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
31
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
33
+ Requires-Dist: black>=23.0.0; extra == "dev"
34
+ Requires-Dist: isort>=5.12.0; extra == "dev"
35
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
36
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
37
+ Dynamic: license-file
38
+
39
+ # Vortex Python SDK
40
+
41
+ A Python SDK for Vortex invitation management and JWT generation.
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install vortex-python-sdk
47
+ ```
48
+
49
+ > **Note**: The package will be available on PyPI once published. See [PUBLISHING.md](PUBLISHING.md) for publishing instructions.
50
+
51
+ ## Usage
52
+
53
+ ### Basic Setup
54
+
55
+ ```python
56
+ from vortex_sdk import Vortex
57
+
58
+ # Initialize the client
59
+ vortex = Vortex(api_key="your-api-key")
60
+
61
+ # Or with custom base URL
62
+ vortex = Vortex(api_key="your-api-key", base_url="https://custom-api.example.com")
63
+ ```
64
+
65
+ ### JWT Generation
66
+
67
+ ```python
68
+ # Generate JWT for a user
69
+ jwt = vortex.generate_jwt({
70
+ "user_id": "user123",
71
+ "identifiers": {
72
+ "email": "user@example.com",
73
+ "username": "johndoe"
74
+ },
75
+ "groups": ["admin", "users"],
76
+ "role": "admin"
77
+ })
78
+
79
+ print(f"JWT: {jwt}")
80
+ ```
81
+
82
+ ### Invitation Management
83
+
84
+ #### Get Invitations by Target
85
+
86
+ ```python
87
+ import asyncio
88
+
89
+ async def get_user_invitations():
90
+ # Async version
91
+ invitations = await vortex.get_invitations_by_target("email", "user@example.com")
92
+ for invitation in invitations:
93
+ print(f"Invitation ID: {invitation.id}, Status: {invitation.status}")
94
+
95
+ # Sync version
96
+ invitations = vortex.get_invitations_by_target_sync("email", "user@example.com")
97
+ ```
98
+
99
+ #### Accept Invitations
100
+
101
+ ```python
102
+ async def accept_user_invitations():
103
+ # Async version
104
+ result = await vortex.accept_invitations(
105
+ invitation_ids=["inv1", "inv2"],
106
+ target={"type": "email", "value": "user@example.com"}
107
+ )
108
+ print(f"Result: {result}")
109
+
110
+ # Sync version
111
+ result = vortex.accept_invitations_sync(
112
+ invitation_ids=["inv1", "inv2"],
113
+ target={"type": "email", "value": "user@example.com"}
114
+ )
115
+ ```
116
+
117
+ #### Get Specific Invitation
118
+
119
+ ```python
120
+ async def get_invitation():
121
+ # Async version
122
+ invitation = await vortex.get_invitation("invitation-id")
123
+ print(f"Invitation: {invitation.id}")
124
+
125
+ # Sync version
126
+ invitation = vortex.get_invitation_sync("invitation-id")
127
+ ```
128
+
129
+ #### Revoke Invitation
130
+
131
+ ```python
132
+ async def revoke_invitation():
133
+ # Async version
134
+ result = await vortex.revoke_invitation("invitation-id")
135
+ print(f"Revoked: {result}")
136
+
137
+ # Sync version
138
+ result = vortex.revoke_invitation_sync("invitation-id")
139
+ ```
140
+
141
+ ### Group Operations
142
+
143
+ #### Get Invitations by Group
144
+
145
+ ```python
146
+ async def get_group_invitations():
147
+ # Async version
148
+ invitations = await vortex.get_invitations_by_group("organization", "org123")
149
+ print(f"Found {len(invitations)} invitations")
150
+
151
+ # Sync version
152
+ invitations = vortex.get_invitations_by_group_sync("organization", "org123")
153
+ ```
154
+
155
+ #### Delete Invitations by Group
156
+
157
+ ```python
158
+ async def delete_group_invitations():
159
+ # Async version
160
+ result = await vortex.delete_invitations_by_group("organization", "org123")
161
+ print(f"Deleted: {result}")
162
+
163
+ # Sync version
164
+ result = vortex.delete_invitations_by_group_sync("organization", "org123")
165
+ ```
166
+
167
+ #### Reinvite
168
+
169
+ ```python
170
+ async def reinvite_user():
171
+ # Async version
172
+ invitation = await vortex.reinvite("invitation-id")
173
+ print(f"Reinvited: {invitation.id}")
174
+
175
+ # Sync version
176
+ invitation = vortex.reinvite_sync("invitation-id")
177
+ ```
178
+
179
+ ### Context Manager Usage
180
+
181
+ ```python
182
+ # Async context manager
183
+ async with Vortex(api_key="your-api-key") as vortex:
184
+ invitations = await vortex.get_invitations_by_target("email", "user@example.com")
185
+
186
+ # Sync context manager
187
+ with Vortex(api_key="your-api-key") as vortex:
188
+ invitations = vortex.get_invitations_by_target_sync("email", "user@example.com")
189
+ ```
190
+
191
+ ### Error Handling
192
+
193
+ ```python
194
+ from vortex_sdk import VortexApiError
195
+
196
+ try:
197
+ invitation = vortex.get_invitation_sync("invalid-id")
198
+ except VortexApiError as e:
199
+ print(f"API Error: {e.message} (Status: {e.status_code})")
200
+ except Exception as e:
201
+ print(f"Unexpected error: {e}")
202
+ ```
203
+
204
+ ## Development
205
+
206
+ ### Installation
207
+
208
+ ```bash
209
+ # Install development dependencies
210
+ pip install -e ".[dev]"
211
+ ```
212
+
213
+ ### Running Tests
214
+
215
+ ```bash
216
+ pytest
217
+ ```
218
+
219
+ ### Code Formatting
220
+
221
+ ```bash
222
+ # Format code
223
+ black src/ tests/
224
+ isort src/ tests/
225
+
226
+ # Lint code
227
+ ruff check src/ tests/
228
+ mypy src/
229
+ ```
230
+
231
+ ## License
232
+
233
+ MIT
@@ -0,0 +1,195 @@
1
+ # Vortex Python SDK
2
+
3
+ A Python SDK for Vortex invitation management and JWT generation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install vortex-python-sdk
9
+ ```
10
+
11
+ > **Note**: The package will be available on PyPI once published. See [PUBLISHING.md](PUBLISHING.md) for publishing instructions.
12
+
13
+ ## Usage
14
+
15
+ ### Basic Setup
16
+
17
+ ```python
18
+ from vortex_sdk import Vortex
19
+
20
+ # Initialize the client
21
+ vortex = Vortex(api_key="your-api-key")
22
+
23
+ # Or with custom base URL
24
+ vortex = Vortex(api_key="your-api-key", base_url="https://custom-api.example.com")
25
+ ```
26
+
27
+ ### JWT Generation
28
+
29
+ ```python
30
+ # Generate JWT for a user
31
+ jwt = vortex.generate_jwt({
32
+ "user_id": "user123",
33
+ "identifiers": {
34
+ "email": "user@example.com",
35
+ "username": "johndoe"
36
+ },
37
+ "groups": ["admin", "users"],
38
+ "role": "admin"
39
+ })
40
+
41
+ print(f"JWT: {jwt}")
42
+ ```
43
+
44
+ ### Invitation Management
45
+
46
+ #### Get Invitations by Target
47
+
48
+ ```python
49
+ import asyncio
50
+
51
+ async def get_user_invitations():
52
+ # Async version
53
+ invitations = await vortex.get_invitations_by_target("email", "user@example.com")
54
+ for invitation in invitations:
55
+ print(f"Invitation ID: {invitation.id}, Status: {invitation.status}")
56
+
57
+ # Sync version
58
+ invitations = vortex.get_invitations_by_target_sync("email", "user@example.com")
59
+ ```
60
+
61
+ #### Accept Invitations
62
+
63
+ ```python
64
+ async def accept_user_invitations():
65
+ # Async version
66
+ result = await vortex.accept_invitations(
67
+ invitation_ids=["inv1", "inv2"],
68
+ target={"type": "email", "value": "user@example.com"}
69
+ )
70
+ print(f"Result: {result}")
71
+
72
+ # Sync version
73
+ result = vortex.accept_invitations_sync(
74
+ invitation_ids=["inv1", "inv2"],
75
+ target={"type": "email", "value": "user@example.com"}
76
+ )
77
+ ```
78
+
79
+ #### Get Specific Invitation
80
+
81
+ ```python
82
+ async def get_invitation():
83
+ # Async version
84
+ invitation = await vortex.get_invitation("invitation-id")
85
+ print(f"Invitation: {invitation.id}")
86
+
87
+ # Sync version
88
+ invitation = vortex.get_invitation_sync("invitation-id")
89
+ ```
90
+
91
+ #### Revoke Invitation
92
+
93
+ ```python
94
+ async def revoke_invitation():
95
+ # Async version
96
+ result = await vortex.revoke_invitation("invitation-id")
97
+ print(f"Revoked: {result}")
98
+
99
+ # Sync version
100
+ result = vortex.revoke_invitation_sync("invitation-id")
101
+ ```
102
+
103
+ ### Group Operations
104
+
105
+ #### Get Invitations by Group
106
+
107
+ ```python
108
+ async def get_group_invitations():
109
+ # Async version
110
+ invitations = await vortex.get_invitations_by_group("organization", "org123")
111
+ print(f"Found {len(invitations)} invitations")
112
+
113
+ # Sync version
114
+ invitations = vortex.get_invitations_by_group_sync("organization", "org123")
115
+ ```
116
+
117
+ #### Delete Invitations by Group
118
+
119
+ ```python
120
+ async def delete_group_invitations():
121
+ # Async version
122
+ result = await vortex.delete_invitations_by_group("organization", "org123")
123
+ print(f"Deleted: {result}")
124
+
125
+ # Sync version
126
+ result = vortex.delete_invitations_by_group_sync("organization", "org123")
127
+ ```
128
+
129
+ #### Reinvite
130
+
131
+ ```python
132
+ async def reinvite_user():
133
+ # Async version
134
+ invitation = await vortex.reinvite("invitation-id")
135
+ print(f"Reinvited: {invitation.id}")
136
+
137
+ # Sync version
138
+ invitation = vortex.reinvite_sync("invitation-id")
139
+ ```
140
+
141
+ ### Context Manager Usage
142
+
143
+ ```python
144
+ # Async context manager
145
+ async with Vortex(api_key="your-api-key") as vortex:
146
+ invitations = await vortex.get_invitations_by_target("email", "user@example.com")
147
+
148
+ # Sync context manager
149
+ with Vortex(api_key="your-api-key") as vortex:
150
+ invitations = vortex.get_invitations_by_target_sync("email", "user@example.com")
151
+ ```
152
+
153
+ ### Error Handling
154
+
155
+ ```python
156
+ from vortex_sdk import VortexApiError
157
+
158
+ try:
159
+ invitation = vortex.get_invitation_sync("invalid-id")
160
+ except VortexApiError as e:
161
+ print(f"API Error: {e.message} (Status: {e.status_code})")
162
+ except Exception as e:
163
+ print(f"Unexpected error: {e}")
164
+ ```
165
+
166
+ ## Development
167
+
168
+ ### Installation
169
+
170
+ ```bash
171
+ # Install development dependencies
172
+ pip install -e ".[dev]"
173
+ ```
174
+
175
+ ### Running Tests
176
+
177
+ ```bash
178
+ pytest
179
+ ```
180
+
181
+ ### Code Formatting
182
+
183
+ ```bash
184
+ # Format code
185
+ black src/ tests/
186
+ isort src/ tests/
187
+
188
+ # Lint code
189
+ ruff check src/ tests/
190
+ mypy src/
191
+ ```
192
+
193
+ ## License
194
+
195
+ MIT
@@ -0,0 +1,105 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vortex-python-sdk"
7
+ version = "0.0.1"
8
+ description = "Vortex Python SDK for invitation management and JWT generation"
9
+ authors = [{name = "TeamVortexSoftware", email = "support@vortexsoftware.com"}]
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ requires-python = ">=3.8"
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.8",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ ]
26
+ keywords = ["vortex", "invitations", "jwt", "api", "sdk"]
27
+
28
+ dependencies = [
29
+ "httpx>=0.27.0",
30
+ "pydantic>=2.8.0",
31
+ "typing-extensions>=4.8.0"
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ dev = [
36
+ "pytest>=7.0.0",
37
+ "pytest-asyncio>=0.21.0",
38
+ "pytest-cov>=4.0.0",
39
+ "black>=23.0.0",
40
+ "isort>=5.12.0",
41
+ "mypy>=1.0.0",
42
+ "ruff>=0.1.0"
43
+ ]
44
+
45
+ [project.urls]
46
+ Homepage = "https://github.com/teamvortexsoftware/vortex-python-sdk"
47
+ Repository = "https://github.com/teamvortexsoftware/vortex-python-sdk.git"
48
+ Documentation = "https://docs.vortexsoftware.com/python-sdk"
49
+ Changelog = "https://github.com/teamvortexsoftware/vortex-python-sdk/blob/main/CHANGELOG.md"
50
+
51
+ [tool.setuptools]
52
+ include-package-data = true
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["src"]
56
+
57
+ [tool.setuptools.package-data]
58
+ vortex_sdk = ["py.typed"]
59
+
60
+ [tool.setuptools.dynamic]
61
+
62
+ [tool.black]
63
+ line-length = 88
64
+ target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
65
+
66
+ [tool.isort]
67
+ profile = "black"
68
+ line_length = 88
69
+
70
+ [tool.mypy]
71
+ python_version = "3.8"
72
+ warn_return_any = true
73
+ warn_unused_configs = true
74
+ disallow_untyped_defs = true
75
+ disallow_incomplete_defs = true
76
+ check_untyped_defs = true
77
+ no_implicit_optional = true
78
+ warn_redundant_casts = true
79
+ warn_unused_ignores = true
80
+ warn_no_return = true
81
+ warn_unreachable = true
82
+
83
+ [tool.ruff]
84
+ target-version = "py38"
85
+ line-length = 88
86
+ select = [
87
+ "E", # pycodestyle errors
88
+ "W", # pycodestyle warnings
89
+ "F", # pyflakes
90
+ "I", # isort
91
+ "B", # flake8-bugbear
92
+ "C4", # flake8-comprehensions
93
+ "UP", # pyupgrade
94
+ ]
95
+
96
+ [tool.pytest.ini_options]
97
+ testpaths = ["tests"]
98
+ python_files = ["test_*.py", "*_test.py"]
99
+ python_classes = ["Test*"]
100
+ python_functions = ["test_*"]
101
+ addopts = "-v --tb=short --strict-markers"
102
+ markers = [
103
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
104
+ "integration: marks tests as integration tests"
105
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+