Update pyproject.toml and KeyDelivery class methods

- Version in pyproject.toml file changed from 0.9.0 to 0.9.1
- Changed return type of `realtime` and `detect_carrier` methods in KeyDelivery class to dict
- Added a new method `list_carriers` to the KeyDelivery class
This commit is contained in:
Kumi 2023-08-31 07:56:37 +02:00
parent 7fe9e42264
commit cbe4eb46c6
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 7 additions and 3 deletions

View file

@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "pykeydelivery"
version = "0.9.0"
version = "0.9.1"
authors = [
{ name="Kumi Mitterer", email="pykeydelivery@kumi.email" },
]

View file

@ -43,7 +43,7 @@ class KeyDelivery:
return request
def realtime(self, carrier: str, tracking_number: str) -> bytes:
def realtime(self, carrier: str, tracking_number: str) -> dict:
message = {
"carrier_id": carrier,
"tracking_number": tracking_number,
@ -52,10 +52,14 @@ class KeyDelivery:
request = self.get_request("tracking/realtime", message)
return request.execute()
def detect_carrier(self, tracking_number: str) -> bytes:
def detect_carrier(self, tracking_number: str) -> dict:
message = {
"tracking_number": tracking_number,
}
request = self.get_request("carriers/detect", message)
return request.execute()
def list_carriers(self) -> dict:
request = HTTPRequest("https://app.kd100.com/console/utils/kdbm")
return request.execute()