Skip to main content

Timbr REST API connector

Project description

Timbr logo description

timbr REST API connector sample file

This project is a sample connecting to timbr using REST API from Python.

Dependencies

  • Python 3.7.13+ or 3.8.x or 3.9.x

Installation

Sample usage

  • For an example of how to use the REST API connector for Timbr, follow this Example file

Connection parameters - general example

 # General example for query execution
 response = pytimbr_api.executeQuery(
   hostname='<TIMBR_IP/HOST>',
   port='<TIMBR_PORT>',
   ontology='<ONTOLOGY_NAME>',
   token='<USER_TOKEN>',
   query='<TIMBR_QUERY>',
   enabled_ssl=<True/False>,
   verify_ssl=<True/False>,
   nested='<true/false>'
 )

 # hostname - String - The IP / Hostname of the Timbr platform.
 # port - String - Timbr's default port with enabled_ssl is 443 without SSL is 11000.
 # ontology - String - The ontology / knowledge graph to connect to.
 # token - String - Timbr token value.
 # query - String - The query that you want to execute.
 # enabled_ssl - Boolean - Use True for HTTPS connection and False for HTTP connection.
 # verify_ssl - Boolean - Verifying the target server's SSL Certificate, use False to disable this process.
 # nested - String - Change to 'true' if nested flag needs to be enabled. make sure this flag contains string value not bool value.

Execute query with HTTP connection

 # Example with dummy data for HTTP connections
 response = pytimbr_api.executeQuery(
   hostname='mytimbrenv.com',
   port='11000',
   ontology='my_ontology',
   token='tk_mytimbrtoken',
   query='SELECT * FROM timbr.sys_concepts',
   enabled_ssl=False,
   verify_ssl=False,
   nested='false'
 )
 print(response)

Execute query with HTTPS connection

 # Real Example with dummy data for HTTPS connections
 response = pytimbr_api.executeQuery(
   hostname='mytimbrenv.com',
   port='443',
   ontology='my_ontology',
   token='tk_mytimbrtoken',
   query='SELECT * FROM timbr.sys_concepts',
   enabled_ssl=True,
   verify_ssl=True,
   nested='false'
 )
 print(response)

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

pytimbr_api-1.0.1.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file pytimbr_api-1.0.1.tar.gz.

File metadata

  • Download URL: pytimbr_api-1.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pytimbr_api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e3c1ca16e73c097949cceea6220c872bdf763ca125bb7c4991679812bfb11c5e
MD5 aec59fa97138df3e76834ccd87a1901a
BLAKE2b-256 c6c238c5b3b5787bc3579ed4e39c381d202b8d9a9f32253e34782c3f4d623b86

See more details on using hashes here.

Supported by

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