ibis-framework

The portable Python dataframe library

Apache-2.0 166 个版本 Python >=3.10
安装
pip install ibis-framework
poetry add ibis-framework
pipenv install ibis-framework
conda install ibis-framework
描述

Ibis

Documentation status Project chat Anaconda badge PyPI Build status Build status Codecov branch

What is Ibis?

Ibis is the portable Python dataframe library:

See the documentation on "Why Ibis?" to learn more.

Getting started

You can pip install Ibis with a backend and example data:

pip install 'ibis-framework[duckdb,examples]'

💡 Tip

See the installation guide for more installation options.

Then use Ibis:

>>> import ibis
>>> ibis.options.interactive = True
>>> t = ibis.examples.penguins.fetch()
>>> t
┏━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┓
 species  island     bill_length_mm  bill_depth_mm  flipper_length_mm  body_mass_g  sex     year  
┡━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━┩
 string   string     float64         float64        int64              int64        string  int64 
├─────────┼───────────┼────────────────┼───────────────┼───────────────────┼─────────────┼────────┼───────┤
 Adelie   Torgersen            39.1           18.7                181         3750  male     2007 
 Adelie   Torgersen            39.5           17.4                186         3800  female   2007 
 Adelie   Torgersen            40.3           18.0                195         3250  female   2007 
 Adelie   Torgersen            NULL           NULL               NULL         NULL  NULL     2007 
 Adelie   Torgersen            36.7           19.3                193         3450  female   2007 
 Adelie   Torgersen            39.3           20.6                190         3650  male     2007 
 Adelie   Torgersen            38.9           17.8                181         3625  female   2007 
 Adelie   Torgersen            39.2           19.6                195         4675  male     2007 
 Adelie   Torgersen            34.1           18.1                193         3475  NULL     2007 
 Adelie   Torgersen            42.0           20.2                190         4250  NULL     2007 
                                                                                          
└─────────┴───────────┴────────────────┴───────────────┴───────────────────┴─────────────┴────────┴───────┘
>>> g = t.group_by("species", "island").agg(count=t.count()).order_by("count")
>>> g
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━┓
 species    island     count 
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━┩
 string     string     int64 
├───────────┼───────────┼───────┤
 Adelie     Biscoe        44 
 Adelie     Torgersen     52 
 Adelie     Dream         56 
 Chinstrap  Dream         68 
 Gentoo     Biscoe       124 
└───────────┴───────────┴───────┘

💡 Tip

See the getting started tutorial for a full introduction to Ibis.

Python + SQL: better together

For most backends, Ibis works by compiling its dataframe expressions into SQL:

>>> ibis.to_sql(g)
SELECT
  "t1"."species",
  "t1"."island",
  "t1"."count"
FROM (
  SELECT
    "t0"."species",
    "t0"."island",
    COUNT(*) AS "count"
  FROM "penguins" AS "t0"
  GROUP BY
    1,
    2
) AS "t1"
ORDER BY
  "t1"."count" ASC

You can mix SQL and Python code:

>>> a = t.sql("SELECT species, island, count(*) AS count FROM penguins GROUP BY 1, 2")
>>> a
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━┓
 species    island     count 
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━┩
 string     string     int64 
├───────────┼───────────┼───────┤
 Adelie     Torgersen     52 
 Adelie     Biscoe        44 
 Adelie     Dream         56 
 Gentoo     Biscoe       124 
 Chinstrap  Dream         68 
└───────────┴───────────┴───────┘
>>> b = a.order_by("count")
>>> b
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━┓
 species    island     count 
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━┩
 string     string     int64 
├───────────┼───────────┼───────┤
 Adelie     Biscoe        44 
 Adelie     Torgersen     52 
 Adelie     Dream         56 
 Chinstrap  Dream         68 
 Gentoo     Biscoe       124 
└───────────┴───────────┴───────┘

This allows you to combine the flexibility of Python with the scale and performance of modern SQL.

Backends

Ibis supports more than 20 backends:

How it works

