so-energy 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kieran Roper
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,65 @@
1
+ Metadata-Version: 2.4
2
+ Name: so-energy
3
+ Version: 0.1.0
4
+ Summary: Async Python client for the So Energy customer API (unofficial, reverse-engineered)
5
+ Author: Kieran Roper
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/KRoperUK/so-energy-py
8
+ Project-URL: Repository, https://github.com/KRoperUK/so-energy-py
9
+ Project-URL: Issues, https://github.com/KRoperUK/so-energy-py/issues
10
+ Project-URL: Changelog, https://github.com/KRoperUK/so-energy-py/blob/main/CHANGELOG.md
11
+ Keywords: so-energy,energy,utility,asyncio,homeassistant
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Framework :: AsyncIO
19
+ Classifier: Topic :: Home Automation
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: aiohttp>=3.9
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=9.2.0; extra == "dev"
27
+ Requires-Dist: pytest-asyncio>=1.5.0; extra == "dev"
28
+ Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
29
+ Requires-Dist: aresponses>=3.0; extra == "dev"
30
+ Requires-Dist: ruff>=0.17.6; extra == "dev"
31
+ Requires-Dist: mypy>=2.4.1; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # so-energy-py
35
+
36
+ > **Unofficial.** Not affiliated with or endorsed by So Energy. The API is
37
+ > reverse-engineered from the So Energy app and may change without notice.
38
+
39
+ Async Python client for the So Energy customer API, written for the
40
+ [So Energy Home Assistant integration](https://github.com/KRoperUK/so-energy-hass).
41
+
42
+ **Status: pre-alpha.** Only the exception hierarchy exists so far; the endpoints are
43
+ still being worked out (`docs/api-reference.md`).
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ pip install so-energy
49
+ ```
50
+
51
+ (Not on PyPI yet.)
52
+
53
+ ## Development
54
+
55
+ ```bash
56
+ uv venv
57
+ uv pip install -e ".[dev]"
58
+ pre-commit install
59
+ pre-commit run --all-files
60
+ pytest --cov=src/so_energy
61
+ ```
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,32 @@
1
+ # so-energy-py
2
+
3
+ > **Unofficial.** Not affiliated with or endorsed by So Energy. The API is
4
+ > reverse-engineered from the So Energy app and may change without notice.
5
+
6
+ Async Python client for the So Energy customer API, written for the
7
+ [So Energy Home Assistant integration](https://github.com/KRoperUK/so-energy-hass).
8
+
9
+ **Status: pre-alpha.** Only the exception hierarchy exists so far; the endpoints are
10
+ still being worked out (`docs/api-reference.md`).
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install so-energy
16
+ ```
17
+
18
+ (Not on PyPI yet.)
19
+
20
+ ## Development
21
+
22
+ ```bash
23
+ uv venv
24
+ uv pip install -e ".[dev]"
25
+ pre-commit install
26
+ pre-commit run --all-files
27
+ pytest --cov=src/so_energy
28
+ ```
29
+
30
+ ## License
31
+
32
+ MIT
@@ -0,0 +1,81 @@
1
+ [project]
2
+ name = "so-energy"
3
+ version = "0.1.0"
4
+ description = "Async Python client for the So Energy customer API (unofficial, reverse-engineered)"
5
+ readme = "README.md"
6
+ authors = [{ name = "Kieran Roper" }]
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ keywords = ["so-energy", "energy", "utility", "asyncio", "homeassistant"]
10
+ # 3.12 is the floor. Deliberately below the consuming integration's floor so the
11
+ # library stays usable standalone and on older Home Assistant releases.
12
+ requires-python = ">=3.12"
13
+ classifiers = [
14
+ "Development Status :: 2 - Pre-Alpha",
15
+ "Intended Audience :: Developers",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Framework :: AsyncIO",
21
+ "Topic :: Home Automation",
22
+ "Typing :: Typed",
23
+ ]
24
+ # Keep this floor low: Home Assistant pins aiohttp exactly (2026.8 uses 3.14.3), so
25
+ # raising it makes the library uninstallable on older HA releases.
26
+ dependencies = ["aiohttp>=3.9"]
27
+
28
+ [project.optional-dependencies]
29
+ dev = [
30
+ "pytest>=9.2.0",
31
+ "pytest-asyncio>=1.5.0",
32
+ "pytest-cov>=7.1.0",
33
+ "aresponses>=3.0",
34
+ "ruff>=0.17.6",
35
+ "mypy>=2.4.1",
36
+ ]
37
+
38
+ [project.urls]
39
+ Homepage = "https://github.com/KRoperUK/so-energy-py"
40
+ Repository = "https://github.com/KRoperUK/so-energy-py"
41
+ Issues = "https://github.com/KRoperUK/so-energy-py/issues"
42
+ Changelog = "https://github.com/KRoperUK/so-energy-py/blob/main/CHANGELOG.md"
43
+
44
+ [build-system]
45
+ requires = ["setuptools>=84.2.1"]
46
+ build-backend = "setuptools.build_meta"
47
+
48
+ [tool.setuptools.packages.find]
49
+ where = ["src"]
50
+
51
+ [tool.setuptools.package-data]
52
+ so_energy = ["py.typed"]
53
+
54
+ [tool.ruff]
55
+ target-version = "py312"
56
+ line-length = 120
57
+ src = ["src", "tests"]
58
+
59
+ [tool.ruff.lint]
60
+ select = ["E", "W", "F", "I", "UP", "B", "SIM"]
61
+ ignore = ["E501"]
62
+
63
+ [tool.mypy]
64
+ python_version = "3.12"
65
+ strict = true
66
+ files = ["src/so_energy", "tests"]
67
+ ignore_missing_imports = true
68
+
69
+ [tool.pytest.ini_options]
70
+ testpaths = ["tests"]
71
+ asyncio_mode = "auto"
72
+ asyncio_default_fixture_loop_scope = "function"
73
+ addopts = "-v --tb=short"
74
+
75
+ [tool.coverage.run]
76
+ source = ["src/so_energy"]
77
+ omit = ["tests/*"]
78
+
79
+ [tool.coverage.report]
80
+ show_missing = true
81
+ fail_under = 80
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """Async client for the So Energy customer API (unofficial, reverse-engineered)."""
2
+
3
+ from .exceptions import AuthError, NotLoggedInError, SoEnergyError
4
+
5
+ __all__ = ["AuthError", "NotLoggedInError", "SoEnergyError"]
@@ -0,0 +1,17 @@
1
+ """Exceptions raised by the client.
2
+
3
+ Kept free of Home Assistant so the integration can map them itself:
4
+ ``AuthError`` to ``ConfigEntryAuthFailed``, anything else to ``UpdateFailed``.
5
+ """
6
+
7
+
8
+ class SoEnergyError(Exception):
9
+ """Base class for every error this library raises."""
10
+
11
+
12
+ class AuthError(SoEnergyError):
13
+ """The service rejected the credentials. Never retry automatically."""
14
+
15
+
16
+ class NotLoggedInError(SoEnergyError):
17
+ """A data call was made without a valid token, or the token expired."""
File without changes
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.4
2
+ Name: so-energy
3
+ Version: 0.1.0
4
+ Summary: Async Python client for the So Energy customer API (unofficial, reverse-engineered)
5
+ Author: Kieran Roper
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/KRoperUK/so-energy-py
8
+ Project-URL: Repository, https://github.com/KRoperUK/so-energy-py
9
+ Project-URL: Issues, https://github.com/KRoperUK/so-energy-py/issues
10
+ Project-URL: Changelog, https://github.com/KRoperUK/so-energy-py/blob/main/CHANGELOG.md
11
+ Keywords: so-energy,energy,utility,asyncio,homeassistant
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Framework :: AsyncIO
19
+ Classifier: Topic :: Home Automation
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: aiohttp>=3.9
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=9.2.0; extra == "dev"
27
+ Requires-Dist: pytest-asyncio>=1.5.0; extra == "dev"
28
+ Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
29
+ Requires-Dist: aresponses>=3.0; extra == "dev"
30
+ Requires-Dist: ruff>=0.17.6; extra == "dev"
31
+ Requires-Dist: mypy>=2.4.1; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # so-energy-py
35
+
36
+ > **Unofficial.** Not affiliated with or endorsed by So Energy. The API is
37
+ > reverse-engineered from the So Energy app and may change without notice.
38
+
39
+ Async Python client for the So Energy customer API, written for the
40
+ [So Energy Home Assistant integration](https://github.com/KRoperUK/so-energy-hass).
41
+
42
+ **Status: pre-alpha.** Only the exception hierarchy exists so far; the endpoints are
43
+ still being worked out (`docs/api-reference.md`).
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ pip install so-energy
49
+ ```
50
+
51
+ (Not on PyPI yet.)
52
+
53
+ ## Development
54
+
55
+ ```bash
56
+ uv venv
57
+ uv pip install -e ".[dev]"
58
+ pre-commit install
59
+ pre-commit run --all-files
60
+ pytest --cov=src/so_energy
61
+ ```
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/so_energy/__init__.py
5
+ src/so_energy/exceptions.py
6
+ src/so_energy/py.typed
7
+ src/so_energy.egg-info/PKG-INFO
8
+ src/so_energy.egg-info/SOURCES.txt
9
+ src/so_energy.egg-info/dependency_links.txt
10
+ src/so_energy.egg-info/requires.txt
11
+ src/so_energy.egg-info/top_level.txt
12
+ tests/test_exceptions.py
@@ -0,0 +1,9 @@
1
+ aiohttp>=3.9
2
+
3
+ [dev]
4
+ pytest>=9.2.0
5
+ pytest-asyncio>=1.5.0
6
+ pytest-cov>=7.1.0
7
+ aresponses>=3.0
8
+ ruff>=0.17.6
9
+ mypy>=2.4.1
@@ -0,0 +1 @@
1
+ so_energy
@@ -0,0 +1,16 @@
1
+ """The exception hierarchy the integration relies on to tell auth failures apart."""
2
+
3
+ import pytest
4
+
5
+ from so_energy import AuthError, NotLoggedInError, SoEnergyError
6
+
7
+
8
+ @pytest.mark.parametrize("exc", [AuthError, NotLoggedInError])
9
+ def test_errors_share_one_base(exc: type[SoEnergyError]) -> None:
10
+ assert issubclass(exc, SoEnergyError)
11
+
12
+
13
+ def test_auth_error_is_not_a_session_error() -> None:
14
+ # The integration re-logs in once on NotLoggedInError but must never retry an AuthError.
15
+ assert not issubclass(AuthError, NotLoggedInError)
16
+ assert not issubclass(NotLoggedInError, AuthError)