jarbin-toolkit

Jarbin-ToolKit Logo

Jarbin-ToolKit — Full API Reference

This document provides a complete technical reference for all public modules, classes, and methods available in Jarbin-ToolKit and its sub-modules.



Table of Contents

  1. Jarbin-ToolKit
    1. Metadata & Environment
    2. Public Functions
    3. API Shortcuts
  2. Sub-Modules
    1. Action Module
    2. Config Module
    3. Error Module
    4. Log Module
    5. Time Module
    6. Console Module
  3. Version Compatibility

  4. LICENSE


Jarbin-ToolKit

Root package exposing all core modules and high-level API shortcuts.


Metadata & Environment

Constants

Public Functions

get_info() -> dict[str, Any]

Returns toolkit metadata.

Example

from jarbin_toolkit import get_info

info = get_info()
print(info["version"])

benchmark(function: Callable, *args, **kwargs) -> tuple[Optional[Any], float, Optional[Exception]]

Benchmarks a function call.

Example

from jarbin_toolkit import benchmark

def slow():
    return sum(range(1000000))

result, elapsed = benchmark(slow)
print(result, elapsed)

fail(message: str = "an error occurred") -> None

Raises a jarbin_toolkit.Error.Error.

Example

from jarbin_toolkit import fail

fail("Critical failure")

text(*args) -> Console.Text.Text

Creates a Text object from given arguments.

Example

from jarbin_toolkit import text

t = text("Hello", "World")
print(t.bold())

API Shortcuts

High-level direct bindings for faster access.

Time

Console Core

Text Formatting

Cursor Control

Line Control



Sub-Modules

Action Module

jarbin_toolkit.Action

Provides structured execution wrappers for callable objects.


Class: Action

Wraps a callable function and allows deferred execution.

Constructor

Action(callable_obj: Callable, *args, **kwargs)

Parameters

Methods

__call__()

Executes the wrapped callable.

from jarbin_toolkit import Action

action = Action.Action("show hello", print, "Hello")
action()
__repr__()

Returns a debug representation of the action.


Class: Actions

Container for multiple Action objects.

Constructor

Actions()

Operators

+ (Add Action)

Adds an Action to the collection.

from jarbin_toolkit import Action
actions = Action.Actions()
actions += Action.Action("show A", print, "A")

actions()
__call__()

Executes all stored actions sequentially.

__len__()

Returns number of stored actions.

__getitem__(index)

Returns action at given index.


Config Module

jarbin_toolkit.Config

INI configuration management with typed accessors.


Class: Config

Constructor

Config(path: str, data: dict | None = None, file_name: str = "config.ini")

Parameters


Core Methods

get(section: str, key: str) -> str

Returns raw string value.

get_int(section: str, key: str) -> int

Returns value as integer.

get_float(section: str, key: str) -> float

Returns value as float.

get_bool(section: str, key: str) -> bool

Returns value as boolean.

set(section: str, key: str, value: Any)

Sets configuration value.

delete()

Deletes configuration file from disk.


Example

from jarbin_toolkit import Config

cfg = Config("./", data={"App" : {"debug" : False}})
cfg.set("App", "debug", True)
debug = cfg.get_bool("App", "debug")
print(debug, type(debug))

Error Module

jarbin_toolkit.Error

Structured error system with optional file/line linking.


Base Class: Error

Constructor

Error(message: str, link: tuple[str, int] | None = None)

Parameters


Derived Errors

All inherit from Error.


Example

from jarbin_toolkit import Error

raise Error.ErrorConfig("Invalid section", link=("config.ini", 42))

Log Module

jarbin_toolkit.Log

Structured logging system supporting .jar-log and JSON formats.


Class: Log

Constructor

Log(path: str, file_name: str = "log", format: str = "jar-log")

Parameters


Methods

log(level: str, title: str, message: str)

Writes structured log entry.

comment(message: str)

Writes comment line.

str_filtered(levels: list[str]) -> str

Returns filtered log entries.

close(delete: bool = False)

Closes file. Deletes if delete=True.


Example

from jarbin_toolkit import Log

log = Log("./", "app")
log.log("INFO", "Start", "Application started")
log.close()
print(log)

Time Module

jarbin_toolkit.Time

Precise timing utilities.


Class: StopWatch

Constructor

StopWatch(start: bool = False)

Methods

start()

Starts timer.

stop()

Stops timer.

reset()

Resets timer.

elapsed() -> float

Returns elapsed seconds.


Comparison Operators


Class: Time

Static time utilities.

Methods

wait(seconds: float) -> float

Waits exact duration and returns elapsed time.

pause(message: str) -> float

Pauses execution until input.


Example

from jarbin_toolkit import Time

watch = Time.StopWatch(True)
Time.Time.wait(2)
print(watch.elapsed())

Console Module

jarbin_toolkit.Console

Advanced terminal rendering system.


Submodules Overview


Console Class

Console.print(*args, **kwargs)

Enhanced print with terminal control.


Animation Module

Provides spinners and progress bars.

Class: ProgressBar

ProgressBar(total: int)
update(value: int)

Updates progress.

render() -> str

Returns formatted progress string.


ANSI Module

ANSI escape sequence utilities.

Common features:


Cursor Module

Cursor manipulation utilities:


Line Module

Line management:


Text Module

Text formatting utilities.

Example:

from jarbin_toolkit import Console

Text = Console.Text.Text
print(Text.bold("Hello"))
my_text = Text("World")
print(my_text.underline())

Setting Module

Console environment configuration and internal settings management.



Version Compatibility

Module Status Stability
Action Released Stable
Config Released Stable
Error Released Stable
Log Released Stable
Time Released Stable
Console Released Stable


License

Jarbin-ToolKit is licensed under GNU GPL (2026).


Last update : API Reference — 2026/02/12