Sign inSign up

serenytics/serenytics-python-client

By serenytics

•Updated over 9 years ago

Python client for Serenytics

Image
1

9.7K

serenytics/serenytics-python-client repository overview

⁠Serenytics Python Client

CircleCI Codacy Badge Codacy Badge

Serenytics⁠ is a hosted or on-premises platform to analyze, visualize and share your data. With Serenytics you can create custom dashboards that fit your exact needs.

The Serenytics Python Client main features are:

  • create a new data source
  • reload data in a source
  • push new data in a source
  • extract data from a source using our full data processing API

You can use all these features inside your custom python scripts that you can run and schedule on Serenytics⁠.

Full Serenytics developer documentation⁠

⁠Setup

To setup your project, follow these steps:

  1. Install Serenytics using pip: pip install --upgrade serenytics.
  2. Initialize the client with your API key. You can find your key on your Serenytics account⁠.

Note: when running the script on Serenytics platform, the api_key param is not required, it is set automatically.

import serenytics

client = serenytics.Client(api_key='YOUR_API_KEY')

⁠Quickstart

Example script:

import serenytics

client = serenytics.Client(api_key='YOUR_API_KEY')

data_source = client.get_or_create_storage_data_source_by_name('new_data_source')

data_source.reload_data([
    {'year': 2015, 'quarter': 'Q1', 'sales': 120},
    {'year': 2015, 'quarter': 'Q2', 'sales': 80},
    {'year': 2015, 'quarter': 'Q4', 'sales': 25},
    {'year': 2014, 'quarter': 'Q2', 'sales': 85},
])

⁠Run your script on your machine

When writing your script, you often want to use your favorite IDE or text editor on your machine. You can use a virtualenv and install all the dependencies with:

pip install -r requirements.txt

or run the script with docker:

docker run --rm -it -v $(pwd):/usr/src/app serenytics/serenytics-python-client:RELEASE python YOUR_SCRIPT.py

where you have to replace YOUR_SCRIPT.py with the name of your python file and RELEASE with the last release of the serenytics python client (e.g.: 0.2).

Tag summary

Content type

Image

Digest

Size

447 MB

Last updated

over 9 years ago

docker pull serenytics/serenytics-python-client:python3-1.4.4