PyPI package: https://pypi.org/project/grakn-client
Documentation: https://dev.docs.grakn.ai/docs/client-api/python
Distribution
Available through https://pypi.org
pip install grakn-client==2.0.0
New Features
- **Implement explanations**
Following https://github.com/graknlabs/grakn/pull/6271 and the corresponding protocol change in https://github.com/graknlabs/protocol/pull/131 we implement Explanations, Explainable concept maps, and the explain() query API, which allows users to stream Explanations on demand **note: explain query or transaction option must be set to `true`**
- **Set default parallelism of CoreClient to 2**
Given that Python doesn't provide an easy way of getting the number of CPUs available to the process, we decided to reduce the default parallelism of CoreClient from 3 to 2. This should ensure it continues to run smoothly on systems with fewer cores.
- **Add prefetch, session, schema lock timeout options**
We added three new `GraknOptions`: `prefetch`, `session_idle_timeout_millis` and `schema_lock_acquire_timeout_millis`.
Bugs Fixed
- **Fix test-deployment**
API changes broke test-deployment, so we updated it.
- **On transaction failover, transfer options to the new session**
Previously, when opening a Transaction to Grakn Cluster failed (causing a new Session to be opened to a new server), the old Session options were discarded. Now, we properly transfer the Session-level options to the new session.
Code Refactors
- **Shorten enum names to SessionType, TransactionType**
While aligning Client Python with Client Java, we introduced `GraknTransaction.Type` and `GraknSession.Type`. But in Python these proved cumbersome to type out. So we reverted them to `SessionType` and `TransactionType`.
- **Architecture refactor**
We have refactored Client Python considerably to come up with an architecture that is easy to understand, easy to extend, and easy to replicate in other languages that wish to implement a Grakn Client.
This is a **breaking change**. The updated APIs are:
Create a Grakn Core client
py
client = Grakn.core_client(address="localhost:1729")
Create a Grakn Cluster client
py