v1.0.0
Announcing spicepy v1.0.0! 🎉
Spice.ai is now generally available! Read the announcement blog post to see how Spice helps developers to build high-performance, highly-available, data and AI-driven applications.
spicepy is the easiest way to query data in Python from Spice.ai over a high-performance Apache Arrow connection, which can be quickly loaded into Pandas data frames for integration into existing data pipelines or Jupyter notebooks.
Get started in 3 steps:
- Sign up for a free API key at Spice.ai
- Download spicepy with
pip install git+https://github.com/spiceai/spicepy@v1.0.0
- Import spicepy, create a client and start querying Spice's built-in live-updating web3 data:
import spicepy
client = spicepy.Client('API_KEY')
block_data = client.query('SELECT * FROM eth.recent_blocks LIMIT 10;').read_pandas()
Explore over 100+ built-in, real-time web3 datasets available in Spice.ai!
Firecache
Looking for even higher performance? Enterprise customers can leverage Spice Firecache, a real-time, in-memory SQL cache based on DuckDB that enables developers to cache Spice datasets for high concurrency, blazing fast SQL query up to 10x the performance of general SQL query.
Querying data with Firecache using spicepy is just as easy as replacing client.query
with client.fire_query
:
import spicepy
client = spicepy.Client('API_KEY')
block_data = client.fire_query('SELECT * FROM eth.recent_blocks LIMIT 10;').read_pandas()
Prices
spicepy also includes access to Spice's pricing data for web3 tokens. Need to get the latest BTC price in dollars? It's as easy as:
client.prices.get_latest("BTC-USDC")
Need to find out the value of BTC at some point in the past? Use client.prices.get()
with parameters for the time-period you are interested in:
from datetime import datetime, timedelta
client.prices.get(["BTC-USDC", "ETH-BTC"],
start=datetime.now() - timedelta(days=7),
end=datetime.now() - timedelta(days=6),
granularity=timedelta(hours=12)
)
Have questions or feedback? Contact us
What's Changed
- Add HTTP Price support by @Jeadie in #48
- Fix setup.py by @Jeadie in #50
- Get spicepy ready for 1.0 by @Jeadie in #49
- Missed a v in v1.0.0 by @Jeadie in #52
- Change URLs for v1 prices by @Jeadie in #53
- Fix GH in version.yml by @Jeadie in #51
- spice.xyz -> spice.ai by @Jeadie in #54
New Contributors
Full Changelog: v0.3.0...v1.0.0