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.3.tar.gz (3.9 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.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datagrok_api-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for datagrok_api-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0237b87dd0e05c0cf9cb3cfb1dfd2bd481a32fb5525d59eb74e4f139af303043
MD5 2d47423497806d29c4883a150d24efdf
BLAKE2b-256 92df983d4ac05d41d5779b3e203077db4873dd6cebacedd8f6c9b9581979f8ae

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for datagrok_api-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b5c9383f7f276179ba146014b1ccad32380b49a70a46e649ba2f95381bbd2cbf
MD5 f65709046e99d5059e1d8887341585f4
BLAKE2b-256 5c358e4a61c0483f0d104044a5ca78ab9cd50eac113a5f42772c669810b65281

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