Skip to main content

A realtime plotting library built using

Project description


crystal logo

A realtime plotting and project management library built using Plotly

What can it do?

Crystal is an alternative to the amazingly useful visualization tool Tensorboard with some additional features that make it useful not just for Machine Learning but, in any project that needs realtime data visualizations. You can include realtime plots in your python (more languages to come) easily with just two line of code.

Some features provided by crystal include;

  • Centralized database to store the results of all projects.
  • Easy way to download results from the database if needed.
  • Plots supported include scalar, histogram and images with more to come.

To get started just install crystal using pip as follows:

$ pip install crystal

The installation adds a path to crystal script to PATH variable on linux which allows you to run the crystal dashboard from any directory as follows:

$ crystal


  • If you install it on a virtual environment then you will only be able to run it only when the environment is activated.

Here's how you'd plot a sine wave using crystal:


import time
import numpy as np
from crystal import Crystal

cr = Crystal(project_name="Realtime_sine")
x_range = np.arange(0, 1000, 0.1)

for i in x_range:
    value = np.sin(2*np.pi*i)
    cr.scalar(value=value, step=i, name="sine_wave")
    print("step: {} \t value: {}".format(i, value))
    time.sleep(1)  # one value a second

Let's have a closer look at some of the functions used in the above code:

  • cr = Crystal(project_name=..) creates a new project in the database, if no project name is provided then, the script name is used as the project name.
  • cr.scalar(value=..) plots a scalar value and takes three parameters, value stores the y-axis value which in this case is the sin output, step saves the x-axis value and name provides a title for the plot.
  • Each run in a project is assigned a unique run id that contains the time stamp. You can see them in the terminal and also the dashboard (described below).
  • All the data is stores under ~/Crystal_data/crystal.db.



$ crystal 

and select a project and run name. You will see a plot that looks something like this:

crystal gif

Crystal Dashboard in action

Where can I learn more?

Docs are still being worked on. Feel free to contribute in documenting the usage!

Built With


Please read for details on our code of conduct, and the process for submitting pull requests to us.


We use SemVer for versioning. For the versions available, see the tags on this repository.


See also the list of contributors who participated in this project.


This project is licensed under the MIT License - see the file for details


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for crystal, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size crystal-0.1.0-py3-none-any.whl (2.1 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size crystal-0.1.0.tar.gz (2.1 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page