Skip to main content

NOFUS - Nate's One-File Utilities Stash

Project description

NOFUS: Nate's One-File Utilities Stash


A collection of single purpose classes for common tasks, focusing on simple and straightforward use. Each class can be taken and used individually and requires no external dependencies.


ConfigFile: No Hassle Config File Parser

Example Config:

admin    =
reply_to =

host =
db   = mydbname
user = sqluser
pw   = "secret_passwd"

uri = "ldap://"
uri = "ldap://"
uri = "ldap://"

Example Use:

from nofus import ConfigFile

conf = ConfigFile("/path/to/my.conf")
if not conf.load():
    admin_email = conf.get("email.admin")
    reply_email = conf.get("email.reply_to", default="")

    sqlauth     = conf.get("auth.sql")
    sql_host    = sqlauth.get("host")
    sql_db      = sqlauth.get("db")
    sql_user    = sqlauth.get("user")
    sql_pw      = sqlauth.get("pw")

    ldap_uris   = conf.get_list("auth.ldap.uri")

Logger: Simplified Alternate Logging Interface

Example Use:

from nofus import Logger

# Fast setup, default to logging LOG_DEBUG and higher

# Disable logging

# Set log level
Logger.initialize('/tmp/myfile.log', Logger.LOG_TRACE)

# Check log level
if Logger.is_enabled(Logger.LOG_DEBUG):

# Or Define a custom logger
from nofus import LoggingInterface
class CustomLogger(LoggingInterface):
    def __init__(self, log_file=None, log_level=None):
        if log_level is None:
            log_level = Logger.LOG_LOW
        # Customize your init

    def make_log(self, entry, log_level):
        # Customize your log actions



If all you need is one class, you can just grab a file and throw it in your project.

Or you can install the whole stack using pip:

pip install nofus


NOFUS is covered by the Simplified BSD License.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nofus, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size nofus-0.1.2-py3-none-any.whl (13.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size nofus-0.1.2.tar.gz (12.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page