DEADBEATS
An easy to use Slack messaging library for research.
Usage
from deadbeats import DEADBEATS
# set environment variables as below
# SLACK_ACCESS_TOKEN=xxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx (Get your own Slack API access token)
# SLACK_CHANNEL_ID=deadbeats (set slack channel id whatever you like!)
# or you can set configurations manually.
DEADBEATS.set_access_token("SLACK_ACCESS_TOKEN")
DEADBEATS.set_channel_id("SLACK_CHANNEL_ID")
# `DEADBEATS.wrap` sends a message at the beginning and the end of the wrapped function.
# `DEADBEATS.wrap` catch every errors and raise it after sending a error message.
@DEADBEATS.wrap
def main():
# A simple "heartbeating" message.
DEADBEATS.ping()
# Start threading!
# All subsequent messages will be sent to the thread.
DEADBEATS.start_thread()
# You can add extra information like below.
params = {"loss": 0.5, "val_loss": 1.6, "acc": 100.0}
DEADBEATS.ping(text="message whatever you like", params=params, additional="info", huga="huga")
# If you want to stop threading, you can use this method.
# This method reset "thread_ts" of a instance variable, which is a id of thread.
DEADBEATS.reset_thread()
With PyTorch Lightning
from deadbeats import DEADBEATS
class MyModel(pl.LightningModule):
...
def on_train_start(self):
DEADBEATS.start_thread()
...
def validation_epoch_end(self, outputs):
avg_loss = torch.stack([x['val_loss'] for x in outputs]).mean()
DEADBEATS.ping(val_loss = avg_loss, current_epoch = self.current_epoch)
return {'val_loss': avg_loss}
...
# custom training function
@DEADBEATS.wrap
def fit(self, trainer):
trainer.fit(self)
messages like below
This library is named after the wonderful work of Mori Calliope, DEAD BEATS, and inspired by hugginface/knockknock.
Metadata
Release files for deadbeats 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deadbeats-0.4.0.tar.gz | 4.0 kB | Without provenance | Details for deadbeats-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deadbeats-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for deadbeats-0.4.0-py3-none-any.whl |
Total release size: 8.2 kB
Release files / deadbeats-0.4.0.tar.gz
| Download URL | deadbeats-0.4.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
735f738bf4795513ee32715b26c4d4712867918219ffe339b79cbd9639911538
|
|
BLAKE2b-256 checksum How to use checksums |
9a70232b677cd5f422afda178e4583dcc0c720a5216a3e38ff28b3a5265ccdbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.8.2 Darwin/19.6.0
|
Release files / deadbeats-0.4.0-py3-none-any.whl
| Download URL | deadbeats-0.4.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23df9b87211ac46ff900121138bf378defa0118cfa4febba1e7276e79003db1b
|
|
BLAKE2b-256 checksum How to use checksums |
bd3d0dbf3589f37c3ff50e183f3465f302e9c53c921b5ea47f5b14f5423b6d39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.8.2 Darwin/19.6.0
|
Security for deadbeats 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.