Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Ibis

Documentation Status Anaconda-Server Badge PyPI Build status Build status Codecov branch

What is Ibis?

Ibis is a Python library that provides a lightweight, universal interface for data wrangling. It helps Python users explore and transform data of any size, stored anywhere.

Ibis has three primary components:

  1. A dataframe API for Python. Python users can write Ibis code to manipulate tabular data.
  2. Interfaces to 15+ query engines. Wherever data is stored, people can use Ibis as their API of choice to communicate with any of those query engines.
  3. Deferred execution. Ibis uses deferred execution, so execution of code is pushed to the query engine. Users can execute at the speed of their backend, not their local computer.

Why Use Ibis?

Ibis aims to be a future-proof solution to interacting with data using Python and can accomplish this goal through its main features:

  • Familiar API: Ibis’s API design borrows from popular APIs like pandas and dplyr that most users already know and like to use.
  • Consistent syntax: Ibis aims to be a universal Python API for tabular data of any size, big or small.
  • Deferred execution: Ibis pushes code execution to the query engine and only moves required data into memory when necessary. Analytics workflows are faster and more efficient
  • Interactive mode: Ibis provides an interactive mode in which users can quickly diagnose problems, explore data, and mock up workflows and pipelines locally.
  • 10+ supported backends: Ibis supports multiple query engines and DataFrame APIs. Use one interface to transform with your data wherever it lives: from DataFrames in pandas to Parquet files through DuckDB to tables in BigQuery.
  • Minimize rewrites: Teams can often keep their Ibis code the same regardless of backend changes, like increasing or decreasing computing power, changing the number or size of their databases, or switching backends entirely.
  • Flexibility when you need it: When Ibis doesn't support something, it provides a way to jump directly into SQL.

Common Use Cases

  • Speed up prototype to production. Scale code written and tested locally to a distributed system or cloud SQL engine with minimal rewrites.
  • Boost performance of existing Python or pandas code. For example a general rule of thumb for pandas is "Have 5 to 10 times as much RAM as the size of your dataset". When a dataset exceeds this rule using in-memory frameworks like pandas can be slow. Instead, using Ibis will significantly speed up your workflows because of its deferred execution. Ibis also empowers you to switch to a faster database engine, without changing much of your code.
  • Get rid of long, error-prone, f-strings. Ibis provides one syntax for multiple query engines and dataframe APIs that lets you avoid learning new flavors of SQL or other framework-specific code. Learn the syntax once and use that syntax anywhere.

Backends

Ibis acts as a universal frontend to the following systems:

The list of supported backends is continuously growing. Anyone can get involved in adding new ones! Learn more about contributing to ibis in our contributing documentation at https://github.com/ibis-project/ibis/blob/master/docs/CONTRIBUTING.md

Installation

Install Ibis from PyPI with:

pip install 'ibis-framework[duckdb]'

Or from conda-forge with:

conda install ibis-framework -c conda-forge

(It’s a common mistake to pip install ibis. If you try to use Ibis and get errors early on try uninstalling ibis and installing ibis-framework)

To discover ibis, we suggest starting with the DuckDB backend (which is included by default in the conda-forge package). The DuckDB backend is performant and fully featured.

To use ibis with other backends, include the backend name in brackets for PyPI:

pip install 'ibis-framework[postgres]'

Or use ibis-$BACKEND where $BACKEND is the specific backend you want to use when installing from conda-forge:

conda install ibis-postgres -c conda-forge

Getting Started with Ibis

We provide a number of tutorial and example notebooks in the ibis-examples. The easiest way to try these out is through the online interactive notebook environment provided here: Binder

You can also get started analyzing any dataset, anywhere with just a few lines of Ibis code. Here’s an example of how to use Ibis with a SQLite database.

Download the SQLite database from the ibis-tutorial-data GCS (Google Cloud Storage) bucket, then connect to it using ibis.

curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'

Connect to the database and show the available tables

>>> import ibis
>>> from ibis import _
>>> ibis.options.interactive = True
>>> con = ibis.sqlite.connect("geography.db")
>>> con.tables
Tables
------
- countries
- gdp
- independence

Choose the countries table and preview its first few rows

>>> countries = con.tables.countries
>>> countries.head()
┏━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ iso_alpha2 ┃ iso_alpha3 ┃ iso_numeric ┃ fips   ┃ name                 ┃ capital          ┃ area_km2 ┃ population ┃ continent ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ string     │ string     │ int32       │ string │ string               │ string           │ float64  │ int32      │ string    │
├────────────┼────────────┼─────────────┼────────┼──────────────────────┼──────────────────┼──────────┼────────────┼───────────┤
│ AD         │ AND        │          20 │ AN     │ Andorra              │ Andorra la Vella │    468.0 │      84000 │ EU        │
│ AE         │ ARE        │         784 │ AE     │ United Arab Emirates │ Abu Dhabi        │  82880.0 │    4975593 │ AS        │
│ AF         │ AFG        │           4 │ AF     │ Afghanistan          │ Kabul            │ 647500.0 │   29121286 │ AS        │
│ AG         │ ATG        │          28 │ AC     │ Antigua and Barbuda  │ St. Johns        │    443.0 │      86754 │ NA        │
│ AI         │ AIA        │         660 │ AV     │ Anguilla             │ The Valley       │    102.0 │      13254 │ NA        │
└────────────┴────────────┴─────────────┴────────┴──────────────────────┴──────────────────┴──────────┴────────────┴───────────┘

Show the 5 least populous countries in Asia

>>> (
...     countries.filter(_.continent == "AS")
...     .select("name", "population")
...     .order_by(_.population)
...     .limit(5)
... )
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ name                           ┃ population ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ string                         │ int32      │
├────────────────────────────────┼────────────┤
│ Cocos [Keeling] Islands        │        628 │
│ British Indian Ocean Territory │       4000 │
│ Brunei                         │     395027 │
│ Maldives                       │     395650 │
│ Macao                          │     449198 │
└────────────────────────────────┴────────────┘

Community and Contributing

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

Join our community here:

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

Metadata

Release files for ibis-framework 6.1.1.dev176

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibis-framework 6.1.1.dev176
File Size Uploaded Provenance Actions
ibis_framework-6.1.1.dev176.tar.gz 1.1 MB Without provenance Details for ibis_framework-6.1.1.dev176.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ibis-framework 6.1.1.dev176
File Interpreter ABI Platform Actions
ibis_framework-6.1.1.dev176-py3-none-any.whl Python 3 none any Details for ibis_framework-6.1.1.dev176-py3-none-any.whl

Total release size: 2.6 MB

Release files / ibis_framework-6.1.1.dev176.tar.gz

Download URL ibis_framework-6.1.1.dev176.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
6a34cb4603bb1da3f524cac18850f6920874dc812dd978635a394200a94424e0
BLAKE2b-256 checksum
How to use checksums
d26c32d107b7407aff3633995eadfa638f1d2c1a2ca8fe7e4ec80e104c23b2bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.12 Linux/5.15.0-1041-azure

Release files / ibis_framework-6.1.1.dev176-py3-none-any.whl

Download URL ibis_framework-6.1.1.dev176-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f953bd718a3185592769c49b473016bb52452cfb5a85c7413c820fe0a8ecbb18
BLAKE2b-256 checksum
How to use checksums
b7949828555e15c4935abfda914ecd0f7b1f3813caca8ee06f355b09f4a7a67f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.12 Linux/5.15.0-1041-azure

Security for ibis-framework 6.1.1.dev176

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page