bookalimo 0.1.2__tar.gz → 0.1.3__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.
- {bookalimo-0.1.2/src/bookalimo.egg-info → bookalimo-0.1.3}/PKG-INFO +24 -25
- {bookalimo-0.1.2 → bookalimo-0.1.3}/README.md +23 -24
- {bookalimo-0.1.2 → bookalimo-0.1.3}/pyproject.toml +1 -1
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo/_client.py +1 -14
- bookalimo-0.1.3/src/bookalimo/exceptions.py +15 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo/wrapper.py +2 -1
- {bookalimo-0.1.2 → bookalimo-0.1.3/src/bookalimo.egg-info}/PKG-INFO +24 -25
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo.egg-info/SOURCES.txt +1 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/tests/test_client.py +2 -1
- {bookalimo-0.1.2 → bookalimo-0.1.3}/LICENSE +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/setup.cfg +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo/__init__.py +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo/models.py +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo/py.typed +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo.egg-info/dependency_links.txt +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo.egg-info/requires.txt +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/src/bookalimo.egg-info/top_level.txt +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/tests/test_models.py +0 -0
- {bookalimo-0.1.2 → bookalimo-0.1.3}/tests/test_wrapper.py +0 -0
@@ -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()
|
@@ -5,13 +5,13 @@
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
6
6
|
[](https://github.com/astral-sh/ruff)
|
7
7
|
|
8
|
-
A modern, async Python wrapper for the Book-A-Limo API with full type support.
|
8
|
+
A modern, async Python wrapper for the Book-A-Limo API with full type support. Built on top of `httpx` and `pydantic`.
|
9
9
|
|
10
10
|
## Features
|
11
11
|
|
12
|
-
* **
|
13
|
-
* **Typed
|
14
|
-
* **Input validation**
|
12
|
+
* **Asynchronous**
|
13
|
+
* **Fully Typed** for requests & responses
|
14
|
+
* **Input validation** including airports and addresses.
|
15
15
|
* **Clean, minimal interface** for each API operation
|
16
16
|
* **Custom exceptions & error handling**
|
17
17
|
* **Tests and examples**
|
@@ -46,24 +46,23 @@ async def main():
|
|
46
46
|
# For Travel Agents (customers: pass is_customer=True)
|
47
47
|
credentials = create_credentials("TA10007", "your_password")
|
48
48
|
|
49
|
-
async with
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
print(f"- {price.car_description}: ${price.price}")
|
49
|
+
async with BookALimo(credentials) as client:
|
50
|
+
# Build locations
|
51
|
+
pickup = create_airport_location("JFK", "New York")
|
52
|
+
dropoff = create_address_location("53 East 34th Street, Manhattan")
|
53
|
+
|
54
|
+
prices = await client.get_prices(
|
55
|
+
rate_type=RateType.P2P,
|
56
|
+
date_time="09/05/2025 12:44 AM",
|
57
|
+
pickup=pickup,
|
58
|
+
dropoff=dropoff,
|
59
|
+
passengers=2,
|
60
|
+
luggage=3,
|
61
|
+
)
|
62
|
+
|
63
|
+
print(f"Available cars: {len(prices.prices)}")
|
64
|
+
for price in prices.prices:
|
65
|
+
print(f"- {price.car_description}: ${price.price}")
|
67
66
|
|
68
67
|
if __name__ == "__main__":
|
69
68
|
asyncio.run(main())
|
@@ -183,7 +182,7 @@ stops = [
|
|
183
182
|
### Using Account Info (Travel Agents)
|
184
183
|
|
185
184
|
```python
|
186
|
-
from bookalimo.models import Account
|
185
|
+
from bookalimo.models import Account
|
187
186
|
|
188
187
|
account = Account(
|
189
188
|
id="TA10007",
|
@@ -221,7 +220,7 @@ cancel_result = await client.edit_reservation(
|
|
221
220
|
## Error Handling
|
222
221
|
|
223
222
|
```python
|
224
|
-
from bookalimo.
|
223
|
+
from bookalimo.exceptions import BookALimoError
|
225
224
|
|
226
225
|
try:
|
227
226
|
reservations = await client.list_reservations()
|
@@ -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.
|
@@ -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 {}
|
@@ -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()
|
@@ -4,7 +4,8 @@ import httpx
|
|
4
4
|
import pytest
|
5
5
|
import respx
|
6
6
|
|
7
|
-
from bookalimo._client import BookALimoClient
|
7
|
+
from bookalimo._client import BookALimoClient
|
8
|
+
from bookalimo.exceptions import BookALimoError
|
8
9
|
from bookalimo.models import ListReservationsResponse
|
9
10
|
|
10
11
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|