bookalimo 0.1.1__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.
@@ -0,0 +1,331 @@
1
+ Metadata-Version: 2.4
2
+ Name: bookalimo
3
+ Version: 0.1.1
4
+ Summary: Python wrapper for the Book-A-Limo API
5
+ Author-email: Jonathan Oren <jonathan@bookalimo.com>
6
+ Maintainer-email: Jonathan Oren <jonathan@bookalimo.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/yourusername/bookalimo-python
9
+ Project-URL: Documentation, https://yourusername.github.io/bookalimo-python
10
+ Project-URL: Repository, https://github.com/yourusername/bookalimo-python
11
+ Project-URL: Issues, https://github.com/yourusername/bookalimo-python/issues
12
+ Project-URL: Changelog, https://github.com/yourusername/bookalimo-python/blob/main/CHANGELOG.md
13
+ Keywords: bookalimo,api,transportation,booking
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: httpx>=0.25.0
29
+ Requires-Dist: pydantic>=2.0.0
30
+ Requires-Dist: pycountry>=22.0.0
31
+ Requires-Dist: us>=3.0.0
32
+ Requires-Dist: airportsdata>=20230101
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
35
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
36
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
37
+ Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
38
+ Requires-Dist: httpx[mock]>=0.25.0; extra == "dev"
39
+ Requires-Dist: respx>=0.20.0; extra == "dev"
40
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
41
+ Requires-Dist: mypy>=1.5.0; extra == "dev"
42
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
43
+ Requires-Dist: mkdocs>=1.5.0; extra == "dev"
44
+ Requires-Dist: mkdocs-material>=9.0.0; extra == "dev"
45
+ Requires-Dist: mkdocstrings[python]>=0.23.0; extra == "dev"
46
+ Provides-Extra: docs
47
+ Requires-Dist: mkdocs>=1.5.0; extra == "docs"
48
+ Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
49
+ Requires-Dist: mkdocstrings[python]>=0.23.0; extra == "docs"
50
+ Provides-Extra: test
51
+ Requires-Dist: pytest>=7.0.0; extra == "test"
52
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
53
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
54
+ Requires-Dist: pytest-mock>=3.10.0; extra == "test"
55
+ Requires-Dist: httpx[mock]>=0.25.0; extra == "test"
56
+ Requires-Dist: respx>=0.20.0; extra == "test"
57
+ Dynamic: license-file
58
+
59
+ # Book-A-Limo Python SDK
60
+
61
+ [![PyPI version](https://badge.fury.io/py/bookalimo.svg)](https://badge.fury.io/py/bookalimo)
62
+ [![Python Support](https://img.shields.io/pypi/pyversions/bookalimo.svg)](https://pypi.org/project/bookalimo/)
63
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
64
+ [![Code style: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
65
+
66
+ A modern, async Python wrapper for the Book-A-Limo API with full type support.
67
+
68
+ ## Features
69
+
70
+ * **Async/await** (built on `httpx`)
71
+ * **Typed Pydantic models** for requests & responses
72
+ * **Input validation**
73
+ * **Clean, minimal interface** for each API operation
74
+ * **Custom exceptions & error handling**
75
+ * **Tests and examples**
76
+
77
+ ## Requirements
78
+
79
+ * Python **3.9+** (`pyproject.toml` sets `requires-python = ">=3.9"`)
80
+ * An async event loop (examples use `asyncio`)
81
+ * Time strings use **`MM/dd/yyyy hh:mm tt`** (e.g., `09/05/2025 12:44 AM`)
82
+
83
+ ## Installation
84
+
85
+ ```bash
86
+ pip install bookalimo
87
+ ```
88
+
89
+ ## Quick Start
90
+
91
+ ```python
92
+ import asyncio
93
+ from httpx import AsyncClient
94
+
95
+ from bookalimo import (
96
+ BookALimo,
97
+ create_credentials,
98
+ create_airport_location,
99
+ create_address_location,
100
+ )
101
+ from bookalimo.models import RateType # enums/models come from bookalimo.models
102
+
103
+ async def main():
104
+ # For Travel Agents (customers: pass is_customer=True)
105
+ credentials = create_credentials("TA10007", "your_password")
106
+
107
+ async with AsyncClient() as http_client:
108
+ async with BookALimo(credentials, http_client=http_client) as client:
109
+ # Build locations
110
+ pickup = create_airport_location("JFK", "New York")
111
+ dropoff = create_address_location("53 East 34th Street, Manhattan")
112
+
113
+ prices = await client.get_prices(
114
+ rate_type=RateType.P2P,
115
+ date_time="09/05/2025 12:44 AM",
116
+ pickup=pickup,
117
+ dropoff=dropoff,
118
+ passengers=2,
119
+ luggage=3,
120
+ )
121
+
122
+ print(f"Available cars: {len(prices.prices)}")
123
+ for price in prices.prices:
124
+ print(f"- {price.car_description}: ${price.price}")
125
+
126
+ if __name__ == "__main__":
127
+ asyncio.run(main())
128
+ ```
129
+
130
+ ### Using the Sandbox
131
+
132
+ ```python
133
+ async with AsyncClient() as http_client:
134
+ async with BookALimo(
135
+ credentials, http_client=http_client, sandbox=True
136
+ ) as client:
137
+ ...
138
+ ```
139
+
140
+ ## Authentication
141
+
142
+ ```python
143
+ from bookalimo import create_credentials
144
+
145
+ # Travel Agents
146
+ ta_creds = create_credentials("TA10007", "password", is_customer=False)
147
+
148
+ # Customers
149
+ cust_creds = create_credentials("customer@email.com", "password", is_customer=True)
150
+ ```
151
+
152
+ ## Core Operations
153
+
154
+ ```python
155
+ # List Reservations
156
+ reservations = await client.list_reservations(is_archive=False)
157
+
158
+ # Get Reservation Details
159
+ details = await client.get_reservation("5452773")
160
+ ```
161
+
162
+ ### Get Pricing
163
+
164
+ ```python
165
+ from bookalimo.models import RateType
166
+
167
+ prices = await client.get_prices(
168
+ rate_type=RateType.P2P,
169
+ date_time="09/05/2025 12:44 AM",
170
+ pickup=pickup, # Location
171
+ dropoff=dropoff, # Location
172
+ passengers=2,
173
+ luggage=3,
174
+ # Optional kwargs:
175
+ # hours=2, stops=[...], account=..., passenger=..., rewards=[...],
176
+ # car_class_code="SD", pets=0, car_seats=0, boosters=0, infants=0,
177
+ # customer_comment="..."
178
+ )
179
+ ```
180
+
181
+ ### Book a Reservation
182
+
183
+ ```python
184
+ from bookalimo import create_credit_card, create_passenger
185
+ from bookalimo.models import CardHolderType
186
+
187
+ # Optionally set details first (select car class, add passenger, etc.)
188
+ details = await client.set_details(
189
+ token=prices.token,
190
+ car_class_code="SD",
191
+ passenger=create_passenger("John", "Smith", "+19173334455"),
192
+ )
193
+
194
+ # Book with credit card
195
+ card = create_credit_card(
196
+ number="4111 1111 1111 1111", # test PAN
197
+ card_holder="John Smith",
198
+ holder_type=CardHolderType.PERSONAL,
199
+ expiration="01/28",
200
+ cvv="123",
201
+ zip_code="10016",
202
+ )
203
+
204
+ booking = await client.book(token=prices.token, credit_card=card)
205
+ print(f"Booked! Confirmation: {booking.reservation_id}")
206
+
207
+ # Or charge account
208
+ booking = await client.book(token=prices.token, method="charge")
209
+ ```
210
+
211
+ ## Location Builders
212
+
213
+ ### Airport Locations
214
+
215
+ ```python
216
+ from bookalimo import create_airport_location
217
+
218
+ pickup = create_airport_location(
219
+ iata_code="JFK",
220
+ city_name="New York",
221
+ airline_code="UA",
222
+ flight_number="UA1234",
223
+ terminal="7",
224
+ )
225
+ ```
226
+
227
+ ### Address Locations
228
+
229
+ ```python
230
+ from bookalimo import create_address_location
231
+
232
+ dropoff = create_address_location(
233
+ address="53 East 34th Street, Manhattan",
234
+ zip_code="10016",
235
+ )
236
+ ```
237
+
238
+ ### Stops
239
+
240
+ ```python
241
+ from bookalimo import create_stop
242
+
243
+ stops = [
244
+ create_stop("Brooklyn Bridge", is_en_route=False),
245
+ create_stop("Empire State Building", is_en_route=True),
246
+ ]
247
+ ```
248
+
249
+ ## Advanced
250
+
251
+ ### Using Account Info (Travel Agents)
252
+
253
+ ```python
254
+ from bookalimo.models import Account # models (not re-exported at top-level)
255
+
256
+ account = Account(
257
+ id="TA10007",
258
+ department="Sales",
259
+ booker_first_name="Jane",
260
+ booker_last_name="Agent",
261
+ booker_email="jane@agency.com",
262
+ booker_phone="+19173334455",
263
+ )
264
+
265
+ prices = await client.get_prices(
266
+ # ... required args
267
+ account=account,
268
+ )
269
+ ```
270
+
271
+ ### Edit / Cancel a Reservation
272
+
273
+ ```python
274
+ # Edit (e.g., add note or change passengers). Omitting fields leaves them unchanged.
275
+ edit_result = await client.edit_reservation(
276
+ confirmation="5452773",
277
+ is_cancel_request=False,
278
+ passengers=3,
279
+ other="Gate pickup",
280
+ )
281
+
282
+ # Cancel
283
+ cancel_result = await client.edit_reservation(
284
+ confirmation="5452773",
285
+ is_cancel_request=True,
286
+ )
287
+ ```
288
+
289
+ ## Error Handling
290
+
291
+ ```python
292
+ from bookalimo._client import BookALimoError # currently defined here
293
+
294
+ try:
295
+ reservations = await client.list_reservations()
296
+ except BookALimoError as e:
297
+ print(f"API Error: {e}")
298
+ print(f"Status Code: {e.status_code}")
299
+ print(f"Response Data: {e.response_data}")
300
+ ```
301
+
302
+ ## Development
303
+
304
+ ```bash
305
+ # Clone & setup
306
+ git clone https://github.com/yourusername/bookalimo-python.git
307
+ cd bookalimo-python
308
+ pip install -e ".[dev]"
309
+ pre-commit install
310
+
311
+ # Run tests
312
+ pytest
313
+ pytest --cov=bookalimo --cov-report=html
314
+
315
+ # Docs (MkDocs)
316
+ mkdocs serve
317
+ ```
318
+
319
+ ## Security Notes
320
+
321
+ * Never log raw passwords or credit card numbers.
322
+ * Store credentials securely (e.g., environment variables, secrets managers).
323
+ * Use sandbox for testing.
324
+
325
+ ## License
326
+
327
+ This project is licensed under the MIT License — see [`LICENSE`](LICENSE).
328
+
329
+ ## Changelog
330
+
331
+ See [`CHANGELOG.md`](CHANGELOG.md) for release history.
@@ -0,0 +1,10 @@
1
+ bookalimo/__init__.py,sha256=ch1t7uvw_F3zNpqb-IfH0n2sDwFLnAQDgm2lpwtvpj4,568
2
+ bookalimo/_client.py,sha256=sGkTevqSi0PU8UbU4E2JBnstIuzLIq0R9N5cENy_fPg,11832
3
+ bookalimo/models.py,sha256=-gvxrT7llrYLxSHWn3vpmvkQqnk2ejSd97Sw8BxgBLw,16420
4
+ bookalimo/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
5
+ bookalimo/wrapper.py,sha256=ABs8ORdGnCeJoWH2YIM5VlC4ZioZSNg880ev-MySiTM,11840
6
+ bookalimo-0.1.1.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ bookalimo-0.1.1.dist-info/METADATA,sha256=Yo2NZ-cwIU1ekDpeT5M3IF779xqY4vVtbxoVSIiuTvA,9225
8
+ bookalimo-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ bookalimo-0.1.1.dist-info/top_level.txt,sha256=ZgYiDX2GfZCp4pevWn4X2qyEr-Dh7-cq5Y1j2jMhB1s,10
10
+ bookalimo-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
File without changes
@@ -0,0 +1 @@
1
+ bookalimo