bookalimo 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
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.
- bookalimo/_client.py +1 -14
- bookalimo/exceptions.py +15 -0
- bookalimo/wrapper.py +2 -1
- {bookalimo-0.1.2.dist-info → bookalimo-0.1.3.dist-info}/METADATA +24 -25
- bookalimo-0.1.3.dist-info/RECORD +11 -0
- bookalimo-0.1.2.dist-info/RECORD +0 -10
- {bookalimo-0.1.2.dist-info → bookalimo-0.1.3.dist-info}/WHEEL +0 -0
- {bookalimo-0.1.2.dist-info → bookalimo-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {bookalimo-0.1.2.dist-info → bookalimo-0.1.3.dist-info}/top_level.txt +0 -0
bookalimo/_client.py
CHANGED
@@ -10,6 +10,7 @@ from typing import Any, Optional, cast
|
|
10
10
|
import httpx
|
11
11
|
from pydantic import BaseModel
|
12
12
|
|
13
|
+
from .exceptions import BookALimoError
|
13
14
|
from .models import (
|
14
15
|
BookRequest,
|
15
16
|
BookResponse,
|
@@ -37,20 +38,6 @@ def get_version() -> str:
|
|
37
38
|
return __version__
|
38
39
|
|
39
40
|
|
40
|
-
class BookALimoError(Exception):
|
41
|
-
"""Base exception for Book-A-Limo API errors."""
|
42
|
-
|
43
|
-
def __init__(
|
44
|
-
self,
|
45
|
-
message: str,
|
46
|
-
status_code: Optional[int] = None,
|
47
|
-
response_data: Optional[dict[str, Any]] = None,
|
48
|
-
):
|
49
|
-
super().__init__(message)
|
50
|
-
self.status_code = status_code
|
51
|
-
self.response_data = response_data or {}
|
52
|
-
|
53
|
-
|
54
41
|
class BookALimoClient:
|
55
42
|
"""
|
56
43
|
Base HTTP client for Book-A-Limo API.
|
bookalimo/exceptions.py
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
from typing import Any, Optional
|
2
|
+
|
3
|
+
|
4
|
+
class BookALimoError(Exception):
|
5
|
+
"""Base exception for Book-A-Limo API errors."""
|
6
|
+
|
7
|
+
def __init__(
|
8
|
+
self,
|
9
|
+
message: str,
|
10
|
+
status_code: Optional[int] = None,
|
11
|
+
response_data: Optional[dict[str, Any]] = None,
|
12
|
+
):
|
13
|
+
super().__init__(message)
|
14
|
+
self.status_code = status_code
|
15
|
+
self.response_data = response_data or {}
|
bookalimo/wrapper.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bookalimo
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: Python wrapper for the Book-A-Limo API
|
5
5
|
Author-email: Jonathan Oren <jonathan@bookalimo.com>
|
6
6
|
Maintainer-email: Jonathan Oren <jonathan@bookalimo.com>
|
@@ -63,13 +63,13 @@ Dynamic: license-file
|
|
63
63
|
[](https://opensource.org/licenses/MIT)
|
64
64
|
[](https://github.com/astral-sh/ruff)
|
65
65
|
|
66
|
-
A modern, async Python wrapper for the Book-A-Limo API with full type support.
|
66
|
+
A modern, async Python wrapper for the Book-A-Limo API with full type support. Built on top of `httpx` and `pydantic`.
|
67
67
|
|
68
68
|
## Features
|
69
69
|
|
70
|
-
* **
|
71
|
-
* **Typed
|
72
|
-
* **Input validation**
|
70
|
+
* **Asynchronous**
|
71
|
+
* **Fully Typed** for requests & responses
|
72
|
+
* **Input validation** including airports and addresses.
|
73
73
|
* **Clean, minimal interface** for each API operation
|
74
74
|
* **Custom exceptions & error handling**
|
75
75
|
* **Tests and examples**
|
@@ -104,24 +104,23 @@ async def main():
|
|
104
104
|
# For Travel Agents (customers: pass is_customer=True)
|
105
105
|
credentials = create_credentials("TA10007", "your_password")
|
106
106
|
|
107
|
-
async with
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
print(f"- {price.car_description}: ${price.price}")
|
107
|
+
async with BookALimo(credentials) as client:
|
108
|
+
# Build locations
|
109
|
+
pickup = create_airport_location("JFK", "New York")
|
110
|
+
dropoff = create_address_location("53 East 34th Street, Manhattan")
|
111
|
+
|
112
|
+
prices = await client.get_prices(
|
113
|
+
rate_type=RateType.P2P,
|
114
|
+
date_time="09/05/2025 12:44 AM",
|
115
|
+
pickup=pickup,
|
116
|
+
dropoff=dropoff,
|
117
|
+
passengers=2,
|
118
|
+
luggage=3,
|
119
|
+
)
|
120
|
+
|
121
|
+
print(f"Available cars: {len(prices.prices)}")
|
122
|
+
for price in prices.prices:
|
123
|
+
print(f"- {price.car_description}: ${price.price}")
|
125
124
|
|
126
125
|
if __name__ == "__main__":
|
127
126
|
asyncio.run(main())
|
@@ -241,7 +240,7 @@ stops = [
|
|
241
240
|
### Using Account Info (Travel Agents)
|
242
241
|
|
243
242
|
```python
|
244
|
-
from bookalimo.models import Account
|
243
|
+
from bookalimo.models import Account
|
245
244
|
|
246
245
|
account = Account(
|
247
246
|
id="TA10007",
|
@@ -279,7 +278,7 @@ cancel_result = await client.edit_reservation(
|
|
279
278
|
## Error Handling
|
280
279
|
|
281
280
|
```python
|
282
|
-
from bookalimo.
|
281
|
+
from bookalimo.exceptions import BookALimoError
|
283
282
|
|
284
283
|
try:
|
285
284
|
reservations = await client.list_reservations()
|
@@ -0,0 +1,11 @@
|
|
1
|
+
bookalimo/__init__.py,sha256=ch1t7uvw_F3zNpqb-IfH0n2sDwFLnAQDgm2lpwtvpj4,568
|
2
|
+
bookalimo/_client.py,sha256=vju39534nm-6TVBZ7H74VTZIKdYOAnQiN1nFUqifRTM,11166
|
3
|
+
bookalimo/exceptions.py,sha256=ubOUZiXGEOWZvXyz2D5f5zwxBlQZVDBv1uOPmokAQ6Q,404
|
4
|
+
bookalimo/models.py,sha256=-gvxrT7llrYLxSHWn3vpmvkQqnk2ejSd97Sw8BxgBLw,16420
|
5
|
+
bookalimo/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
6
|
+
bookalimo/wrapper.py,sha256=tlhfGR6jQqnx33GO6d3fQZ8a5294UkftC1ORcvbhDww,11896
|
7
|
+
bookalimo-0.1.3.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
bookalimo-0.1.3.dist-info/METADATA,sha256=9CXiMDcKrhLe_2pHpVlYA7UTo8twYGmMOsl933V4vXo,8857
|
9
|
+
bookalimo-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
10
|
+
bookalimo-0.1.3.dist-info/top_level.txt,sha256=ZgYiDX2GfZCp4pevWn4X2qyEr-Dh7-cq5Y1j2jMhB1s,10
|
11
|
+
bookalimo-0.1.3.dist-info/RECORD,,
|
bookalimo-0.1.2.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
bookalimo/__init__.py,sha256=ch1t7uvw_F3zNpqb-IfH0n2sDwFLnAQDgm2lpwtvpj4,568
|
2
|
-
bookalimo/_client.py,sha256=H5PYZ3S1OMqaP8kzsZfqyTnvyOwGeg_WsCG2Imb5-98,11498
|
3
|
-
bookalimo/models.py,sha256=-gvxrT7llrYLxSHWn3vpmvkQqnk2ejSd97Sw8BxgBLw,16420
|
4
|
-
bookalimo/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
5
|
-
bookalimo/wrapper.py,sha256=zialtJGS7mK7aXHyTIcAQghIDai9W73dbRln0Lz7ndE,11873
|
6
|
-
bookalimo-0.1.2.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
bookalimo-0.1.2.dist-info/METADATA,sha256=XWdArhmpR0SfcsQtD10Y1EG6kBHAshbx_Xy25SG00ss,9005
|
8
|
-
bookalimo-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
-
bookalimo-0.1.2.dist-info/top_level.txt,sha256=ZgYiDX2GfZCp4pevWn4X2qyEr-Dh7-cq5Y1j2jMhB1s,10
|
10
|
-
bookalimo-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|