bookalimo 1.0.0__py3-none-any.whl → 1.0.2__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.
@@ -1,307 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: bookalimo
3
- Version: 1.0.0
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/asparagusbeef/bookalimo-python
9
- Project-URL: Documentation, https://asparagusbeef.github.io/bookalimo-python
10
- Project-URL: Repository, https://github.com/asparagusbeef/bookalimo-python
11
- Project-URL: Issues, https://github.com/asparagusbeef/bookalimo-python/issues
12
- Project-URL: Changelog, https://github.com/asparagusbeef/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.11.0
30
- Requires-Dist: pycountry>=22.0.0
31
- Requires-Dist: us>=3.0.0
32
- Requires-Dist: airportsdata>=20230101
33
- Provides-Extra: places
34
- Requires-Dist: google-maps-places>=0.1.0; extra == "places"
35
- Requires-Dist: google-api-core>=2.0.0; extra == "places"
36
- Provides-Extra: dev
37
- Requires-Dist: pytest>=7.0.0; extra == "dev"
38
- Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
39
- Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
40
- Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
41
- Requires-Dist: httpx[mock]>=0.25.0; extra == "dev"
42
- Requires-Dist: respx>=0.20.0; extra == "dev"
43
- Requires-Dist: ruff>=0.1.0; extra == "dev"
44
- Requires-Dist: mypy>=1.5.0; extra == "dev"
45
- Requires-Dist: pre-commit>=3.0.0; extra == "dev"
46
- Requires-Dist: build>=1.0.0; extra == "dev"
47
- Requires-Dist: twine>=4.0.0; extra == "dev"
48
- Requires-Dist: python-dotenv>=1.0.0; extra == "dev"
49
- Requires-Dist: types-protobuf>=6.0.0; extra == "dev"
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
- # Bookalimo Python SDK
60
-
61
- [![codecov](https://codecov.io/gh/asparagusbeef/bookalimo-python/branch/main/graph/badge.svg?token=H588J8Q1M8)](https://codecov.io/gh/asparagusbeef/bookalimo-python)
62
- [![Documentation Status](https://readthedocs.org/projects/bookalimo-python/badge/?version=latest)](https://bookalimo-python.readthedocs.io/en/latest/?badge=latest)
63
- [![PyPI version](https://badge.fury.io/py/bookalimo.svg)](https://badge.fury.io/py/bookalimo)
64
- [![Python Support](https://img.shields.io/pypi/pyversions/bookalimo.svg)](https://pypi.org/project/bookalimo/)
65
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66
- [![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)
67
-
68
- Python client library for the Book-A-Limo transportation booking API with async/sync support, type safety, and Google Places integration.
69
-
70
- ## Features
71
-
72
- - **Async & Sync Support** - Choose the right client for your use case
73
- - **Type Safety** - Full Pydantic models with validation
74
- - **Google Places Integration** - Location search and geocoding
75
- - **Automatic Retry** - Built-in exponential backoff for reliability
76
- - **Comprehensive Error Handling** - Detailed exceptions with context
77
-
78
- ## Installation
79
-
80
- ```bash
81
- pip install bookalimo
82
-
83
- # With Google Places integration
84
- pip install bookalimo[places]
85
- ```
86
-
87
- ## Core API
88
-
89
- ### Clients
90
- - `AsyncBookalimo` - Async client for high-concurrency applications
91
- - `Bookalimo` - Sync client for simple scripts and legacy code
92
-
93
- ### Services
94
- - `client.pricing` - Get quotes and update booking details
95
- - `client.reservations` - Book, list, modify, and cancel reservations
96
- - `client.places` - Google Places search and geocoding (optional)
97
-
98
- ### Authentication
99
- SHA256-based credential system with automatic password hashing:
100
- ```python
101
- from bookalimo.transport.auth import Credentials
102
-
103
- # Agency account
104
- credentials = Credentials.create("AGENCY123", "password", is_customer=False)
105
-
106
- # Customer account
107
- credentials = Credentials.create("user@email.com", "password", is_customer=True)
108
- ```
109
-
110
- ### Booking Flow
111
- 1. **Get Pricing** - `client.pricing.quote()` returns session token + vehicle options
112
- 2. **Update Details** - `client.pricing.update_details()` modifies booking (optional)
113
- 3. **Book Reservation** - `client.reservations.book()` confirms with payment
114
-
115
- ## Quick Example
116
-
117
- ```python
118
- import asyncio
119
- from bookalimo import AsyncBookalimo
120
- from bookalimo.transport.auth import Credentials
121
- from bookalimo.schemas.booking import RateType, Location, LocationType, Address, City
122
-
123
- async def book_ride():
124
- credentials = Credentials.create("your_id", "your_password")
125
-
126
- # Define locations
127
- pickup = Location(
128
- type=LocationType.ADDRESS,
129
- address=Address(
130
- place_name="Empire State Building",
131
- city=City(city_name="New York", country_code="US", state_code="NY")
132
- )
133
- )
134
-
135
- dropoff = Location(
136
- type=LocationType.ADDRESS,
137
- address=Address(
138
- place_name="JFK Airport",
139
- city=City(city_name="New York", country_code="US", state_code="NY")
140
- )
141
- )
142
-
143
- async with AsyncBookalimo(credentials=credentials) as client:
144
- # 1. Get pricing
145
- quote = await client.pricing.quote(
146
- rate_type=RateType.P2P,
147
- date_time="12/25/2024 03:00 PM",
148
- pickup=pickup,
149
- dropoff=dropoff,
150
- passengers=2,
151
- luggage=2
152
- )
153
-
154
- # 2. Book reservation
155
- booking = await client.reservations.book(
156
- token=quote.token,
157
- method="charge" # or credit_card=CreditCard(...)
158
- )
159
-
160
- return booking.reservation_id
161
-
162
- confirmation = asyncio.run(book_ride())
163
- ```
164
-
165
- ## Rate Types & Options
166
-
167
- ```python
168
- from bookalimo.schemas.booking import RateType
169
-
170
- # Point-to-point transfer
171
- quote = await client.pricing.quote(
172
- rate_type=RateType.P2P,
173
- pickup=pickup_location,
174
- dropoff=dropoff_location,
175
- # ...
176
- )
177
-
178
- # Hourly service (minimum 2 hours)
179
- quote = await client.pricing.quote(
180
- rate_type=RateType.HOURLY,
181
- hours=4,
182
- pickup=pickup_location,
183
- dropoff=pickup_location, # Same for hourly
184
- # ...
185
- )
186
-
187
- # Daily service
188
- quote = await client.pricing.quote(
189
- rate_type=RateType.DAILY,
190
- pickup=hotel_location,
191
- dropoff=hotel_location,
192
- # ...
193
- )
194
- ```
195
-
196
- ## Location Types
197
-
198
- ```python
199
- from bookalimo.schemas.booking import Location, LocationType, Address, Airport, City
200
-
201
- # Street address
202
- address_location = Location(
203
- type=LocationType.ADDRESS,
204
- address=Address(
205
- place_name="Empire State Building",
206
- street_name="350 5th Ave",
207
- city=City(city_name="New York", country_code="US", state_code="NY")
208
- )
209
- )
210
-
211
- # Airport with flight details
212
- airport_location = Location(
213
- type=LocationType.AIRPORT,
214
- airport=Airport(
215
- iata_code="JFK",
216
- flight_number="UA123",
217
- terminal="4"
218
- )
219
- )
220
- ```
221
-
222
- ## Google Places Integration
223
-
224
- ```python
225
- async with AsyncBookalimo(
226
- credentials=credentials,
227
- google_places_api_key="your-google-places-key"
228
- ) as client:
229
- # Search locations
230
- results = await client.places.search("JFK Airport Terminal 4")
231
-
232
- # Convert to booking location
233
- location = Location(
234
- type=LocationType.ADDRESS,
235
- address=Address(
236
- google_geocode=results[0].google_place.model_dump(),
237
- place_name=results[0].formatted_address
238
- )
239
- )
240
- ```
241
-
242
- ## Reservation Management
243
-
244
- ```python
245
- # List reservations
246
- reservations = await client.reservations.list(is_archive=False)
247
-
248
- # Get details
249
- details = await client.reservations.get("ABC123")
250
-
251
- # Modify reservation
252
- edit_result = await client.reservations.edit(
253
- confirmation="ABC123",
254
- passengers=3,
255
- pickup_date="12/26/2024"
256
- )
257
-
258
- # Cancel reservation
259
- cancel_result = await client.reservations.edit(
260
- confirmation="ABC123",
261
- is_cancel=True
262
- )
263
- ```
264
-
265
- ## Error Handling
266
-
267
- ```python
268
- from bookalimo.exceptions import BookalimoHTTPError, BookalimoValidationError
269
-
270
- try:
271
- booking = await client.reservations.book(...)
272
- except BookalimoValidationError as e:
273
- print(f"Invalid input: {e.message}")
274
- for error in e.errors():
275
- print(f" {error['loc']}: {error['msg']}")
276
- except BookalimoHTTPError as e:
277
- if e.status_code == 401:
278
- print("Authentication failed")
279
- elif e.status_code == 400:
280
- print(f"Bad request: {e.payload}")
281
- ```
282
-
283
- ## Documentation
284
-
285
- **📖 [Complete Documentation](https://asparagusbeef.github.io/bookalimo-python)**
286
-
287
- - [Quick Start Guide](https://asparagusbeef.github.io/bookalimo-python/guide/quickstart/)
288
- - [API Reference](https://asparagusbeef.github.io/bookalimo-python/api/)
289
- - [Examples](https://asparagusbeef.github.io/bookalimo-python/examples/basic/)
290
-
291
- ## Environment Options
292
-
293
- ```bash
294
- export GOOGLE_PLACES_API_KEY="your_google_places_key"
295
- export BOOKALIMO_LOG_LEVEL="DEBUG"
296
- ```
297
-
298
- ## Requirements
299
-
300
- - Python 3.9+
301
- - Book-A-Limo API credentials
302
- - Dependencies: httpx, pydantic, pycountry, us, airportsdata
303
- - Optional: google-maps-places (for Places integration)
304
-
305
- ## License
306
-
307
- MIT License - see [LICENSE](LICENSE) for details.
@@ -1,35 +0,0 @@
1
- bookalimo/__init__.py,sha256=ZFDpnSOo5VQEgusbVAxyF-neFxBptPZANZ-eE1PeIsU,516
2
- bookalimo/_version.py,sha256=KcHRbOssHorjmpk3Xs1RTqGNSA-sw9tjYqwV19Zfa9c,259
3
- bookalimo/client.py,sha256=za9o_D1jkaq7atWpM5d3bguWO-rtMYr5StXrBZInsMg,10599
4
- bookalimo/config.py,sha256=LSbWIeTZYc4b3XSCmPSEU-jEcYmo7GWAyxdOmA69X6A,509
5
- bookalimo/exceptions.py,sha256=pShnuvfMZEP_cChczWhNBLIqa7EOgr4ZNnWj6kphARU,4001
6
- bookalimo/logging.py,sha256=IF6RQRJvVHgmpXK1qMEGcd0BjU6GxvzbNUBrBKHe-v8,7409
7
- bookalimo/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
8
- bookalimo/integrations/__init__.py,sha256=edmQP2Uo8JiNIVaeB4rxM8vagz7BQBhyGEJo70OVS0M,51
9
- bookalimo/integrations/google_places/__init__.py,sha256=A6jBfGk8ZLYgFiTCGBytBOsyzKVWHI_kjnuZOgdCONc,866
10
- bookalimo/integrations/google_places/client_async.py,sha256=6hfl3am2qtJLZHogPk57a-jFNqRzTJt3dyj58Mpt290,8956
11
- bookalimo/integrations/google_places/client_sync.py,sha256=uscvNJuUb6iF8q29f_ZgftGmPWv2Zog72t0E8PCBmFY,8840
12
- bookalimo/integrations/google_places/common.py,sha256=MphkEGarmM8AapjBrdsWRAg0yXyzMFZad_S8YB-esbI,7219
13
- bookalimo/integrations/google_places/proto_adapter.py,sha256=XuVDr-PH9fopykRwNZxQTS_kIBCdwPwcNYBIHCZjmRo,6809
14
- bookalimo/schemas/__init__.py,sha256=vS9skyuk5WV472TKgBqAg5Qzwvb0Bh0n4ff9BDSl8aE,1919
15
- bookalimo/schemas/base.py,sha256=XEe0Qg7p-LzTmUOJ8CLVDsrry2lKn8sWNin7zwBiw-U,2022
16
- bookalimo/schemas/booking.py,sha256=ll1usMa6Rfuz63LAWimWlz1UswWn26ZOPBpclN-8yGY,15861
17
- bookalimo/schemas/places/__init__.py,sha256=SkUR6EIvnetNWqhLOiuq0k5Zy5XA4yZp8F2U92qCPOI,713
18
- bookalimo/schemas/places/common.py,sha256=v39FpI3i7aDWRWsnb2zzSDddNE09XyQ5WVACBww3uC8,5425
19
- bookalimo/schemas/places/google.py,sha256=HbQHKTj9bk6q-KaFWNMkKTgQIvp3kZF8dSnPqguy4Ng,20050
20
- bookalimo/schemas/places/place.py,sha256=Y55QFhm7zjsqwjbPxHwNTl_02u30Yv2TqrhtBzgb6iM,10620
21
- bookalimo/services/__init__.py,sha256=4wom7MpoeqKy5y99LYFKkl-CAJ7faDN9ZlXUhKVqlAg,303
22
- bookalimo/services/pricing.py,sha256=MIUVzdnZsmxEEyw9qUdjj71gt3MsckiVLgfXqnPHmNE,5873
23
- bookalimo/services/reservations.py,sha256=OsbVrVJRggjnifh1eER9PHGqt4PwxZ-Jq1-Dpo4wGKk,7147
24
- bookalimo/transport/__init__.py,sha256=yD5TDnoqg1xtex41jqJ7Hes849efiYgvW3nkaYr6ZjE,221
25
- bookalimo/transport/auth.py,sha256=n1XWtU3ddodsDuTuXnDw_pE0qaTe1zrOv7fqHGyOiCg,1249
26
- bookalimo/transport/base.py,sha256=qeX2HfLaE6gUT5evjOdPiBh8x7z7A84UuWVsgBK3Pyo,1394
27
- bookalimo/transport/httpx_async.py,sha256=XbXbxcAdUc_CQh_XEYsL0WH6vvECP4fcZWfFCeW5wEU,8100
28
- bookalimo/transport/httpx_sync.py,sha256=SIlDfiIYKQgAvWsOVeEgxNxlqTKviN_LJX4r8i4Cl5M,7988
29
- bookalimo/transport/retry.py,sha256=YiJtcdNZUbkrLa1CtKsRtcFO273XJX8naKd8d6ht0LU,2688
30
- bookalimo/transport/utils.py,sha256=Yoj4P5AzuHbf6pzNPtiiswKab4nHZTCOpIff30-sgbw,1797
31
- bookalimo-1.0.0.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- bookalimo-1.0.0.dist-info/METADATA,sha256=J_p8zz2sgot7msNBGa8dxLSDG-7nYXoLsGQrZcmggnw,9754
33
- bookalimo-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
- bookalimo-1.0.0.dist-info/top_level.txt,sha256=ZgYiDX2GfZCp4pevWn4X2qyEr-Dh7-cq5Y1j2jMhB1s,10
35
- bookalimo-1.0.0.dist-info/RECORD,,
File without changes