Most Python dataframes are tightly coupled to their execution engine. And many databases only support SQL, with no Python API. Ibis solves this problem by providing a common API for data manipulation in Python, and compiling that API into the backend’s native language. This means you can learn a single API and use it across any supported backend (execution engine).

Ibis broadly supports two types of backend:

  1. SQL-generating backends
  2. DataFrame-generating backends

Ibis backend types

Portability

To use different backends, you can set the backend Ibis uses:

>>> ibis.set_backend("duckdb")
>>> ibis.set_backend("polars")
>>> ibis.set_backend("datafusion")

Typically, you'll create a connection object:

>>> con = ibis.duckdb.connect()
>>> con = ibis.polars.connect()
>>> con = ibis.datafusion.connect()

And work with tables in that backend:

>>> con.list_tables()
['penguins']
>>> t = con.table("penguins")

You can also read from common file formats like CSV or Apache Parquet:

>>> t = con.read_csv("penguins.csv")
>>> t = con.read_parquet("penguins.parquet")

This allows you to iterate locally and deploy remotely by changing a single line of code.

💡 Tip

Check out the blog on backend agnostic arrays for one example using the same code across DuckDB and BigQuery.

Community and contributing

Ibis is an open source project and welcomes contributions from anyone in the community.

Join our community by interacting on GitHub or chatting with us on Zulip.

For more information visit https://ibis-project.org/.

Governance

The Ibis project is an independently governed open source community project to build and maintain the portable Python dataframe library. Ibis has contributors across a range of data companies and institutions.

