Getting Started

Learn how to install and get started the CrateDB Python client library.

Table of Contents

Prerequisites

Python 3.7 is recommended.

However, older versions of Python can still be used.

Pip should be installed on your system.

Install

The CrateDB Python client is available as a PyPI package.

To install the package, run:

sh$ pip install crate

After that is done, you can import the library, like so:

>>> from crate import client

Interactive Use

Python provides a REPL, also known as an interactive language shell. It’s a handy way to experiment with code and try out new libraries. We recommend iPython, which you can install, like so:

sh$ pip install iPython

Once installed, you can start it up, like this:

sh$ ipython

From there, try importing the CrateDB Python client library and seeing how far you get with the built-in help() function (that can be called on any object), iPython’s autocompletion, and many other features.

Set Up as a Dependency

There are many ways to handle Python project dependencies. The official PyPI package should be compatible with all of them.