Skip to main content

A deceptively simple plotting library for Streamlit

Project description

🍅 Plost

A deceptively simple plotting library for Streamlit.

Because you've been writing plots wrong all this time.

Open in Streamlit

Our goal

  • What you need 99% of the time is insanely easy
  • The other 1% is impossible. Use Vega-Lite instead!

Getting started

pip install plost

Basics

Plost makes it easy to build common plots using the Vega-Lite library but without having to delve into Vega-Lite specs (unless you're doing something tricky), and without having to melt your DataFrame from long format to wide format (the bane of most Vega-Lite plots!)

For example, let's say you have a "long-format" table like this:

time stock_name stock_value
... stock1 1
... stock2 2
... stock1 100
... stock2 200

Then you can draw a line chart by simply calling line_chart() with some column names:

import plost

plost.line_chart(
  my_dataframe,
  x='time',  # The name of the column to use for the x axis.
  y='stock_value',  # The name of the column to use for the data itself.
  color='stock_name', # The name of the column to use for the line colors.
)

Simple enough! But what if you instead have a "wide-format" table like this, which is super common in reality:

time stock1 stock2
... 1 100
... 2 200

Normally you'd have to melt() the table with Pandas first or create a complex Vega-Lite layered plot. But with Plost, you can just specify what you're trying to accomplish and it will melt the data internally for you:

import plost

plost.line_chart(
  my_dataframe,
  x='time',
  y=('stock1', 'stock2'),  # 👈 This is magic!
)

Ok, now let's add a mini-map to make panning/zooming even easier:

import plost

plost.line_chart(
  my_dataframe,
  x='time',
  y=('stock1', 'stock2'),
  pan_zoom='minimap',  # 👈 This is magic!
)

But we're just scratching the surface. Basically the idea is that Plost allows you to make beautiful Vega-Lite-driven charts for your most common needs, without having to learn about the powerful yet complex language behind Vega-Lite.

Check out the the sample app / docs for a taste of other amazing things you can do!

Juicy examples

Check out the sample app!

Documentation

This is in the sample app too!

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

Plost-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

File details

Details for the file Plost-0.2.0.tar.gz.

File metadata

  • Download URL: Plost-0.2.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

File hashes

Hashes for Plost-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5690af7110e60cb3cd2eb7e4bbd617216a20d41b5606db0d4296c5f812223ffa
MD5 52204d2f85ccb57b15af713658159276
BLAKE2b-256 a2534a6c9b1f79b8b3b32e5a0e3da3e69051dce9451bdeaa6b06eee8bc723045

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page