Spice.xyz client library for Python.
pip install git+https://github.com/spiceai/spicepy
from spicepy import Client
client = Client('API_KEY')
data = client.query('SELECT * FROM eth.recent_blocks LIMIT 10;')
pd = data.read_pandas()
Querying data is done through a Client
object that initialize the connection with Spice endpoint. Client
have the following arguments:
- api_key (string, required): API key to authenticate with the endpoint.
- url (string, optional): URL of the endpoint to use (default: grpc+tls://flight.spiceai.io)
- tls_root_cert (Path or string, optional): Path to the tls certificate to use for the secure connection (ommit for automatic detection)
Once a client is created you can also use the web3.py interface under the w3
attribute.
from spicepy import Client
client = Client('API_KEY')
print(client.w3.eth.get_block_number())
Check out our Documentation to learn more about how to use the Python SDK.