Skip to main content

A collection of core functions for tool script writing

Project description

cjnfuncs - A framework and collection of utility functions for script writing

cjnfuncs is comprised of several modules (follow links to respective documentation)

NOTE: Since relative links to other .md files do not work on PyPI, please go to the cjnfuncs GitHub repo to read the documentation.

module Description/Purpose
core Set up the base environment
configman Feature-rich configuration file toolset
timevalue Handle time values with units, such as '5m' (5 minutes)
mungePath Ease-of-use pathlib extension for constructing and manipulating file paths
deployfiles Push bundled setup files within a package to the proper user/system locations
resourcelock Inter-process resource lock mechanism
SMTP Send notification and email messages

Developed and tested on Python 3.6.8, and supported on all higher Python versions. Developed on Linux. Not supported on Windows (posix-ipc module dependency).

In this documentation, "tool script" refers to a Python project that imports and uses cjnfuncs. Some may be simple scripts, and others may themselves be installed packages.


Installation and usage

pip install cjnfuncs

A package template using cjnfuncs is available at https://github.com/cjnaz/tool_template, which is the basis of PyPI posted tools such as:

Project repo: https://github.com/cjnaz/cjnfuncs


Revision history

  • 2.5 250206 - Added multi-line and quoted string support to configman
  • 2.4.1 241118 - resource_lock only init lock_info if not existing
  • 2.4 241105 - Twilio support in snd_notif, resource_lock trace/debug features, check_path_exists exception fix
  • 2.3 240821 - Added mungePath ./ support. Resolved check_path_exists() memory leak. Added same_process_ok to resourcelock.getlock() Added prereload_callback to config_item.loadconfig()
  • 2.2 240119 - Added SMTP DKIM support. Set SMTP server connect timeout to EmailRetryWait.
  • 2.1 240104 - Partitioned to separate modules. Added modify_configfile. Added native support for float, list, tuple, and dict in loadconfig(). Added getcfg() type checking. Documentation touch for logging formats in config file. Improved snd_notif failure logging. Added email/notif send retries. Added resourcelock module.
  • 2.0.1 230222 - deploy_files() fix for files from package
  • 2.0 230208 - Refactored and converted to installed package. Renamed funcs3 to cjnfuncs.
  • ...
  • 0.1 180524 - New. First github posting

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

cjnfuncs-2.5.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cjnfuncs-2.5-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file cjnfuncs-2.5.tar.gz.

File metadata

  • Download URL: cjnfuncs-2.5.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cjnfuncs-2.5.tar.gz
Algorithm Hash digest
SHA256 b5a419f31eb859cda5fa7b6b653b9107909744084d8ec6a064cae3bb51f75823
MD5 4528e1b19e992e2623a84d85fd5cdcec
BLAKE2b-256 1826cd51e2001717bfb49833b24d6949b7f20fb9b541251b5a444e5236db9d5c

See more details on using hashes here.

File details

Details for the file cjnfuncs-2.5-py3-none-any.whl.

File metadata

  • Download URL: cjnfuncs-2.5-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cjnfuncs-2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7eae2d453d1f020fce400cda2bd3dcabfa6d8b4fcd654a2c58f43c5c02d675d4
MD5 7705b89ce3036f72fbfd5fe6f16a054a
BLAKE2b-256 4e004be1e7c4eb08dd44804d51a40d514434c0436ccc818363e1cb5fd6bf203c

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