chartsworth


Namechartsworth JSON
Version 0.10.0 PyPI version JSON
download
home_page
Summary
upload_time2023-09-06 21:35:28
maintainer
docs_urlNone
authorKyle Kelley
requires_python>3.9,<3.12
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Chartsworth

<img src="https://platform.noteable.io/assets/images/chartsworth-transparent-2c87330667262616380db0fde5fbbcb6.png" height=100 />

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](https://platform.noteable.io/blog/chart-monsters-for-slack).

### 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](https://api.slack.com/apps) and [learn more about creating a new slack app in the chartsworth post](https://platform.noteable.io/blog/chart-monsters-for-slack#set-a-chart-monster-up-as-a-slack-app).

<img src="https://platform.noteable.io/assets/images/api.slack.com_set-display-information-3adccf9876820585b8cedd02341ad75e.png" height=300 />

### Usage

```python
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.

```python
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

![](https://platform.noteable.io/assets/images/schedule-notebook-5afa67c7271d81c89287f869b50ec003.gif)

Or run it with [papermill](https://github.com/nteract/papermill) with your own custom scheduling!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "chartsworth",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">3.9,<3.12",
    "maintainer_email": "",
    "keywords": "",
    "author": "Kyle Kelley",
    "author_email": "rgbkrk@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/00/24/ae414d26c61856cedbc4133ba1326874fabebcb774ecf1fe561412ad1610/chartsworth-0.10.0.tar.gz",
    "platform": null,
    "description": "## Chartsworth\n\n<img src=\"https://platform.noteable.io/assets/images/chartsworth-transparent-2c87330667262616380db0fde5fbbcb6.png\" height=100 />\n\nChartsworth posts from **notebooks** to **slack**. This little metric monster lets you post plots, images, and anything else the slack sdk will let you post.\n\nRead more background and workflows around scheduling in the [Notebook Reporting with Chart Monsters Post](https://platform.noteable.io/blog/chart-monsters-for-slack).\n\n### Installation and Setup\n\n```\npip install chartsworth\n```\n\nSet environment variable `CHARTSWORTH_TOKEN` to your Slack App. You can create a new Slack App [Create a new Slack App](https://api.slack.com/apps) and [learn more about creating a new slack app in the chartsworth post](https://platform.noteable.io/blog/chart-monsters-for-slack#set-a-chart-monster-up-as-a-slack-app).\n\n<img src=\"https://platform.noteable.io/assets/images/api.slack.com_set-display-information-3adccf9876820585b8cedd02341ad75e.png\" height=300 />\n\n### Usage\n\n```python\nfrom chartsworth import Chartsworth\nchartsworth = Chartsworth(\"#chartsy\")\n\nnew_users = 11_003\nchartsworth.post(f\"We have {new_users} new users\")\n```\n\nNote: 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).\n\n### Posting Plots\n\nChartsworth 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.\n\n```python\nfrom chartsworth import Chartsworth\n\nchartsworth = Chartsworth(\"C05HP8Z5ZPD\")\nchartsworth.post(\"Who's ready for a \ud83c\udfde\ufe0f stream plot? \ud83e\uddf5\")\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nx = np.linspace(-3, 3, 100)\ny = np.linspace(-3, 3, 100)\nX, Y = np.meshgrid(x, y)\nu = -1 - X**2 + Y\nv = 1 + X - Y**2\nspeed = np.sqrt(u*u + v*v)\n\n## Create a figure we can pass to Chartsworth ##\nfig, ax = plt.subplots()\n\nstrm = ax.streamplot(X, Y, u, v, color=speed, linewidth=2, cmap='autumn')\nfig.colorbar(strm.lines)\n\n## Post!\nchartsworth.post(fig)\n```\n\n### Scheduling\n\nSchedule your notebooks on Noteable from the notebooks UI\n\n![](https://platform.noteable.io/assets/images/schedule-notebook-5afa67c7271d81c89287f869b50ec003.gif)\n\nOr run it with [papermill](https://github.com/nteract/papermill) with your own custom scheduling!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.10.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "00f916b444fc2cf05c1a525bbe1d603fd74d34270be07e835abc22f8ce6a82e1",
                "md5": "651813c4c5af361891644cc5fa858205",
                "sha256": "57da7de80475f105bbb2a4d3e2058e19c8a05e9fd5a9cc9a641f9367b56624b6"
            },
            "downloads": -1,
            "filename": "chartsworth-0.10.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "651813c4c5af361891644cc5fa858205",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">3.9,<3.12",
            "size": 5349,
            "upload_time": "2023-09-06T21:35:26",
            "upload_time_iso_8601": "2023-09-06T21:35:26.696920Z",
            "url": "https://files.pythonhosted.org/packages/00/f9/16b444fc2cf05c1a525bbe1d603fd74d34270be07e835abc22f8ce6a82e1/chartsworth-0.10.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0024ae414d26c61856cedbc4133ba1326874fabebcb774ecf1fe561412ad1610",
                "md5": "4cf42ea55758146d81dc3c6dca139e7d",
                "sha256": "aef02140df67dd2f2321538d582990b6ceac70693f838537487bde435bd6b03c"
            },
            "downloads": -1,
            "filename": "chartsworth-0.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4cf42ea55758146d81dc3c6dca139e7d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">3.9,<3.12",
            "size": 4567,
            "upload_time": "2023-09-06T21:35:28",
            "upload_time_iso_8601": "2023-09-06T21:35:28.383901Z",
            "url": "https://files.pythonhosted.org/packages/00/24/ae414d26c61856cedbc4133ba1326874fabebcb774ecf1fe561412ad1610/chartsworth-0.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-06 21:35:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "chartsworth"
}
        
Elapsed time: 0.11137s