Releases: iwpnd/pyle38
[0.6.0]
pyle38 now supports the BUFFER
search option introduced in Tile38 v1.27.0. This will create apply a buffer zone to the area format, therefore increasing the search area by x meters in all directions.
response = await tile38.set("fleet", "bus1").point(52.25,13.37).exec()
search_area = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[13.37009847164154, 52.2498254610514],
[13.370516896247862, 52.2498254610514],
[13.370516896247862, 52.25017851139772],
[13.37009847164154, 52.25017851139772],
[13.37009847164154, 52.2498254610514],
]
],
},
}
response = await tile38.intersects(key).object(search_area).asCount()
print(response.count)
# > 0
response = await tile38.intersects(key).buffer(10).object(search_area).asCount()
print(response.count)
# > 1
v0.6.0 (2022-01-04)
Feature
- ✨ add buffer search option to within search (
1ad3655
) - ✨ add buffer search option to intersects search (
f23d800
)
Documentation
- 📚️ update readme (
4b57fbf
)
Chore
- 🐑 update docker-compose.yml to use new json logging introduced in v1.27.0
- 🐑 update aioredis
- 🐑 minor changes to typing
[0.5.1]
Fixed an issue raised in #68 where string
objects can be set, but not fetched from Tile38.
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:driver").string("John").exec()
response = await tile38.get("fleet","truck1:driver").asStringObject()
assert response.ok
print(response.dict())
asyncio.run(main())
> {
"ok": True,
"elapsed": "48.8µs",
"object": "John"
}
Fix
- 🐛 remove stringobject class in favour of generics (
8317d40
) - 🐛 utilize generic model object (
1f95d2c
) - 🐛 get as string object (
9f1a3a3
)
Documentation
- 📚️ update docs (
04cad31
)
[0.5.0]
Tile38 v1.26.0 introduced a new object typed called sector that can be used in WITHIN and INTERSECTS queries.
A sector is a circular sector polygon feature spanning the angle between two given bearings, a center point and a radius. A pizza piece!
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").point(52.25,13.37).exec()
response = await tile38.follower()
.within("fleet")
.sector(52.25191, 13.37230, 1000, 180, 270) # lat, lon, radius, bearing1, bearing2
.noFields()
.asObjects()
assert response.ok
print(response.dict())
asyncio.run(main())
> {
"ok": True,
"elapsed": "48.8µs",
"objects": [
{
"object": {
"type": "Point",
"coordinates": [
13.37,
52.25
]
},
"id": "truck",
}
],
"count": 1,
"cursor": 0
}
v0.5.0 (2021-10-04)
Feature
- ✨ add sector search to within and intersects (
4b6931b
)
[0.4.0]
Finally got around to add Tile38s WHERE
filter.
Example:
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({"maxspeed":100}).point(52.25,13.37).exec()
await tile38.set("fleet", "truck2").fields({"maxspeed":80}).point(51.25,12.37).exec()
response = await tile38.follower()
.within("fleet")
.where("maxspeed", 100, 100)
.circle(52.25, 13.37, 100000)
.asObjects()
assert response.ok
print(response.dict())
asyncio.run(main())
> {
"ok": True,
"elapsed": "48.8µs",
"fields": ["maxspeed"],
"objects": [
{
"object": {
"type": "Point",
"coordinates": [
13.37,
52.25
]
},
"id": "truck",
"fields": [100],
}
],
"count": 1,
"cursor": 0
}
v0.4.0 (2021-09-10)
Feature
- ✨ add where filter to scan command (
8c78d8b
) - ✨ add where filter to search command (
5e02bd4
) - ✨ add where filter to nearby command (
0f795c8
) - ✨ add where filter to intersects command (
dbf8be1
) - ✨ add where filter to within command (
ceb5a29
)
Fix
- 🐛 update server extended response (
62628fb
)
[0.3.2]
[0.3.1]
[0.3.0]: added INFO command
[0.2.0]: new command, stricter validation
New Features
- ✨ add
HEALTHZ
command to Leader and Follower
HEALTHZ
allows you to check your Tile38 ready state in e.g. a /health
endpoint - Read more.
Refactorings
- ♻️ bind TypeVar T to dict specifically
A features properties can now only be of type dict
Docs
- 📚️ update readme with HEALTHZ
- 📚️ update readme with PING
- 📚️ add docstrings to commands/nearby
- 📚️ add docstrings to commands/intersects
- 📚️ add docstrings to commands/within
[0.1.0]: Initial release 🎉
First version of an asynchronous Tile38 client for Python 3.8+