fiftyfive 0.2.0__tar.gz → 0.4.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.
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/PKG-INFO +8 -7
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/README.md +7 -6
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/example.py +8 -7
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/fiftyfive/api.py +14 -2
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/pyproject.toml +1 -1
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/.github/workflows/release.yaml +0 -0
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/.gitignore +0 -0
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/LICENSE +0 -0
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/fiftyfive/__init__.py +0 -0
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/fiftyfive/decorators.py +0 -0
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/fiftyfive/models.py +0 -0
- {fiftyfive-0.2.0 → fiftyfive-0.4.0}/fiftyfive/requests.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fiftyfive
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Python 3 package to retrieve EV charger data from 50five
|
|
5
5
|
Project-URL: Homepage, https://github.com/Crazy-Duck/fiftyfive
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/Crazy-Duck/fiftyfive/issues
|
|
@@ -29,14 +29,14 @@ pip3 install fiftyfive
|
|
|
29
29
|
import asyncio
|
|
30
30
|
|
|
31
31
|
from aiohttp import ClientSession
|
|
32
|
-
from fiftyfive import Api, Market, NetworkOverview
|
|
32
|
+
from fiftyfive import Api, CustomerType, Market, NetworkOverview
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
async def main():
|
|
36
36
|
"""Main module"""
|
|
37
37
|
|
|
38
38
|
async with ClientSession() as session:
|
|
39
|
-
api = Api(session, "email", "password", Market.BELUX)
|
|
39
|
+
api = Api(session, "email", "password", Market.BELUX, CustomerType.FORMER_SHELL)
|
|
40
40
|
|
|
41
41
|
result = await api.make_requests([NetworkOverview()])
|
|
42
42
|
print(result)
|
|
@@ -49,7 +49,8 @@ if __name__ == "__main__":
|
|
|
49
49
|
|
|
50
50
|
## WARNING
|
|
51
51
|
|
|
52
|
-
50five uses separate endpoints depending on the market (belux, nl, de, ...)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
50five uses separate endpoints depending on the market (belux, nl, de, ...) as
|
|
53
|
+
well as whether or not you were migrated over from Shell Recharge. As I myself
|
|
54
|
+
only have access to an account in the belux market as an ex-Shell customer, I
|
|
55
|
+
cannot do any testing/reverse engineering on the other markets, so I can't give
|
|
56
|
+
any guarantee anything will work for accounts in them.
|
|
@@ -14,14 +14,14 @@ pip3 install fiftyfive
|
|
|
14
14
|
import asyncio
|
|
15
15
|
|
|
16
16
|
from aiohttp import ClientSession
|
|
17
|
-
from fiftyfive import Api, Market, NetworkOverview
|
|
17
|
+
from fiftyfive import Api, CustomerType, Market, NetworkOverview
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
async def main():
|
|
21
21
|
"""Main module"""
|
|
22
22
|
|
|
23
23
|
async with ClientSession() as session:
|
|
24
|
-
api = Api(session, "email", "password", Market.BELUX)
|
|
24
|
+
api = Api(session, "email", "password", Market.BELUX, CustomerType.FORMER_SHELL)
|
|
25
25
|
|
|
26
26
|
result = await api.make_requests([NetworkOverview()])
|
|
27
27
|
print(result)
|
|
@@ -34,7 +34,8 @@ if __name__ == "__main__":
|
|
|
34
34
|
|
|
35
35
|
## WARNING
|
|
36
36
|
|
|
37
|
-
50five uses separate endpoints depending on the market (belux, nl, de, ...)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
50five uses separate endpoints depending on the market (belux, nl, de, ...) as
|
|
38
|
+
well as whether or not you were migrated over from Shell Recharge. As I myself
|
|
39
|
+
only have access to an account in the belux market as an ex-Shell customer, I
|
|
40
|
+
cannot do any testing/reverse engineering on the other markets, so I can't give
|
|
41
|
+
any guarantee anything will work for accounts in them.
|
|
@@ -9,7 +9,7 @@ from sys import stdout
|
|
|
9
9
|
from aiohttp import ClientSession
|
|
10
10
|
from dotenv import load_dotenv
|
|
11
11
|
|
|
12
|
-
from fiftyfive import Api, Market, NetworkOverview,
|
|
12
|
+
from fiftyfive import Api, CustomerType, Market, NetworkOverview, Overview
|
|
13
13
|
|
|
14
14
|
load_dotenv()
|
|
15
15
|
|
|
@@ -18,19 +18,20 @@ async def main():
|
|
|
18
18
|
"""Main module"""
|
|
19
19
|
|
|
20
20
|
async with ClientSession() as session:
|
|
21
|
-
api = Api(session, getenv("50FIVE_EMAIL"), getenv("50FIVE_PASSWORD"), Market.BELUX)
|
|
21
|
+
api = Api(session, getenv("50FIVE_EMAIL"), getenv("50FIVE_PASSWORD"), Market.BELUX, CustomerType.FORMER_SHELL)
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
networks = await api.make_requests([NetworkOverview()])
|
|
24
|
+
networks[0] += networks[0]
|
|
25
25
|
|
|
26
26
|
details = await api.make_requests(
|
|
27
27
|
[
|
|
28
|
-
|
|
29
|
-
for
|
|
28
|
+
Overview(network["IDX"])
|
|
29
|
+
for network in networks[0]
|
|
30
30
|
]
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
-
[
|
|
33
|
+
result = [c | d[0] for c, d in zip(networks[0], details, strict=True)]
|
|
34
|
+
[print(r) for r in result]
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
if __name__ == "__main__":
|
|
@@ -19,17 +19,29 @@ class Market(StrEnum):
|
|
|
19
19
|
UK = "uk"
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
class CustomerType(StrEnum):
|
|
23
|
+
"""Enum type for customers."""
|
|
24
|
+
|
|
25
|
+
FIFTYFIVE = "fiftyfive"
|
|
26
|
+
FORMER_SHELL = "shell"
|
|
27
|
+
|
|
28
|
+
|
|
22
29
|
class Api:
|
|
23
30
|
"""Class to make API requests"""
|
|
24
31
|
|
|
25
32
|
def __init__(
|
|
26
|
-
self,
|
|
33
|
+
self,
|
|
34
|
+
session: ClientSession,
|
|
35
|
+
email: str,
|
|
36
|
+
password: str,
|
|
37
|
+
market: Market,
|
|
38
|
+
customer_type=CustomerType.FORMER_SHELL,
|
|
27
39
|
):
|
|
28
40
|
"""Initilaize the session."""
|
|
29
41
|
self.session = session
|
|
30
42
|
self.email = email
|
|
31
43
|
self.password = password
|
|
32
|
-
self.url = f"https://50five-s{market}.evc-net.com"
|
|
44
|
+
self.url = f"https://50five{'-s' if customer_type == CustomerType.FORMER_SHELL else ''}{market}.evc-net.com"
|
|
33
45
|
self.api = f"{self.url}/api/ajax"
|
|
34
46
|
self.logger = logging.getLogger("50five")
|
|
35
47
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|