Skip to content

image/svg+xml The Ibis Project

The flexibility of Python analytics with the scale and performance of modern SQL.



Write high-level Python code
>>> import ibis
>>> con = ibis.connect('movielens.sqlite')
>>> movies = con.tables.movies
>>> rating_by_year = movies.group_by('year').avg_rating.mean()
>>> q = rating_by_year.order_by(rating_by_year.year.desc())
Compile to SQL
>>> con.compile(q)

SELECT year, avg(avg_rating)
FROM movies t1
GROUP BY t1.year
ORDER BY t1.year DESC
Execute on multiple backends
>>> con.execute(q)

     year  mean(avg_rating)
0    2021          2.586362
1    2020          2.719994
2    2019          2.932275
3    2018          3.005046
4    2017          3.071669

Features

  • Consistent syntax across backends: Enjoy a uniform Python API, whether using DuckDB, PostgreSQL, PySpark, BigQuery, or any other supported backend.
  • Performant: Execute queries as fast as the database engine itself.
  • Interactive: Explore data in a notebook or REPL.
  • Extensible: Add new operations, optimizations, and custom APIs.
  • Free and open-source: licensed under Apache 2.0, available on Github

Last update: 2022-11-09