NexusBase Module#

nexus.nexus_base.restore_nexus_core_defaults()[source]#
class nexus.nexus_base.NexusCore(*vars, **kwargs)[source]#

Bases: DevBase

Attributes:
working_directory

Methods

append(value)

class_error(message[, header, exit, trace, ...])

Report an error relating to a class.

enter(directory[, changedir, msg])

Have Nexus enter a directory and change its current working directory.

error(message[, header, exit, trace])

Report an error inside a class.

first()

keys()

list(*keys)

log(*texts, **kwargs)

Write output to log file.

open_log(filepath)

save([fpath])

sorted_keys()

warn(msg[, indent])

Warning from inside a Nexus class.

add

add_optional

check_required

check_types

check_types_optional

class_get

class_has

class_items

class_keys

class_log

class_set

class_set_optional

class_set_single

class_warn

clear

close_log

copy

copy_from

copy_to

data_repr

delete

delete_optional

delete_required

dict

dlog

extract

extract_optional

get

get_optional

get_path

get_required

inverse

items

last

leave

list_optional

load

mem_usage

move_from

move_from_optional

move_to

move_to_optional

not_implemented

obj

path_exists

random_key

select_random

serial

set

set_optional

set_path

shallow_copy

tlog

to_dict

to_obj

transfer_from

transfer_to

tree

tuple

values

write

write_end_splash

write_splash

gc = <module 'gc' (built-in)>#
wrote_something = False#
working_directory = None#
wrote_splash = False#
static write_splash()[source]#
static write_end_splash()[source]#
mem_usage()[source]#
log(*texts, **kwargs)[source]#

Write output to log file.

Parameters:
*texts

Strings that will be joined by newlines

nint, kwargs

Spaces to indent

progressbool, kwargs

If True and output is to a terminal, overwrite and update the last line, rather than scrolling.

dlog(*texts, **kwargs)[source]#
tlog(*texts, **kwargs)[source]#
enter(directory: PathLike, changedir: bool = True, msg: str = '')[source]#

Have Nexus enter a directory and change its current working directory.

Parameters:
directoryPathLike

Directory to enter. Can be a str or pathlib.Path object.

changedirbool, default=True

Default of True will change the CWD, setting to False will not change the CWD.

msgstr, optional

Optional message to pass to the output log.

leave()[source]#