Skip to main content

Chartsworth

Chartsworth posts from notebooks to slack. This little metric monster lets you post plots, images, and anything else the slack sdk will let you post.

Read more background and workflows around scheduling in the Notebook Reporting with Chart Monsters Post.

Installation and Setup

pip install chartsworth

Set environment variable CHARTSWORTH_TOKEN to your Slack App. You can create a new Slack App Create a new Slack App and learn more about creating a new slack app in the chartsworth post.

Usage

from chartsworth import Chartsworth
chartsworth = Chartsworth("#chartsy")

new_users = 11_003
chartsworth.post(f"We have {new_users} new users")

Note: many times you'll need to use a channel ID (e.g. C05HP8Z5ZPD), especially if the channel is private. Otherwise, images will not post (only text will).

Posting Plots

Chartsworth can take any PIL Image or Matplotlib Figure and post it to slack. This means you can post plots, images, and anything else you can think of.

from chartsworth import Chartsworth

chartsworth = Chartsworth("C05HP8Z5ZPD")
chartsworth.post("Who's ready for a 🏞️ stream plot? 🧵")

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-3, 3, 100)
y = np.linspace(-3, 3, 100)
X, Y = np.meshgrid(x, y)
u = -1 - X**2 + Y
v = 1 + X - Y**2
speed = np.sqrt(u*u + v*v)

## Create a figure we can pass to Chartsworth ##
fig, ax = plt.subplots()

strm = ax.streamplot(X, Y, u, v, color=speed, linewidth=2, cmap='autumn')
fig.colorbar(strm.lines)

## Post!
chartsworth.post(fig)

Scheduling

Schedule your notebooks on Noteable from the notebooks UI

Or run it with papermill with your own custom scheduling!

Metadata

Release files for chartsworth 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chartsworth 0.12.0
File Size Uploaded
chartsworth-0.12.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chartsworth 0.12.0
File Interpreter ABI Platform
chartsworth-0.12.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / chartsworth-0.12.0.tar.gz

Download URL chartsworth-0.12.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cb4ad07d579a8af4baf6c44797d668dca6aeb549d559b34ad7b8d1c72f535b26
BLAKE2b-256 checksum
How to use checksums
14a2619fbc300ce5154000215290a738bdf4fd465b09dd8246eeac2401dd4c4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.7 Darwin/23.6.0

Release files / chartsworth-0.12.0-py3-none-any.whl

Download URL chartsworth-0.12.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52a25646345f6a8ef1f53fae63eef6b1ca3421f7cebaf25c0d1c0ef1a78827c0
BLAKE2b-256 checksum
How to use checksums
2e5cc4d838b43107d2e9fb9c2303de000829efcbfaa9001aa3c4236e4f6c4ca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.7 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

0.12.0 This release

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page