Python client for Typesense: https://github.com/typesense/typesense
// readme
Typesense Python Client
Python client for the Typesense API: https://github.com/typesense/typesense
Installation
$ pip install typesense
You can also add typesense to your project’s requirements.txt.
Usage
You can find some examples here.
See detailed API documentation.
Async usage
Use AsyncClient when working in an async runtime:
import asyncio
import typesense
async def main() -> None:
client = typesense.AsyncClient({
"api_key": "abcd",
"nodes": [{"host": "localhost", "port": "8108", "protocol": "http"}],
"connection_timeout_seconds": 2,
})
print(await client.collections.retrieve())
await client.api_call.aclose()
if __name__ == "__main__":
asyncio.run(main())
See examples/async_collection_operations.py for a fuller async walkthrough.
Using httpx2
The client sends requests with httpx by default. On Python 3.10+ you can pass an httpx2 client instead. httpx2 is Pydantic’s maintained…