seb-auth 0.1.0__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.
seb_auth-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SebAuth
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,194 @@
1
+ Metadata-Version: 2.4
2
+ Name: seb-auth
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for SebAuth — a Backend-as-a-Service for email, auth, and database.
5
+ Author: SebAuth
6
+ License: MIT
7
+ Project-URL: Homepage, https://seb-auth.lovable.app
8
+ Project-URL: Documentation, https://seb-auth.lovable.app
9
+ Project-URL: Source, https://github.com/sebauth/seb-auth-python
10
+ Project-URL: Issues, https://github.com/sebauth/seb-auth-python/issues
11
+ Keywords: sebauth,baas,email,auth,sdk,seb-auth
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: Communications :: Email
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: requests>=2.25.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0; extra == "dev"
31
+ Requires-Dist: pytest-mock>=3.10; extra == "dev"
32
+ Requires-Dist: responses>=0.23; extra == "dev"
33
+ Requires-Dist: build>=1.0; extra == "dev"
34
+ Requires-Dist: twine>=4.0; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ # seb-auth
38
+
39
+ **Official Python SDK for [SebAuth](https://seb-auth.lovable.app)** — a Backend-as-a-Service for email, authentication and database.
40
+
41
+ [![PyPI](https://img.shields.io/pypi/v/seb-auth.svg)](https://pypi.org/project/seb-auth/)
42
+ [![Python](https://img.shields.io/pypi/pyversions/seb-auth.svg)](https://pypi.org/project/seb-auth/)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44
+
45
+ ---
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install seb-auth
51
+ ```
52
+
53
+ ## Quick start
54
+
55
+ ```python
56
+ from seb_auth import SebAuth
57
+
58
+ # Reads SEBAUTH_API_KEY from the environment.
59
+ seb = SebAuth()
60
+
61
+ result = seb.email.send(
62
+ to="user@example.com",
63
+ subject="Hello",
64
+ body="Hello from SebAuth!",
65
+ )
66
+
67
+ print(result.id, result.status)
68
+ ```
69
+
70
+ Set your API key once and forget about it:
71
+
72
+ ```bash
73
+ export SEBAUTH_API_KEY="sk_live_..."
74
+ ```
75
+
76
+ Or pass it explicitly (never hard-code it in your source):
77
+
78
+ ```python
79
+ import os
80
+ from seb_auth import SebAuth
81
+
82
+ seb = SebAuth(api_key=os.environ["MY_SEBAUTH_KEY"])
83
+ ```
84
+
85
+ ## Features
86
+
87
+ - 📨 **Email** — send transactional email via `seb.email.send(...)`.
88
+ - 🔐 **Auth** — namespace reserved for upcoming SebAuth auth endpoints.
89
+ - 🗄️ **Database** — namespace reserved for upcoming SebAuth database endpoints.
90
+ - ⏱️ Sensible request **timeouts** (30 s default, per-call overridable).
91
+ - 🧯 Typed **exception hierarchy** for easy error handling.
92
+ - 🕵️ Never prints or logs your full API key.
93
+
94
+ ## Sending email
95
+
96
+ `seb.email.send(...)` makes a real HTTP request to
97
+ `POST https://seb-auth.lovable.app/api/public/v1/mail/send` and returns a
98
+ result object exposing everything SebAuth tells you about the message.
99
+
100
+ ```python
101
+ from seb_auth import SebAuth
102
+
103
+ seb = SebAuth()
104
+
105
+ result = seb.email.send(
106
+ to="jane@example.com",
107
+ subject="Welcome to Acme",
108
+ body="<h1>Hi Jane 👋</h1><p>Thanks for signing up!</p>",
109
+ )
110
+
111
+ print(result.id) # -> "e5e7eea2-..."
112
+ print(result.status) # -> "sent"
113
+ print(result.message_id) # -> "<...@gmail.com>"
114
+ print(result.sent_at) # -> ISO-8601 timestamp
115
+ ```
116
+
117
+ `SendEmailResult` is a normal `dict`, so `result["id"]` works too.
118
+
119
+ ## Error handling
120
+
121
+ Every exception raised by the SDK inherits from `SebAuthError`, so you can
122
+ catch everything with one clause or drill down as needed:
123
+
124
+ ```python
125
+ from seb_auth import (
126
+ SebAuth,
127
+ SebAuthError,
128
+ AuthenticationError,
129
+ BadRequestError,
130
+ RateLimitError,
131
+ TimeoutError,
132
+ ConnectionError,
133
+ )
134
+
135
+ seb = SebAuth()
136
+
137
+ try:
138
+ seb.email.send(to="user@example.com", subject="Hi", body="Hello!")
139
+ except AuthenticationError:
140
+ print("Your API key is invalid.")
141
+ except BadRequestError as e:
142
+ print("Bad request:", e.message)
143
+ except RateLimitError:
144
+ print("Slow down — you're being rate limited.")
145
+ except TimeoutError:
146
+ print("SebAuth took too long to respond.")
147
+ except ConnectionError:
148
+ print("Could not reach SebAuth.")
149
+ except SebAuthError as e:
150
+ print("Something else went wrong:", e)
151
+ ```
152
+
153
+ Every `APIError` exposes `status_code`, `message` and `response_body` for
154
+ easy debugging.
155
+
156
+ ## Configuration
157
+
158
+ | Argument | Env var | Default |
159
+ | ------------ | ------------------- | ------------------------------------ |
160
+ | `api_key` | `SEBAUTH_API_KEY` | — *(required)* |
161
+ | `base_url` | `SEBAUTH_BASE_URL` | `https://seb-auth.lovable.app` |
162
+ | `timeout` | — | `30` seconds |
163
+
164
+ You can also pass a custom `requests.Session` via `session=...` if you
165
+ need to configure retries, proxies, or connection pooling.
166
+
167
+ ## Context manager
168
+
169
+ `SebAuth` can be used as a context manager to guarantee that the
170
+ underlying HTTP session is closed:
171
+
172
+ ```python
173
+ with SebAuth() as seb:
174
+ seb.email.send(to="user@example.com", subject="Hi", body="Hello!")
175
+ ```
176
+
177
+ ## Roadmap
178
+
179
+ The SebAuth public API currently exposes the email endpoint. The
180
+ `seb.auth` and `seb.database` namespaces are reserved for upcoming
181
+ endpoints and will raise `NotImplementedError` until they ship.
182
+
183
+ ## Development
184
+
185
+ ```bash
186
+ git clone https://github.com/sebauth/seb-auth-python
187
+ cd seb-auth-python
188
+ pip install -e ".[dev]"
189
+ pytest
190
+ ```
191
+
192
+ ## License
193
+
194
+ MIT © SebAuth
@@ -0,0 +1,158 @@
1
+ # seb-auth
2
+
3
+ **Official Python SDK for [SebAuth](https://seb-auth.lovable.app)** — a Backend-as-a-Service for email, authentication and database.
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/seb-auth.svg)](https://pypi.org/project/seb-auth/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/seb-auth.svg)](https://pypi.org/project/seb-auth/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ---
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install seb-auth
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ ```python
20
+ from seb_auth import SebAuth
21
+
22
+ # Reads SEBAUTH_API_KEY from the environment.
23
+ seb = SebAuth()
24
+
25
+ result = seb.email.send(
26
+ to="user@example.com",
27
+ subject="Hello",
28
+ body="Hello from SebAuth!",
29
+ )
30
+
31
+ print(result.id, result.status)
32
+ ```
33
+
34
+ Set your API key once and forget about it:
35
+
36
+ ```bash
37
+ export SEBAUTH_API_KEY="sk_live_..."
38
+ ```
39
+
40
+ Or pass it explicitly (never hard-code it in your source):
41
+
42
+ ```python
43
+ import os
44
+ from seb_auth import SebAuth
45
+
46
+ seb = SebAuth(api_key=os.environ["MY_SEBAUTH_KEY"])
47
+ ```
48
+
49
+ ## Features
50
+
51
+ - 📨 **Email** — send transactional email via `seb.email.send(...)`.
52
+ - 🔐 **Auth** — namespace reserved for upcoming SebAuth auth endpoints.
53
+ - 🗄️ **Database** — namespace reserved for upcoming SebAuth database endpoints.
54
+ - ⏱️ Sensible request **timeouts** (30 s default, per-call overridable).
55
+ - 🧯 Typed **exception hierarchy** for easy error handling.
56
+ - 🕵️ Never prints or logs your full API key.
57
+
58
+ ## Sending email
59
+
60
+ `seb.email.send(...)` makes a real HTTP request to
61
+ `POST https://seb-auth.lovable.app/api/public/v1/mail/send` and returns a
62
+ result object exposing everything SebAuth tells you about the message.
63
+
64
+ ```python
65
+ from seb_auth import SebAuth
66
+
67
+ seb = SebAuth()
68
+
69
+ result = seb.email.send(
70
+ to="jane@example.com",
71
+ subject="Welcome to Acme",
72
+ body="<h1>Hi Jane 👋</h1><p>Thanks for signing up!</p>",
73
+ )
74
+
75
+ print(result.id) # -> "e5e7eea2-..."
76
+ print(result.status) # -> "sent"
77
+ print(result.message_id) # -> "<...@gmail.com>"
78
+ print(result.sent_at) # -> ISO-8601 timestamp
79
+ ```
80
+
81
+ `SendEmailResult` is a normal `dict`, so `result["id"]` works too.
82
+
83
+ ## Error handling
84
+
85
+ Every exception raised by the SDK inherits from `SebAuthError`, so you can
86
+ catch everything with one clause or drill down as needed:
87
+
88
+ ```python
89
+ from seb_auth import (
90
+ SebAuth,
91
+ SebAuthError,
92
+ AuthenticationError,
93
+ BadRequestError,
94
+ RateLimitError,
95
+ TimeoutError,
96
+ ConnectionError,
97
+ )
98
+
99
+ seb = SebAuth()
100
+
101
+ try:
102
+ seb.email.send(to="user@example.com", subject="Hi", body="Hello!")
103
+ except AuthenticationError:
104
+ print("Your API key is invalid.")
105
+ except BadRequestError as e:
106
+ print("Bad request:", e.message)
107
+ except RateLimitError:
108
+ print("Slow down — you're being rate limited.")
109
+ except TimeoutError:
110
+ print("SebAuth took too long to respond.")
111
+ except ConnectionError:
112
+ print("Could not reach SebAuth.")
113
+ except SebAuthError as e:
114
+ print("Something else went wrong:", e)
115
+ ```
116
+
117
+ Every `APIError` exposes `status_code`, `message` and `response_body` for
118
+ easy debugging.
119
+
120
+ ## Configuration
121
+
122
+ | Argument | Env var | Default |
123
+ | ------------ | ------------------- | ------------------------------------ |
124
+ | `api_key` | `SEBAUTH_API_KEY` | — *(required)* |
125
+ | `base_url` | `SEBAUTH_BASE_URL` | `https://seb-auth.lovable.app` |
126
+ | `timeout` | — | `30` seconds |
127
+
128
+ You can also pass a custom `requests.Session` via `session=...` if you
129
+ need to configure retries, proxies, or connection pooling.
130
+
131
+ ## Context manager
132
+
133
+ `SebAuth` can be used as a context manager to guarantee that the
134
+ underlying HTTP session is closed:
135
+
136
+ ```python
137
+ with SebAuth() as seb:
138
+ seb.email.send(to="user@example.com", subject="Hi", body="Hello!")
139
+ ```
140
+
141
+ ## Roadmap
142
+
143
+ The SebAuth public API currently exposes the email endpoint. The
144
+ `seb.auth` and `seb.database` namespaces are reserved for upcoming
145
+ endpoints and will raise `NotImplementedError` until they ship.
146
+
147
+ ## Development
148
+
149
+ ```bash
150
+ git clone https://github.com/sebauth/seb-auth-python
151
+ cd seb-auth-python
152
+ pip install -e ".[dev]"
153
+ pytest
154
+ ```
155
+
156
+ ## License
157
+
158
+ MIT © SebAuth
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "seb-auth"
7
+ version = "0.1.0"
8
+ description = "Official Python SDK for SebAuth — a Backend-as-a-Service for email, auth, and database."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "SebAuth" }
14
+ ]
15
+ keywords = ["sebauth", "baas", "email", "auth", "sdk", "seb-auth"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.8",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Topic :: Communications :: Email",
30
+ ]
31
+ dependencies = [
32
+ "requests>=2.25.0",
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "pytest>=7.0",
38
+ "pytest-mock>=3.10",
39
+ "responses>=0.23",
40
+ "build>=1.0",
41
+ "twine>=4.0",
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://seb-auth.lovable.app"
46
+ Documentation = "https://seb-auth.lovable.app"
47
+ Source = "https://github.com/sebauth/seb-auth-python"
48
+ Issues = "https://github.com/sebauth/seb-auth-python/issues"
49
+
50
+ [tool.setuptools.packages.find]
51
+ include = ["seb_auth*"]
52
+ exclude = ["tests*"]
@@ -0,0 +1,46 @@
1
+ """
2
+ seb-auth: Official Python SDK for SebAuth.
3
+
4
+ Example:
5
+ from seb_auth import SebAuth
6
+
7
+ seb = SebAuth() # reads SEBAUTH_API_KEY from env
8
+ seb.email.send(
9
+ to="user@example.com",
10
+ subject="Hello",
11
+ body="Hello from SebAuth!",
12
+ )
13
+ """
14
+
15
+ from .client import SebAuth
16
+ from .exceptions import (
17
+ SebAuthError,
18
+ AuthenticationError,
19
+ APIError,
20
+ BadRequestError,
21
+ NotFoundError,
22
+ RateLimitError,
23
+ ServerError,
24
+ TimeoutError,
25
+ ConnectionError,
26
+ InvalidResponseError,
27
+ ConfigurationError,
28
+ )
29
+
30
+ __version__ = "0.1.0"
31
+
32
+ __all__ = [
33
+ "SebAuth",
34
+ "SebAuthError",
35
+ "AuthenticationError",
36
+ "APIError",
37
+ "BadRequestError",
38
+ "NotFoundError",
39
+ "RateLimitError",
40
+ "ServerError",
41
+ "TimeoutError",
42
+ "ConnectionError",
43
+ "InvalidResponseError",
44
+ "ConfigurationError",
45
+ "__version__",
46
+ ]
@@ -0,0 +1,43 @@
1
+ """Auth service placeholder.
2
+
3
+ The SebAuth authentication endpoints are not yet exposed on the public
4
+ API surface. This module reserves the ``seb.auth`` namespace so that
5
+ methods can be added without breaking users of the SDK.
6
+
7
+ Any call on this service will raise :class:`NotImplementedError` with a
8
+ clear message pointing users at the SebAuth changelog.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from typing import TYPE_CHECKING
14
+
15
+ if TYPE_CHECKING: # pragma: no cover
16
+ from .client import SebAuth
17
+
18
+ __all__ = ["AuthService"]
19
+
20
+
21
+ class AuthService:
22
+ """Placeholder for future SebAuth authentication endpoints."""
23
+
24
+ def __init__(self, client: "SebAuth") -> None:
25
+ self._client = client
26
+
27
+ def _not_yet_available(self, feature: str) -> "NotImplementedError":
28
+ return NotImplementedError(
29
+ f"seb.auth.{feature} is not yet available in the public SebAuth API. "
30
+ "This namespace is reserved for future releases of the SDK."
31
+ )
32
+
33
+ def sign_up(self, *args, **kwargs): # pragma: no cover - stub
34
+ raise self._not_yet_available("sign_up")
35
+
36
+ def sign_in(self, *args, **kwargs): # pragma: no cover - stub
37
+ raise self._not_yet_available("sign_in")
38
+
39
+ def sign_out(self, *args, **kwargs): # pragma: no cover - stub
40
+ raise self._not_yet_available("sign_out")
41
+
42
+ def get_user(self, *args, **kwargs): # pragma: no cover - stub
43
+ raise self._not_yet_available("get_user")