Package pyboiler

pyboiler's initialization and dynamic importer

Imports all files in src/pyboiler/* so they can be imported as pyboiler.config

Expand source code
"""pyboiler's initialization and dynamic importer

 Imports all files in src/pyboiler/* so they can be imported as
 `pyboiler.config`
"""

import pathlib

__version__ = "0.3.2"
__author__ = "Anonoei <dev@anonoei.com>"
init_run = False


def __init(_val=[]):
    """Import all files in `import_path`"""
    if _val:
        return
    _val.append(True)
    from .config import config
    from .imports import get_imports

    import_path = pathlib.Path(__file__).parent

    # print(f"Running __init on {import_path}")
    for k, v in get_imports(import_path).items():
        globals()[k] = v

    globals()["settings"].Settings().deserialize()


def view():
    """View all available pyboiler imports"""
    __init()
    imports = globals()["imports"].get_locals(globals())
    imports.sort()
    return imports

Sub-modules

pyboiler.changelog
pyboiler.color
pyboiler.config

Script configuration singleton for internal variables …

pyboiler.decor
pyboiler.error

Easy to use custom exceptions …

pyboiler.generic

Generic class implementations that can be extended in user code

pyboiler.hml

XML object (de)serialization in a similar interface to python.json

pyboiler.hson

Wraps python.json methods to utilize the HSONEncoder to encode pyboiler objects and others

pyboiler.imports

Import helpers

pyboiler.internal
pyboiler.logger

Wrap pyboiler.logging in a Singleton for more concrete logging structures …

pyboiler.logging

Threaded logger with color support

pyboiler.platform

Platform specific helpers

pyboiler.profiler

Wrapper for python.profile

pyboiler.settings

pyboiler.settings file

pyboiler.version

Generic semantic versioning class/implementation

Functions

def view()

View all available pyboiler imports

Expand source code
def view():
    """View all available pyboiler imports"""
    __init()
    imports = globals()["imports"].get_locals(globals())
    imports.sort()
    return imports