Skip to content

v0.13.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 22 Jun 13:32
· 21 commits to main since this release

v0.13.0 (2024-06-22)

Added Tile38 WHEREIN filter to any of the where-able searches like intersect, within, scan, nearby or search.

import asyncio
from pyle38 import Tile38


async def main():
    tile38 = Tile38(url="redis://localhost:9851", follower_url="redis://localhost:9851")

    await tile38.set("fleet", "truck1").fields({"driver": "Bob"}).point(52.25,13.37).exec()
    await tile38.set("fleet", "truck2").fields({"driver": "John"}).point(52.25,13.37).exec()
    await tile38.set("fleet", "truck3").fields({"driver": "Ben"}).point(52.25,13.37).exec()

    response = await tile38.follower()
        .within("fleet").wherein("driver",["Bob","John"])
        .circle(52.25, 13.37, 1000)
        .asObjects()

    assert response.ok

    print(response.dict())
    await tile38.quit()

asyncio.run(main())

> {
    "ok": True,
    "elapsed": "48.8µs",
    "objects": [
        {
            "object": {
                "type": "Point",
                "coordinates": [
                    13.37,
                    52.25
                ]
            },
            "id": "truck1"
        },
        {
            "object": {
                "type": "Point",
                "coordinates": [
                    13.37,
                    52.25
                ]
            },
            "id": "truck2"
        }
    ],
    "count": 1,
    "cursor": 0
}

Chore

Feature

  • feat: add WHEREIN to SEARCH (e7b5c29)

  • feat: add WHEREIN to NEARBY (587c629)

  • feat: add WHEREIN to INTERSECTS (41e81dd)

  • feat: add WHEREIN to WITHIN (f706b80)

  • feat: add WHEREIN to SCAN (afa301e)

  • feat: add wherein to Whereable class (c3ad4df)

Refactor

  • refactor: simplify WHEREIN command, resolve mypy issues on object searches (33b23e8)