bpod_core.misc

Miscellaneous tools that don’t fit the other categories.

Functions

convert_to_snake_case

Convert a given string to snake_case.

get_local_ipv4

Determine the primary local IPv4 address of the machine.

get_nested

Retrieve a value from a nested dict using a Sequence of keys.

sanitize_string

Replace non-alphanumeric characters in a string with a given substitute.

set_nested

Set a value in a nested dict, creating intermediate dicts as needed.

suggest_similar

Suggest a similar valid string based on the given invalid string.

Classes

SettingsDict

Represents a dictionary-like persistent settings storage.

ValidatedDict

A dict-like container with runtime validation for keys and values.