| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A verb-based, pipe-friendly Python package for creating beautiful static and interactive visualizations with an intuitive, functional API.
PipePlotly is a high-level, verb-based visualization library for Python that prioritizes developer experience and code readability. It bridges the gap between the structured Grammar of Graphics (via plotnine) and modern interactive dashboards (via Plotly Express).
By leveraging a functional API and the >> pipe operator, PipePlotly allows you to build complex data visualizations that read like natural language, making your analysis pipelines more maintainable and expressive.
pip install pipeplotlypip install pipeplotly[pipeframe] # For enhanced pipe operator support
pip install pipeplotly[full] # For all features
pip install pipeplotly[dev] # Development dependenciesPipePlotly is designed to be used with the pipe operator (>>) for a clean, readable data pipeline.
import pandas as pd
from pipeplotly import Plot
from pipeplotly.verbs import plot_points, add_color, add_labels, set_theme, show
# Create sample data
df = pd.DataFrame({
'x': range(10),
'y': [i**2 for i in range(10)],
'category': ['A', 'B'] * 5
})
# Create a static plot using the pipe operator
(df
>> Plot()
>> plot_points('x', 'y')
>> add_color('category')
>> add_labels(title='My First Pipe Plot', x='X Values', y='Y Values')
>> set_theme('minimal')
>> show())Tip
How to read the >> operator: Think of it as "pipe to" or "and then". For example: df >> Plot() >> show() is read as "take the dataframe, pipe it to a Plot, and then show it."
If you prefer traditional object-oriented syntax, PipePlotly also supports method chaining:
plot = (Plot(df)
.plot_points('x', 'y')
.add_color('category')
.show())PipePlotly organizes its API into four verb categories, all designed for use with >>.
df >> Plot() >> plot_points(x, y) # Scatter plot
df >> Plot() >> plot_lines(x, y) # Line plot
df >> Plot() >> plot_bars(y=column) # Bar chart
df >> Plot() >> plot_histogram(x) # Histogram
df >> Plot() >> plot_box(x, y) # Box plot
df >> Plot() >> plot_violin(x, y) # Violin plot>> add_color(column) # Color mapping
>> add_size(column) # Size mapping
>> add_shape(column) # Shape mapping
>> add_facets(rows, cols) # Small multiples
>> add_labels(title, x, y) # Titles and labels
>> add_smooth() # Statistical smoothing>> scale_x_log() # Log scales
>> xlim(min, max) # Axis limits
>> coord_flip() # Swap axes>> show() # Display
>> save(filename) # Export
>> to_interactive() # Switch to Plotly
>> to_static() # Switch to plotninefrom pipeplotly import Plot
from pipeplotly.verbs import *
import seaborn as sns
iris = sns.load_dataset('iris')
(iris
>> Plot()
>> plot_points('sepal_length', 'sepal_width')
>> add_color('species')
>> add_facets(cols='species')
>> add_labels(title='Iris Dataset Analysis')
>> set_theme('minimal')
>> show())(df
>> Plot()
>> plot_lines('date', 'value')
>> add_color('category')
>> to_interactive() # Switch to Plotly backend
>> show())Detailed documentation and guides are available:
# Clone the repository
git clone https://github.com/Yasser03/pipeplotly.git
cd pipeplotly
# Install in development mode
pip install -e .[dev]
# Run tests
pytest tests/ -vDr. Yasser Mustafa
AI & Data Science Specialist | Theoretical Physics PhD
PipePlotly is actively evolving. Here’s what’s on the horizon:
MIT License - see LICENSE file for details.
| Back | FazBrowse Home | New Git URL |