7. API Documentation¶
7.1. API Proper¶
- class bordered(text, width=160)¶
Create a fancy bordered textbox as used in
Aspidites.api.Warn
.- Return type
- class Warn(stack, func, *args, **kwargs)¶
Creates a nice human-readable warning with a fancy border.
7.2. Compiler¶
- class CheckedFileStack(initial=None, pre_size=128)¶
A convenience class for reading and checksumming file data streams.
- create_file(fname, mode, root='', text='# THIS FILE IS GENERATED BY ASPIDITES v1.16.1 - DO NOT EDIT #')¶
API for creating and registering checked files
- Return type
- register(fname)¶
Registers a filename to a checksum of its contents.
- class CompilerArgs(**kwargs)¶
code:
pyparsing.ParseResults
fname:
pathlib.Path
force:
bool
bytecode:
bool
build_requires:
typing.Union[typing.List, str]
verbose
int
embed:
typing.Union[str, None]
- class Compiler(compile_args)¶
- Parameters
compile_args (Aspidites.api.compiler.CompilerArgs) –
7.3. Monads¶
- class Maybe(func, *args, **kwargs)¶
Sandboxes a function call and handles Exceptions by returning an instance of
Aspidites.math.Undefined
- __call__(warn_undefined=True)¶
Call self as a function.
7.4. Math¶
- class Undefined(func=None, *args, **kwargs)¶
A monad for a failed programmatic unit; like NoneType but hashable. Falsy singleton acts as an absorbing element for division.
- __init__(func=None, *args, **kwargs)¶
- __new__(**kwargs)¶
- SafeDiv(a, b)
- SafeExp(a, b)
- SafeFactorial(a)
- SafeFloorDiv(a, b)
- SafeMod(a, b)
- SafeUnaryAdd(a)
- SafeUnarySub(a)