Module botroyale.util

Common independent functions and values.

Expand source code Browse git
"""Common independent functions and values."""
from pathlib import Path


PROJ_DIR: Path = Path(__file__).parent.parent.parent
"""The project directory root."""
PACKAGE_DIR: Path = PROJ_DIR / "botroyale"
"""The source code directory root."""
INSTALLED_FROM_SOURCE: bool = (PROJ_DIR / "pyproject.toml").is_file()
"""If the package is installed from source code (as opposed to packaged wheel)."""

# Sanity checks
assert PROJ_DIR.is_dir()
assert PACKAGE_DIR.is_dir()
assert (PACKAGE_DIR / "__init__.py").is_file()

Sub-modules

botroyale.util.code

Source code utilities …

botroyale.util.docs

Documentation utility …

botroyale.util.file

Writing, loading, and opening files.

botroyale.util.hexagon

Home of the Hexagon class …

botroyale.util.settings

Manages user settings …

botroyale.util.time

Time utilities.

Global variables

var INSTALLED_FROM_SOURCE : bool

If the package is installed from source code (as opposed to packaged wheel).

var PACKAGE_DIR : pathlib.Path

The source code directory root.

var PROJ_DIR : pathlib.Path

The project directory root.