Skip to main content

MindsDB Python SDK, provides an SDK to use a remote mindsdb instance

Project description

Python MindsDB SDK

The Python MindsDB SDK allows you to connect to a MindsDB server from Python using the HTTP API.


pip install mindsdb_sdk


Connecting to the MindsDB server

You can establish a connection to the MindsDB server using the SDK. Here are some examples:

Connect to a local MindsDB server

import mindsdb_sdk
con = mindsdb_sdk.connect()
con = mindsdb_sdk.connect('')

Connect to the MindsDB Cloud

import mindsdb_sdk
con = mindsdb_sdk.connect(login='', password='-')
con = mindsdb_sdk.connect('', login='', password='-')

Connect to a MindsDB Pro server

import mindsdb_sdk
con = mindsdb_sdk.connect('http://<YOUR_INSTANCE_IP>', login='', password='-', is_managed=True)

Basic usage

Once connected to the server, you can perform various operations. Here are some examples:

# Get a list of databases
databases = con.databases.list()

# Get a specific database
database = databases[0]  # Database type object

# Perform an SQL query
query = database.query('select * from table1')

# Create a table
table = database.tables.create('table2', query)

# Get a project
project = con.projects.proj

# or use mindsdb project
project = con

# Perform an SQL query within a project
query = project.query('select * from database.table join model1')

# Create a view
view = project.views.create('view1', query=query)

# Get a list of views
views = project.views.list()
view = views[0]
df = view.fetch()

# Get a list of models
models = project.models.list()
model = models[0]

# Use a model for prediction
result_df = model.predict(df)
result_df = model.predict(query)

# Create a model
timeseries_options = {
    'order': 'date',
    'window': 5,
    'horizon': 1
model = project.models.create(

# Describe a model

You can find more examples in this Google colab notebook


API Documentation

The API documentation for the MindsDB SDK can be found at You can generate the API documentation locally by following these steps:

Generating API docs locally:

cd docs
pip install -r requirements.txt
make html

The online documentation is automatically updated by pushing changes to the docs branch.


To run all the tests for the components, use the following command:

env PYTHONPATH=./ pytest


We welcome contributions to the MindsDB SDK. If you'd like to contribute, please refer to the contribution guidelines for more information.


The MindsDB SDK is licensed under the MIT License. Feel free to use and modify it according to your needs

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mindsdb_sdk-2.0.0.tar.gz (17.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page