A handful of naff extensions that I want to use in most of my bots.
Project description
dis-taipan
50% Dis-Snek features that are either too undercooked for merging into the library proper 50% "application specific" common code I want to use in most of my bots, but don't fit the philosophy of dis-snek itself.
A taipan is a dangerous australian snake. I thought it was mildly amusing.
pip install dis-taipan
Compatibility promises
Where possible, I avoid breaking changes. While internals may change, the public interface will not.
Any features that are upstreamed and integrated into snek proper will be aliased, and still be accessible under the dis_taipan namespace.
I will bump the major version of taipan if I make breaking changes, or if I have to bump the minimum supported Snek version.
Ready-to-Use Scales
dis_taipan.sentry
Sets up a sentry.io hooks, intended to be as simple as possible.
To install, either set an environment variable called SENTRY_TOKEN (I recommend using dotenv), or put a string in the sentry_token attribute of your bot class.
Then call bot.load_extension('dis_taipan.sentry')
to initialize the logger.
dis_taipan.updater
Automatic updater. Makes the following assumptions:
- You deploy using git, and the .git folder exists in production
- You have some kind of health check that will reboot the bot when it shuts down.
To install, call bot.load_extension('dis_taipan.updater')
. It'll do its magic every five minutes.
There is no configuration.
Code Quality things:
Protocols
Protocols are essentially the duck-typing equivelent of ABCs. Think of them like Interfaces from C-like languages.
SendableContext
is a protocol that mimics a Context with SendMixin. Useful when typing error handlers.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dis-taipan-0.3.0.tar.gz
.
File metadata
- Download URL: dis-taipan-0.3.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 068728fd19d671aa3ba3d654e34ca2770e8e6959150c81a7dbbc0e6c8818aff5 |
|
MD5 | 7da8c2b6001a68c018d76234b6b7340f |
|
BLAKE2b-256 | eaffb58adbbbed8dda303b53085dba2126020693bff62a5ce3f136173a6ccff4 |
File details
Details for the file dis_taipan-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: dis_taipan-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf51aba6046f61e515b3ab995b6be65d78aa88014a1ea9610ecff7a76b26a74b |
|
MD5 | afd200da09e0aa3262b72c3bfd48e2e8 |
|
BLAKE2b-256 | c43addc00b1d9b356dc15d11ba0a7c6ab3572a586f8b6fad0bcbf5bdfc7cea56 |