Skip to main content

My utility functions

Project description

argel1200

argel1200.utilities

A small collection of utility functions that help reduce boilerplate code.

dumps

Wrapper for dumper, to make it eaier to get Perl style Data Dumper output. Assumes you want strings back, and leverages get_variable_name to pull the calling function.

get_variable_name

Helper function used by dumps. Perl's Data::Dumper gives variable_name=value output. This seeks to mimic that.

import_class_from_string

Useful when you need to (or it's just more elegant to) dynamically determine the class based on a string that you are obtaining dynamically at runtime. Useful if you have a base class and multiple subclasses. Very useful if you want to build out your classes as needed (something can just be a base class now, then later on you could create a sub class for it and your script will start loading it as the new sub class automatically)

logging_init

Uses haggis.logs to add two additional "debug" logging levels: 'TRACE' and 'MEMDUMP' and initializes a logging instance if return_logger is True.

open_file

Wrapper for opening a file that provides basic error handling. Get those try blocks out of your script!

process_cli_using_click

Useful if you want to use click in standalone=False mode. Provides basic error handling (required for standalone=False)

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

argel1200-1.0.2.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file argel1200-1.0.2.tar.gz.

File metadata

  • Download URL: argel1200-1.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for argel1200-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a5b6ebe10de30640e23824f27cb7f3aafd569a69cba291ab7180187c8b435bfb
MD5 f94ae70afd7e43b7fa67ab13bbe3d799
BLAKE2b-256 14fb1a522d98f4b3d999b3347da5370b4c26fab6a415133534c5b225f5f41cc9

See more details on using hashes here.

Supported by

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