miscset

Main module and public API.

Version

The library version can be identified by the version object.

Example code:

import miscset
print(miscset.version)

Result:

0.2.1

Direct Imports

The module imports to all submodules relevant for public usage, so that a direct import is not necessary. This allows:

Example code:

import miscset
print(miscset.sh.run)

Result:

<function run at 0x7fe905537b00>

Logging

Defines a default logging handler as a logging.NullHandler to allow usage of loggers in methods of this package. The handler can be redefined by a custom python module importing methods from miscset and to custom logs:

Example code:

import logging
import miscset

handler = logging.StreamHandler()
logger = logging.getLogger()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)

# this command prints now any debug messages using the log handler specified above
out = miscset.sh.run("echo hello")
print(out)

Result:

CompletedProcess(args='bash -s', returncode=0, stdout='hello\n', stderr='')
shell stdin is echo hello
shell runner is ['bash -s']
shell stdout is 
hello
shell stderr is 
shell return code is 0

Submodules

miscset.dt

Date and time methods.

miscset.files

Methods to work on file systems.

miscset.io

File and other stream i/o methods.

miscset.sh

Shell subprocesses.

miscset.tables

Methods to convert data to and from tables (DataFrames).