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.
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
File details
Details for the file Plost-0.2.2.tar.gz
.
File metadata
- Download URL: Plost-0.2.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54377aaa1a91f93941adc989c6842b904ec1914d5ba3f941fb56883ad6318670 |
|
MD5 | 2dcc656f85a2de92aa8c44ff80dd6c1a |
|
BLAKE2b-256 | 46f1e7b21bbe12775542565ad13a9d82f1d1a9bc86e7434d6cac7df8a21e5e1f |