PerfPlotter

Read data from CSV files using pandas and generate interactive plots using bokeh, which can then be embedded into HTML pages and served by server-client applications (or at least allow them to be viewed on a browser).

Environment

  • Python 3.8.x
  • macOS 10.15.x
  • Firefox 88.x

Setup

  1. Clone and cd into the perfplotter directory
  2. Install dependencies
    $ pipenv install --dev --python=/path/to/python3.8
    
    
  3. Install pre-commit hooks
    $ pre-commit install
    $ pre-commit run --all-files
    
    
    • Optional: pre-commit autoupdate
  4. Activate virtual environment
  5. In the same directory as setup.py, install *perfplotter as an editable dependency:
    $ pip install -e .
    
    
    • Use bare pip here to exclude perfplotter from the Pipfile* (which is under version control)
    • Do pipenv clean to really make sure it's not included in the Pipfile*
  6. Start and open any of the jupyter notebooks
    $ jupyter notebook --notebook-dir tutorials/notebooks
    
    

Usage

Show the main usage/help info

$ perfplotter --help

Show each command's usage/help info

$ perfplotter examples --help
$ perfplotter timeseries --help
$ perfplotter histogram --help

Supported plots

  • Plot TimeSeries
    $ perfplotter timeseries --help
    $ perfplotter timeseries /path/to/my.csv -x 1 -y 2
    
    
  • Plot Histogram
    $ perfplotter histogram --help
    $ perfplotter histogram /path/to/my.csv -x 1 -y 2
    
    

Use examples to test

$ perfplotter examples sample1
Generated <current-working-directory>/out/sample1.csv

$ perfplotter timeseries out/sample1.csv

The last command should open up a browser with an interactive plot of sample1.csv

sample-timeseries-browser

Distribution

  1. In the same directory as setup.py:
    $ python setup.py sdist
    
    
    • This should create a dist/perfplotter-VERSION.tar.gz file
  2. In another directory (i.e. a test env) where perfplotter will be used:
    $ pipenv install /path/to/perfplotter/dist/perfplotter-VERSION.tar.gz
    
    

GitHub

https://github.com/ginomempin/perfplotter