Bookalimo Python SDK
Python client library for the Book-A-Limo transportation booking API with async/sync support, type safety, and Google Places integration.
Design philosophy: IDE-first DX
The library is comprehensively typed and richly documented via docstrings. Most users can rely on IDE hints, docstrings, and autocomplete without reading the docs.
Features
- Async & Sync Support –
AsyncBookalimoandBookalimoclients - Type Safety – Full Pydantic models with validation
- Google Places Integration – Location search and geocoding
- Automatic Retry – Built-in exponential backoff
- Resource Management – Context managers for proper cleanup
Installation
pip install bookalimo
# With Google Places integration
pip install bookalimo[places]
Quick Example
import asyncio
from bookalimo import (
AsyncBookalimo,
)
from bookalimo.transport.auth import (
Credentials,
)
from bookalimo.schemas import (
RateType,
Location,
LocationType,
Address,
City,
Airport,
PriceRequest,
BookRequest,
)
async def book_ride():
credentials = Credentials.create(
"your_id",
"your_password",
is_customer=False,
)
pickup = Location(
type=LocationType.ADDRESS,
address=Address(
place_name="Empire State Building",
city=City(
city_name="New York",
country_code="US",
state_code="NY",
),
),
)
dropoff = Location(
type=LocationType.AIRPORT,
airport=Airport(iata_code="JFK"),
)
async with AsyncBookalimo(credentials=credentials) as client:
# Get pricing
quote = await client.pricing.quote(
PriceRequest(
rate_type=RateType.P2P,
date_time="12/25/2024 03:00 PM",
pickup=pickup,
dropoff=dropoff,
passengers=2,
luggage=2,
)
)
# Book reservation
booking = await client.reservations.book(
BookRequest(
token=quote.token,
method="charge",
)
)
return booking.reservation_id
confirmation = asyncio.run(book_ride())
Sync Usage
from bookalimo import (
Bookalimo,
)
with Bookalimo(credentials=credentials) as client:
quote = client.pricing.quote(PriceRequest(...))
booking = client.reservations.book(
BookRequest(
token=quote.token,
method="charge",
)
)
Google Places Integration
async with AsyncBookalimo(
credentials=credentials,
google_places_api_key="your-google-places-key",
) as client:
# Search locations
results = await client.places.search("Hilton Miami Beach")
# Resolve airports near landmarks
airports = await client.places.resolve_airport(query="eiffel tower")
top_airport = airports[0] # Closest airport with confidence scoring
# Use in booking flow
quote = await client.pricing.quote(...)
Error Handling
from bookalimo.exceptions import (
BookalimoHTTPError,
BookalimoValidationError,
)
try:
booking = await client.reservations.book(...)
except BookalimoValidationError as e:
print(f"Invalid input: {e.message}")
except BookalimoHTTPError as e:
if e.status_code == 401:
print("Authentication failed")
Environment
export GOOGLE_PLACES_API_KEY="your_google_places_key"
export BOOKALIMO_LOG_LEVEL="DEBUG"
Documentation
📖 Complete Documentation: https://asparagusbeef.github.io/bookalimo-python
Requirements
- Python 3.9+
- Book-A-Limo API credentials
- Dependencies: httpx, pydantic, pycountry, us, airportsdata, typing-extensions for Python 3.9-3.10
- Optional: google-maps-places, google-api-core, numpy, rapidfuzz
Support & Resources
- GitHub: https://github.com/asparagusbeef/bookalimo-python
- PyPI: https://pypi.org/project/bookalimo/
- Issues: https://github.com/asparagusbeef/bookalimo-python/issues
- Changelog: CHANGELOG.md
License
MIT License — see LICENSE for details.
Metadata
Release files for bookalimo 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bookalimo-1.0.2.tar.gz | 83.2 kB | Without provenance | Details for bookalimo-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bookalimo-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for bookalimo-1.0.2-py3-none-any.whl |
Total release size: 150.4 kB
Release files / bookalimo-1.0.2.tar.gz
| Download URL | bookalimo-1.0.2.tar.gz |
|---|---|
| Size | 83.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1dce4bdd6937db84191ccb917cfc84dcb6e414e9e748b9893e54eb2510da963
|
|
BLAKE2b-256 checksum How to use checksums |
1ba1b2e45a90e033a7aa04b8376f541c5ac3838d5cf31a58f1c75b4adb3bd337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / bookalimo-1.0.2-py3-none-any.whl
| Download URL | bookalimo-1.0.2-py3-none-any.whl |
|---|---|
| Size | 67.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b40cb0e087c713a01b5eee56a71650a35cb4fb30df5358092529a7e2172c658
|
|
BLAKE2b-256 checksum How to use checksums |
c514f5567cad6964489a285ba1c764b504c1cfb3d8b1763ee063f61a664c8949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for bookalimo 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.