Bubble 2016.08.16

bubble package

«  bubble   ::   Contents   ::   bubble.clients package  »

bubble package

Submodules

bubble.cli module

class bubble.cli.BubbleCli(home=None, verbose=0, verbose_bar=100)[source]

Bases: bubble.Bubble

the Bubble for the Command Line Interface,

this the bubble to be passed around as the ‘ctx’ for the cli commands

say(msg, verbosity=1, stuff=None)[source]
say_green(msg, verbosity=0, stuff=None)[source]
say_red(msg, verbosity=0, stuff=None)[source]
say_yellow(msg, verbosity=0, stuff=None)[source]
set_config(key, value)[source]
class bubble.cli.ComplexCLI(name=None, invoke_without_command=False, no_args_is_help=None, subcommand_metavar=None, chain=False, result_callback=None, **attrs)[source]

Bases: click.core.MultiCommand

get_command(ctx, name)[source]
list_commands(ctx)[source]
bubble.cli.make_gbc(verbose, verbose_bar)[source]

bubble.functions module

rule functions, these can be attached to rules and run by the rule

class bubble.functions.NoRuleFunction(name=None)[source]

Bases: bubble.Bubble

fun = None
fun_type = None
name = None
no_fun(*a)[source]
run(*a)[source]
stats = None
class bubble.functions.RuleFunction(name=None, fun=None, fun_type=None, verbose=1)[source]

Bases: bubble.Bubble

fun = None
fun_type = None
name = None
run(*a)[source]
stats = None
class bubble.functions.RuleFunctions[source]

Bases: bubble.Bubble

add_custom_function(fun=None, name=None, fun_type='custom')[source]
add_function(fun=None, name=None, fun_type='system')[source]

actually replace function

function_exists(fun)[source]

get function’s existense

functions_count()[source]

get number of functions

get_function(fun=None)[source]

get function as RuleFunction or return a NoRuleFunction function

get_rule_functions()[source]
rule_function_not_found(fun=None)[source]

any function that does not exist will be added as a dummy function that will gather inputs for easing into the possible future implementation

bubble.functions.get_registered_rule_functions()[source]

get the function registry

bubble.functions.load_custom_functions(ctx, custom_rule_functions_py='./custom_rule_functions.py')[source]
bubble.functions.timer(fun, *a, **k)[source]

define a timer for a rule function for log and statistic purposes

bubble.functions.trace(fun, *a, **k)[source]

define a tracer for a rule function for log and statistic purposes

bubble.functions_system module

system rule functions which are predefined for generic usage

bubble.functions_system.isin(sub, string)[source]
bubble.functions_system.set_kv(k, v, stuff)[source]
bubble.functions_system.slicing(slicable, start=0, stop=-1, step=1)[source]

bubble.metadata module

Project metadata

Information describing the project.

bubble.rules module

bubble rules have a simple notation, with a line based rule format and a single rule definitions seperator “>>>” every line starting and ending with the rule separator, becomes a rule for the bubble transformer. anything else is treated as comment.

class bubble.rules.Rule(input=None, output=None, fun=None, depend=None, name=None, src_nr=0)[source]

Bases: bubble.Bubble

depend = []
fun = None
input = None
output = None
run(*a)[source]
src_nr = 0
class bubble.rules.Rules(rules=None, rule_type='bubble', home='', verbose=0)[source]

Bases: bubble.Bubble

get_rules()[source]
has_rules()[source]

bubble.transformer module

the bubble transformer takes a dictionary and applies transforming rules(with functions) and returns the resulting dictionary.

class bubble.transformer.Transformer(rules=None, rule_type='bubble', store={}, config={}, bubble_path=None, verbose=1)[source]

Bases: bubble.Bubble

all_conds(conditions)[source]
create_ak(keys, indict, tempdict, outdict, storeddict, cfgdict)[source]
get_store()[source]
key_path(data, path)[source]
key_path_exists(data, path)[source]
name = None
set_key_path(data, path, value)[source]
transform(indict)[source]

Module contents

class bubble.Bubble(name='NoName', verbose=0, verbose_bar=1, parent=None, logfile='', statistics=False)[source]

Bases: object

puts a tiny bubble of reality into existence

adaptive_verbose = True
add_child(child=None)[source]
birth = None
cry(msg='Crying', stuff=None, verbosity=1)[source]
debug = False
get_total_verbose()[source]
get_total_verbose_bar()[source]
get_verbose()[source]
get_verbose_bar()[source]
home = None
mumble(msg='Mumbling', stuff=None, verbosity=1)[source]
name = None
say(msg='Saying', stuff=None, verbosity=1)[source]
set_parent(parent=None)[source]
set_verbose(verbose=0)[source]
set_verbose_bar(verbose_bar=0)[source]
tl_from_child(exported_timeline=[])[source]
verbose_minus(amount=1)[source]
verbose_plus(amount=1)[source]

«  bubble   ::   Contents   ::   bubble.clients package  »