Setting up the DuckDB Python Client
Up until now, we have been working with DuckDB using its terminal-based CLI client. While the CLI client offers a convenient way to jump in and start using DuckDB, it does not lend itself as well to being integrated with environments and workflows for data analysis and for the development of operational data services or products. Python and its rich ecosystem of data packages and tooling is a popular programming language for both these families of use cases. The DuckDB Python client offers a feature-rich and versatile collection of APIs for interacting with DuckDB databases in Python. It also offers rich integrations with Python and its ecosystem, such as enabling you to register Python functions to be used in DuckDB queries and allowing you to consume from and export to in-memory data structures, including pandas dataframes, Polars dataframes, and Apache Arrow Tables.
We’ll cover all these powerful features just mentioned in Chapter 8...