Skip to main content

Client library for integration with datagrok API

Project description

Datagrok python client library

This library can be used for integration with datagrok. It is a python wrapper for public API, that has OpenAPI specification available here.

Refer to Help for more information.

Installation

To install package, use pip.

pip install datagrok-api

Usage

To use API client, import DatagrokClient to your project:

from datagrok_api import DatagrokClient

api = DatagrokClient('your token', 'datagrok url')

License

See License.md.

Examples

The package uses Pandas for representation of tables and dataframes.

import pandas as pd
from sklearn.datasets import load_iris

# Calls a Datagrok function
# Dataframes, columns and primitive data types are supported
api.call_function('Abs', {
	'x': -3
})

# Downloads file from a given connection
res = api.download_file('system.demofiles', 'demog.csv')
print(res.head())

# Uploads iris dataset as a table
iris_id = api.upload_table('iris', pd.DataFrame(load_iris()['data']))['ID']

# Iris also can be uploaded as a file
# api.upload_file('system.demofiles', 'iris.csv', 'iris.csv')

# Fetches freshly uploaded Iris table 
res = api.download_table(iris_id)
print(res.head())

# Creates dashboard from iris table with layout uploaded from file "iris.layout"
dashboard_id = api.create_dashboard('python-test', iris_id, layout_filename='iris.layout')['ID']

# Shares dashboard with admin
api.share_dashboard(dashboard_id, 'Test')

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

datagrok_api-0.0.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datagrok_api-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file datagrok_api-0.0.2.tar.gz.

File metadata

  • Download URL: datagrok_api-0.0.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for datagrok_api-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f227cbc546b69be44a5d2807827bab88b0f0c2b8dec6ad7b1f717446dac125a0
MD5 4b2fda71c458c5cd6eb44467c88a9e32
BLAKE2b-256 2747a686687fc340d88dc0a83b48cc8df7becb7bc387be3ccd74cad3b87709dc

See more details on using hashes here.

File details

Details for the file datagrok_api-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: datagrok_api-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for datagrok_api-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8ba585bbb799096dc67fbe828b20c594e7154d0d7e82f18e26df40a980067248
MD5 430380367b2a7853cf7f8a221e61de82
BLAKE2b-256 9178e22b4ae90465dd0770455c9725685f56e57d71124952f59c13fd73a81087

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