Skip to main content

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


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.1.tar.gz (79.6 kB view details)

Uploaded Source

Built Distribution

atckit-1.0.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file atckit-1.0.1.tar.gz.

File metadata

  • Download URL: atckit-1.0.1.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

Hashes for atckit-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1e7c9af6324d19fff2aac7d9f644bb6baf7c8fb0d471c32158f0fa2d63a678bf
MD5 cb93ef31db1cb322982fb33bf820254c
BLAKE2b-256 5c7013096e1346c4a1ba522f8f1b6fec760ccdf26db8be885f7e4c9f8d95fb54

See more details on using hashes here.

File details

Details for the file atckit-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: atckit-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for atckit-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 696c25a07a915d5e051642d9ee9e559b3b0b948f6236017a934c6abf0d2c3205
MD5 e825a2caf88417a3e363759436d63e79
BLAKE2b-256 8c585ecc36e9062b8d584f47b3b7a8b2d9a829b94958f3209fd485b577ed901e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page