bookalimo


Namebookalimo JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryPython wrapper for the Book-A-Limo API
upload_time2025-09-10 17:15:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords bookalimo api transportation booking
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Bookalimo Python SDK

[![codecov](https://codecov.io/gh/asparagusbeef/bookalimo-python/branch/main/graph/badge.svg?token=H588J8Q1M8)](https://codecov.io/gh/asparagusbeef/bookalimo-python)
[![Docs](https://img.shields.io/github/deployments/asparagusbeef/bookalimo-python/github-pages?label=docs&logo=github)](https://asparagusbeef.github.io/bookalimo-python)
[![PyPI version](https://badge.fury.io/py/bookalimo.svg)](https://badge.fury.io/py/bookalimo)
[![Python Support](https://img.shields.io/pypi/pyversions/bookalimo.svg)](https://pypi.org/project/bookalimo/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![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)

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** – `AsyncBookalimo` and `Bookalimo` clients
- **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

```bash
pip install bookalimo

# With Google Places integration
pip install bookalimo[places]
```

## Quick Example

```python
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

```python
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

```python
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

```python
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

```bash
export GOOGLE_PLACES_API_KEY="your_google_places_key"
export BOOKALIMO_LOG_LEVEL="DEBUG"
```

## Documentation

**📖 Complete Documentation:** [https://asparagusbeef.github.io/bookalimo-python](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](https://github.com/asparagusbeef/bookalimo-python)
* PyPI: [https://pypi.org/project/bookalimo/](https://pypi.org/project/bookalimo/)
* Issues: [https://github.com/asparagusbeef/bookalimo-python/issues](https://github.com/asparagusbeef/bookalimo-python/issues)
* Changelog: [CHANGELOG.md](./CHANGELOG.md)

## License

MIT License — see [LICENSE](LICENSE) for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bookalimo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Jonathan Oren <jonathan@bookalimo.com>",
    "keywords": "bookalimo, api, transportation, booking",
    "author": null,
    "author_email": "Jonathan Oren <jonathan@bookalimo.com>",
    "download_url": "https://files.pythonhosted.org/packages/1b/a1/b2e45a90e033a7aa04b8376f541c5ac3838d5cf31a58f1c75b4adb3bd337/bookalimo-1.0.2.tar.gz",
    "platform": null,
    "description": "# Bookalimo Python SDK\n\n[![codecov](https://codecov.io/gh/asparagusbeef/bookalimo-python/branch/main/graph/badge.svg?token=H588J8Q1M8)](https://codecov.io/gh/asparagusbeef/bookalimo-python)\n[![Docs](https://img.shields.io/github/deployments/asparagusbeef/bookalimo-python/github-pages?label=docs&logo=github)](https://asparagusbeef.github.io/bookalimo-python)\n[![PyPI version](https://badge.fury.io/py/bookalimo.svg)](https://badge.fury.io/py/bookalimo)\n[![Python Support](https://img.shields.io/pypi/pyversions/bookalimo.svg)](https://pypi.org/project/bookalimo/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![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)\n\nPython client library for the Book-A-Limo transportation booking API with async/sync support, type safety, and Google Places integration.\n\n## Design philosophy: IDE-first DX\n\nThe library is **comprehensively typed** and **richly documented** via docstrings. Most users can rely on IDE hints, docstrings, and autocomplete without reading the docs.\n\n## Features\n\n- **Async & Sync Support** \u2013 `AsyncBookalimo` and `Bookalimo` clients\n- **Type Safety** \u2013 Full Pydantic models with validation\n- **Google Places Integration** \u2013 Location search and geocoding\n- **Automatic Retry** \u2013 Built-in exponential backoff\n- **Resource Management** \u2013 Context managers for proper cleanup\n\n## Installation\n\n```bash\npip install bookalimo\n\n# With Google Places integration\npip install bookalimo[places]\n```\n\n## Quick Example\n\n```python\nimport asyncio\nfrom bookalimo import (\n    AsyncBookalimo,\n)\nfrom bookalimo.transport.auth import (\n    Credentials,\n)\nfrom bookalimo.schemas import (\n    RateType,\n    Location,\n    LocationType,\n    Address,\n    City,\n    Airport,\n    PriceRequest,\n    BookRequest,\n)\n\n\nasync def book_ride():\n    credentials = Credentials.create(\n        \"your_id\",\n        \"your_password\",\n        is_customer=False,\n    )\n\n    pickup = Location(\n        type=LocationType.ADDRESS,\n        address=Address(\n            place_name=\"Empire State Building\",\n            city=City(\n                city_name=\"New York\",\n                country_code=\"US\",\n                state_code=\"NY\",\n            ),\n        ),\n    )\n    dropoff = Location(\n        type=LocationType.AIRPORT,\n        airport=Airport(iata_code=\"JFK\"),\n    )\n\n    async with AsyncBookalimo(credentials=credentials) as client:\n        # Get pricing\n        quote = await client.pricing.quote(\n            PriceRequest(\n                rate_type=RateType.P2P,\n                date_time=\"12/25/2024 03:00 PM\",\n                pickup=pickup,\n                dropoff=dropoff,\n                passengers=2,\n                luggage=2,\n            )\n        )\n\n        # Book reservation\n        booking = await client.reservations.book(\n            BookRequest(\n                token=quote.token,\n                method=\"charge\",\n            )\n        )\n        return booking.reservation_id\n\n\nconfirmation = asyncio.run(book_ride())\n```\n\n## Sync Usage\n\n```python\nfrom bookalimo import (\n    Bookalimo,\n)\n\nwith Bookalimo(credentials=credentials) as client:\n    quote = client.pricing.quote(PriceRequest(...))\n    booking = client.reservations.book(\n        BookRequest(\n            token=quote.token,\n            method=\"charge\",\n        )\n    )\n```\n\n## Google Places Integration\n\n```python\nasync with AsyncBookalimo(\n    credentials=credentials,\n    google_places_api_key=\"your-google-places-key\",\n) as client:\n    # Search locations\n    results = await client.places.search(\"Hilton Miami Beach\")\n\n    # Resolve airports near landmarks\n    airports = await client.places.resolve_airport(query=\"eiffel tower\")\n    top_airport = airports[0]  # Closest airport with confidence scoring\n\n    # Use in booking flow\n    quote = await client.pricing.quote(...)\n```\n\n## Error Handling\n\n```python\nfrom bookalimo.exceptions import (\n    BookalimoHTTPError,\n    BookalimoValidationError,\n)\n\ntry:\n    booking = await client.reservations.book(...)\nexcept BookalimoValidationError as e:\n    print(f\"Invalid input: {e.message}\")\nexcept BookalimoHTTPError as e:\n    if e.status_code == 401:\n        print(\"Authentication failed\")\n```\n\n## Environment\n\n```bash\nexport GOOGLE_PLACES_API_KEY=\"your_google_places_key\"\nexport BOOKALIMO_LOG_LEVEL=\"DEBUG\"\n```\n\n## Documentation\n\n**\ud83d\udcd6 Complete Documentation:** [https://asparagusbeef.github.io/bookalimo-python](https://asparagusbeef.github.io/bookalimo-python)\n\n## Requirements\n\n* Python 3.9+\n* Book-A-Limo API credentials\n* Dependencies: httpx, pydantic, pycountry, us, airportsdata, typing-extensions for Python 3.9-3.10\n  - Optional: google-maps-places, google-api-core, numpy, rapidfuzz\n\n## Support & Resources\n\n* GitHub: [https://github.com/asparagusbeef/bookalimo-python](https://github.com/asparagusbeef/bookalimo-python)\n* PyPI: [https://pypi.org/project/bookalimo/](https://pypi.org/project/bookalimo/)\n* Issues: [https://github.com/asparagusbeef/bookalimo-python/issues](https://github.com/asparagusbeef/bookalimo-python/issues)\n* Changelog: [CHANGELOG.md](./CHANGELOG.md)\n\n## License\n\nMIT License \u2014 see [LICENSE](LICENSE) for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python wrapper for the Book-A-Limo API",
    "version": "1.0.2",
    "project_urls": {
        "Changelog": "https://github.com/asparagusbeef/bookalimo-python/blob/main/CHANGELOG.md",
        "Documentation": "https://asparagusbeef.github.io/bookalimo-python",
        "Homepage": "https://github.com/asparagusbeef/bookalimo-python",
        "Issues": "https://github.com/asparagusbeef/bookalimo-python/issues",
        "Repository": "https://github.com/asparagusbeef/bookalimo-python"
    },
    "split_keywords": [
        "bookalimo",
        " api",
        " transportation",
        " booking"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c514f5567cad6964489a285ba1c764b504c1cfb3d8b1763ee063f61a664c8949",
                "md5": "1b54247ba4bbfaa27e5154fc3b0652d8",
                "sha256": "2b40cb0e087c713a01b5eee56a71650a35cb4fb30df5358092529a7e2172c658"
            },
            "downloads": -1,
            "filename": "bookalimo-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b54247ba4bbfaa27e5154fc3b0652d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 67144,
            "upload_time": "2025-09-10T17:15:45",
            "upload_time_iso_8601": "2025-09-10T17:15:45.350159Z",
            "url": "https://files.pythonhosted.org/packages/c5/14/f5567cad6964489a285ba1c764b504c1cfb3d8b1763ee063f61a664c8949/bookalimo-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1ba1b2e45a90e033a7aa04b8376f541c5ac3838d5cf31a58f1c75b4adb3bd337",
                "md5": "8c244c6acb2aa706f216c79ed1d1a27b",
                "sha256": "b1dce4bdd6937db84191ccb917cfc84dcb6e414e9e748b9893e54eb2510da963"
            },
            "downloads": -1,
            "filename": "bookalimo-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "8c244c6acb2aa706f216c79ed1d1a27b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 83208,
            "upload_time": "2025-09-10T17:15:46",
            "upload_time_iso_8601": "2025-09-10T17:15:46.820308Z",
            "url": "https://files.pythonhosted.org/packages/1b/a1/b2e45a90e033a7aa04b8376f541c5ac3838d5cf31a58f1c75b4adb3bd337/bookalimo-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-10 17:15:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "asparagusbeef",
    "github_project": "bookalimo-python",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "bookalimo"
}
        
Elapsed time: 1.04393s