AccidentallyTheCable's Utility Kit
Project description
ATCKit
AccidentallyTheCable's Utility Kit
About
This is a small kit of classes, util functions, etc that I found myself rewriting or reusing frequently, and instead of copying everywhere, they are now here.
How does it work?
Do the needfuls.... do the needful dance
Literally, import whatever you need to use..
Usage
FunctionSubscriber
A Class container for Function callback subscription via +=
or -=
. Functions can be retrieved in order of addition.
subscriber = FunctionSubscriber()
def a():
print("I am a teapot")
def b():
print("I am definitely totally not also a teapot, I swear")
subscriber += a
subscriber += b
for cb in subscriber.functions:
cb()
>> I am a teapot
>> I am definitely totally not also a teapot, I swear
UtilFuncs
A Class containing various static methods:
- scan_dir: Search a specified Path, and execute a callback function on discovered files.
- Allows exclusion of Files/Dirs via regex pattern matching
- deep_sort: Sort a Dictionary recursively, including through lists of dicts
- check_pid: Check if a process ID exists (via kill 0)
- register_signals: Register Shutdown / Restart Handlers
- Check for Shutdown via UtilFuncs.shutdown (bool)
- Check for Restart via UtilFuncs.restart (bool)
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
atckit-1.0.0.tar.gz
(79.6 kB
view details)
Built Distribution
atckit-1.0.0-py3-none-any.whl
(14.2 kB
view details)
File details
Details for the file atckit-1.0.0.tar.gz
.
File metadata
- Download URL: atckit-1.0.0.tar.gz
- Upload date:
- Size: 79.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98413e88d2b68229511e8caf88e9a33a96de9ffda9e42130616a470f7b19394f |
|
MD5 | 65e46c7f776d29db09af7b27580a41ee |
|
BLAKE2b-256 | 78da06447ad2ee138ef82897616b1f7c876fced5a2dd2614e40f45dda90bde24 |
File details
Details for the file atckit-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: atckit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d9c15f0ce6af8979d5897077c8c745e93c6ab5d85470f88d3dd1b7964ffe76d |
|
MD5 | 2c4620a3590186f8fe41bcdfd6c6fec5 |
|
BLAKE2b-256 | 20774fa0c23d80446e023c0558edf6ffe234e4c22d83525ef5e1ade99ea9b0bb |