Jupyterpost:Mattermost服务的Jupyterhub
项目描述
Jupyterpost:从Jupyterhub向Mattermost服务器发送消息
安装
pip install jupyterpost
启用jupyterpost
- 在您的Mattermost服务器上创建一个机器人用户并获取其令牌。
- 在您的Jupyterhub配置文件末尾添加以下内容。
from jupyterpost import configure_jupyterhub
configure_jupyterhub(
c,
mattermost_token="your mattermost token",
mattermost_url="https://your.mattermost.server/api/v4/",
mattermost_team="your mattermost team name",
jupyterpost_url="https://services.your.jupyterhub/services/jupyterpost",
)
这将
- 向您的Jupyterhub添加一个新的服务
jupyterpost
- 允许所有用户及其服务器访问此服务
- 将服务URL作为环境变量
JUPYTERPOST_URL
提供给用户的服务器
该函数有些脆弱,但应该适用于标准的Jupyterhub安装。
使用jupyterpost
from jupyterpost import post
from matplotlib import pyplot
pyplot.plot([0, 1])
post(
message="Check out my plot",
channel="my-channel", # Or "@username"
attachment=pyplot.gcf(), # Or png bytes
)
从Jupyterhub外部发送
- 从您的Jupyterhub服务器获取变量
JUPYTERPOST_URL
和JPY_API_TOKEN
。 - 将它们提供给
jupyterpost.post
作为附加参数,并从任何地方连接!
贡献
欢迎贡献!请打开一个问题或拉取请求。
特别希望支持更多的聊天服务和更多的发送消息的方式。
测试也会很棒。
关闭
jupyterpost-0.0.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | f24f5278b071b30bbf7201612d1e08edae7bef7a049ea68d70ec36573397f37f |
|
MD5 | 1f8258dc7e580eba2b92d1183e564707 |
|
BLAKE2b-256 | cb80d3d089c4e78b1a5acc35a40b67c1d9d072308bb75fd2a657aebdc03991f6 |
关闭
jupyterpost-0.0.1-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0a99ca45e700cb2f41c3185cb6278b48265a58412422f4c6f0ab1921a15cd846 |
|
MD5 | 53b195b8cbf412631c9a6038d562d36e |
|
BLAKE2b-256 | 0d3b1363b68920fad4bca49b8d52369c7af4a3844eaaa56c962d3f64999e6412 |