版本列表
12.0.0 2026-02-07
11.0.1.dev82 2026-01-18
11.0.1.dev80 2026-01-11
11.0.1.dev8 2025-10-19
11.0.1.dev65 2026-01-04
11.0.1.dev62 2025-12-28
11.0.1.dev54 2025-12-21
11.0.1.dev53 2025-12-07
11.0.1.dev51 2025-11-23
11.0.1.dev42 2025-11-16
11.0.1.dev31 2025-11-09
11.0.1.dev27 2025-11-02
11.0.1.dev15 2025-10-26
11.0.1.dev133 2026-02-01
11.0.1.dev110 2026-01-25
11.0.0 2025-10-15
10.8.1.dev76 2025-10-05
10.8.1.dev67 2025-09-28
10.8.1.dev66 2025-09-21
10.8.1.dev54 2025-08-24
10.8.1.dev36 2025-08-17
10.8.1.dev30 2025-08-10
10.8.1.dev22 2025-08-03
10.8.1.dev105 2025-10-12
10.8.0 2025-07-28
10.7.0 2025-07-27
10.6.1.dev67 2025-07-20
10.6.1.dev50 2025-07-13
10.6.1.dev5 2025-06-22
10.6.1.dev43 2025-07-06
10.6.1.dev20 2025-06-29
10.6.0 2025-06-16
10.5.1.dev84 2025-06-01
10.5.1.dev8 2025-04-27
10.5.1.dev65 2025-05-25
10.5.1.dev41 2025-05-18
10.5.1.dev31 2025-05-11
10.5.1.dev21 2025-05-04
10.5.1.dev126 2025-06-15
10.5.1.dev104 2025-06-08
10.5.0 2025-04-18
10.4.1.dev4 2025-03-30
10.4.1.dev37 2025-04-13
10.4.1.dev31 2025-04-06
10.4.1.dev30 2025-04-04
10.4.0 2025-03-27
10.3.2.dev5 2025-03-16
10.3.2.dev22 2025-03-23
10.3.1 2025-03-14
10.3.0 2025-03-11
10.2.1.dev15 2025-03-09
10.2.0 2025-03-03
10.1.1.dev20 2025-03-02
10.1.0 2025-02-22
10.0.0 2025-02-06
10.0.0.dev97 2024-07-14
10.0.0.dev93 2024-05-26
10.0.0.dev91 2024-08-25
10.0.0.dev77 2024-07-07
10.0.0.dev71 2024-05-19
10.0.0.dev69 2024-09-22
10.0.0.dev6 2024-06-16
10.0.0.dev55 2024-08-23
10.0.0.dev52 2024-05-12
10.0.0.dev490 2025-01-26
10.0.0.dev49 2024-06-30
10.0.0.dev459 2025-01-19
10.0.0.dev438 2025-01-05
10.0.0.dev415 2024-12-29
10.0.0.dev398 2024-12-22
10.0.0.dev35 2024-09-08
10.0.0.dev30 2024-09-15
10.0.0.dev27 2024-06-23
10.0.0.dev256 2024-11-10
10.0.0.dev25 2024-07-28
10.0.0.dev231 2024-11-03
10.0.0.dev200 2024-10-27
10.0.0.dev18 2024-05-05
10.0.0.dev176 2024-10-20
10.0.0.dev148 2024-10-13
10.0.0.dev145 2024-07-21
10.0.0.dev141 2024-09-01
10.0.0.dev125 2024-10-06
10.0.0.dev120 2024-06-02
9.5.0 2024-09-11
9.4.0 2024-09-03
9.3.0 2024-08-07
9.2.0 2024-07-22
9.1.0 2024-06-13
9.0.0 2024-04-30
9.0.0.dev686 2024-04-28
9.0.0.dev665 2024-04-21
9.0.0.dev619 2024-04-14
9.0.0.dev551 2024-03-31
9.0.0.dev511 2024-03-24
9.0.0.dev457 2024-03-17
9.0.0.dev413 2024-03-10
9.0.0.dev356 2024-03-03
9.0.0.dev34 2024-02-11
9.0.0.dev311 2024-02-25
9.0.0.dev272 2024-02-16
8.0.0 2024-02-05
8.0.0.dev90 2023-12-31
8.0.0.dev78 2023-12-24
8.0.0.dev259 2024-02-04
8.0.0.dev210 2024-01-28
8.0.0.dev178 2024-01-21
8.0.0.dev148 2024-01-14
8.0.0.dev118 2024-01-07
7.2.0 2023-12-18
7.1.0 2023-11-16
7.0.0 2023-10-02
7.0.0.dev627 2023-10-01
7.0.0.dev525 2023-09-24
7.0.0.dev501 2023-09-17
7.0.0.dev439 2023-09-10
7.0.0.dev230 2023-09-03
6.2.0 2023-08-31
6.1.1.dev96 2023-08-13
6.1.1.dev22 2023-08-06
6.1.1.dev176 2023-08-27
6.1.1.dev135 2023-08-20
6.1.0 2023-08-03
6.0.1.dev58 2023-07-16
6.0.1.dev33 2023-07-09
6.0.1.dev128 2023-07-30
6.0.0 2023-07-05
5.1.1.dev596 2023-07-02
5.1.1.dev554 2023-06-25
5.1.1.dev516 2023-06-18
5.1.1.dev467 2023-06-13
5.1.0 2023-04-11
5.0.0 2023-03-15
4.1.0 2023-01-25
4.0.0 2023-01-09
3.2.0 2022-09-15
3.1.0 2022-07-26
3.0.2 2022-04-28
3.0.1 2022-04-28
3.0.0 2022-04-25
2.1.1 2022-01-12
2.1.0 2022-01-12
2.0.0 2021-10-06
1.4.0 2020-11-11
1.3.0 2020-02-28
1.2.0 2019-06-24
1.1.0 2019-06-10
1.0.0 2019-03-26
0.14.0 2018-08-23
0.13.0 2018-03-30
0.12.0 2017-10-28
0.11.2 2017-07-03
0.11.1 2017-06-28
0.10.0 2017-03-09
0.9.0 2016-11-28
0.8.1 2016-05-19
0.8.0 2016-05-19
0.7.1 2016-04-03
0.7.0 2016-03-16
0.6.1 2016-03-08
v0.6.0 2015-11-30
0.5.2 2015-09-16
0.5.1 2015-09-10
0.4.1 2015-08-16
0.4.0 2015-08-14
0.3.0 2015-07-20