Skip to main content Link Menu Expand (external link) Document Search Copy Copied

How do I use FeatureBase Python classes to connect to Community?

Use the following client classes to connect to FeatureBase Community.

Before you begin

Syntax

# Import required libraries
import featurebase

# Connect to FeatureBase Community
client = featurebase.client(
  hostport = "<host:port>",
  database = "<database-id>",
  cafile = "<certificate-file-path>",
  capath = "<certificate-folder>",
  origin = "<cross-origin-resource-sharing>",
  timeout = "<int-value>")

Required libraries

import featurebase is required. Add other libraries as necessary.

Connect to FeatureBase Community

Key-values are defined in featurebase/opt/featurebase.conf

Keywords Description Required Additional information
client = featurebase.client Defines featurebase.client and optional flags Yes Use featurebase.client() to connect to Community instance on same host
hostport Hostname and port for your FeatureBase instance Optional Defaults to localhost:10101
cafile Fully qualified CA certificate file path Optional  
capath Fully qualified CA certificate folder Optional  
origin CORS (Cross Origin Resource Sharing) value Optional  

Next step