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.

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.

from datagrok_api import DatagrokClient
import pandas as pd
from sklearn.datasets import load_iris

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

# 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']))

# 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')

# 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.1.tar.gz (7.7 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.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datagrok_api-0.0.1.tar.gz
  • Upload date:
  • Size: 7.7 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.1.tar.gz
Algorithm Hash digest
SHA256 349c2ade92e1b65e1b7ce85c19184ade5b336775b11798220a4ab0f9d80124e2
MD5 619afaefa02bb99dd3f01b79e46be12f
BLAKE2b-256 fcdf91e46f3c5767e67e000cb562119667bb03d6d2bc32a111e329115a5e1561

See more details on using hashes here.

File details

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

File metadata

  • Download URL: datagrok_api-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff14d1ab067f2f0c6536dc2ac99be987b7472e2a42f79db80b9d31290436eabd
MD5 c6f6baf1a667db82cd0816ca2c9e63e5
BLAKE2b-256 cf05e8015734c7f8f5c4d35cc8917bba50e26852edb685fd02dc357c146302b4

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