yatr package

Submodules

yatr.base module

exception yatr.base.ValidationError

Bases: exceptions.Exception

yatr.context module

class yatr.context.Context(**kwargs)

Bases: syn.base.b.base.Base

Keyword-Only Arguments:

_skip_validation (default = False): bool envvars: dict (any => basestring) inside (default = ): basestring opts: dict

Class Options:

  • args: ()
  • autodoc: True
  • coerce_args: False
  • id_equality: False
  • init_validate: True
  • make_hashable: False
  • make_type_object: True
  • optional_none: False
  • register_subclasses: False
  • repr_template:
  • coerce_hooks: ()
  • create_hooks: ()
  • init_hooks: ()
  • init_order: ()
  • metaclass_lookup: (‘coerce_hooks’, ‘init_hooks’, ‘create_hooks’, ‘setstate_hooks’)
  • setstate_hooks: ()

Groups:

  • _all: _skip_validation, envvars, inside, opts
  • _internal: _skip_validation
context_name = None
classmethod from_yaml(name, dct)
required_opts = ()
resolve_macros(env, **kwargs)
run = None
run_command(command, env, **kwargs)
validate()

Raise an exception if the object is missing required attributes, or if the attributes are of an invalid type.

verbose(command, env, **kwargs)

yatr.env module

class yatr.env.Env(**kwargs)

Bases: syn.base.b.base.Base, yatr.env.Copyable, yatr.env.Updateable

Keyword-Only Arguments:

captures: dict (any => basestring)
Commands to captures output of
commandline_macros: dict (any => basestring)
Macros defined with -m
contexts: dict (any => Context)
Execution context definitions
declares: set
Declared runtime-defined macros
default_context: Context
Execution context to use if none is specified in task definition
default_task (default = ): basestring
Task to run if no task is specified at the command line
env: dict (any => basestring | int | float | list (basestring | int | float | list | dict) | dict (any => basestring | int | float | list | dict))
Current name resolution environment
files: dict (any => basestring)
File name macros
function_aliases: dict (any => basestring)
Jinja function aliases
jenv: Environment
Jinja2 environment
jinja_filters: dict (any => <callable>)
Custom Jinja2 filters
jinja_functions: dict (any => <callable>)
Custom Jinja2 functions
macros: dict (any => basestring | int | float | list (basestring | int | float | list | dict) | dict (any => basestring | int | float | list | dict))
Macro definitions
secret_values: dict (any => basestring)
Secret value store
settings: dict (any => any)
Global settings of various sorts
tasks: dict (any => Task)
Task definitions

Class Options:

  • args: ()
  • autodoc: True
  • coerce_args: False
  • id_equality: False
  • init_validate: True
  • make_hashable: False
  • make_type_object: True
  • optional_none: False
  • register_subclasses: False
  • repr_template:
  • coerce_hooks: ()
  • create_hooks: ()
  • init_hooks: ()
  • init_order: ()
  • metaclass_lookup: (‘coerce_hooks’, ‘init_hooks’, ‘create_hooks’, ‘setstate_hooks’)
  • setstate_hooks: ()

Groups:

  • _all: captures, commandline_macros, contexts, declares, default_context, default_task, env, files, function_aliases, jenv, jinja_filters, jinja_functions, macros, secret_values, settings, tasks
  • copy_copy: captures, commandline_macros, contexts, declares, env, files, function_aliases, jinja_filters, jinja_functions, macros, secret_values, settings, tasks
  • assign_update: default_context, default_task
  • _internal: function_aliases
  • dict_update: captures, commandline_macros, contexts, env, files, function_aliases, jinja_filters, jinja_functions, macros, secret_values, settings, tasks
  • eq_exclude: jenv
  • set_update: declares
capture_value(cmd, **kwargs)
jinja_filter(name, *args, **kwargs)
jinja_function(name, *args, **kwargs)
macro_env(**kwargs)
resolve(template, **kwargs)
resolve_arg_macros(arg_macros, **kwargs)
resolve_macros(**kwargs)
task(name, *args, **kwargs)
validate()

Raise an exception if the object is missing required attributes, or if the attributes are of an invalid type.

yatr.env_decorators module

yatr.main module

yatr.main.add_argument(parser, *args, **kwargs)
yatr.main.cache_file(infile, outfile, cachedir)
yatr.main.compile_completion_data(path, cachedir, outpath)
yatr.main.data_path_from_yatrfile_path(path, cachedir)
yatr.main.default_data()
yatr.main.dump_bash_completions(args, idx)
yatr.main.expand_paths(opts)
yatr.main.find_bash_completions(args, idx)
yatr.main.find_yatrfile_path(path)
yatr.main.install_bash_completions()
yatr.main.load_completion_data(yatrfile, cachedir)
yatr.main.main()
yatr.main.matches(s, lst)
yatr.main.print_(s, flush=True)
yatr.main.render(doc, infile, outfile)
yatr.main.search_dir(path)
yatr.main.search_rootward(path)

yatr.parse module

class yatr.parse.Document(**kwargs)

Bases: syn.base.b.base.Base

Keyword-Only Arguments:

cachedir (default = ): basestring
Directory to store downloaded files

captures: dict (any => basestring) contexts: dict (any => Context) declares: list (basestring) default_task (default = ): basestring

Task to run if no task is specified at the command line
dirname: basestring
Relative path for includes

env: Env files: dict (any => basestring) imports: list (basestring) includes: list (basestring) macros: dict (any => basestring | int | float | list (basestring | int | float | list | dict) | dict (any => basestring | int | float | list | dict)) pull (default = False): bool

Force-pull URLs

secret_values: dict (any => basestring) secrets: list (basestring) settings: dict (any => any) tasks: dict (any => Task)

Class Options:

  • args: ()
  • autodoc: True
  • coerce_args: False
  • id_equality: False
  • init_validate: True
  • make_hashable: False
  • make_type_object: True
  • optional_none: False
  • register_subclasses: False
  • repr_template:
  • coerce_hooks: ()
  • create_hooks: ()
  • init_hooks: ()
  • init_order: ()
  • metaclass_lookup: (‘coerce_hooks’, ‘init_hooks’, ‘create_hooks’, ‘setstate_hooks’)
  • setstate_hooks: ()

Groups:

  • _all: cachedir, captures, contexts, declares, default_task, dirname, env, files, imports, includes, macros, pull, secret_values, secrets, settings, tasks
  • _internal: env
classmethod from_path(path, **kwargs)
classmethod from_yaml(dct, dirname, **kwargs)
post_process(**kwargs)
process(**kwargs)
process_import(path, **kwargs)
process_include(path, **kwargs)
process_secret(name, **kwargs)
process_settings(**kwargs)
run(name, **kwargs)
validate()

Raise an exception if the object is missing required attributes, or if the attributes are of an invalid type.

yatr.task module

class yatr.task.For(var, in_, **kwargs)

Bases: syn.base.b.base.Base

Positional Arguments:

var: basestring | list (basestring)
The loop variable(s)
in_: basestring | list (basestring | int | list)
Name(s) of list macro(s) to loop over

Class Options:

  • args: (‘var’, ‘in_’)
  • autodoc: True
  • coerce_args: False
  • id_equality: False
  • init_validate: True
  • make_hashable: False
  • make_type_object: True
  • optional_none: False
  • register_subclasses: False
  • repr_template:
  • coerce_hooks: ()
  • create_hooks: ()
  • init_hooks: ()
  • init_order: ()
  • metaclass_lookup: (‘coerce_hooks’, ‘init_hooks’, ‘create_hooks’, ‘setstate_hooks’)
  • setstate_hooks: ()

Groups:

  • _all: in_, var
classmethod from_yaml(dct)
loop(env, **kwargs)
resolve_macros(env, **kwargs)
validate()

Raise an exception if the object is missing required attributes, or if the attributes are of an invalid type.

class yatr.task.Command(command, **kwargs)

Bases: syn.base.b.base.Base

Positional Arguments:

command: basestring | <callable>

Keyword-Only Arguments:

context (default = ): basestring

Class Options:

  • args: (‘command’,)
  • autodoc: True
  • coerce_args: False
  • id_equality: False
  • init_validate: True
  • make_hashable: False
  • make_type_object: True
  • optional_none: False
  • register_subclasses: False
  • repr_template:
  • coerce_hooks: ()
  • create_hooks: ()
  • init_hooks: ()
  • init_order: ()
  • metaclass_lookup: (‘coerce_hooks’, ‘init_hooks’, ‘create_hooks’, ‘setstate_hooks’)
  • setstate_hooks: ()

Groups:

  • _all: command, context
resolve_macros(env, **kwargs)
run(env, **kwargs)
class yatr.task.Task(**kwargs)

Bases: syn.base.b.base.Base

Keyword-Only Arguments:

args: list (basestring | int) commands: list (Command) condition [Optional]: Task condition_type (default = True): bool kwargs: dict (any => basestring | int) loop [Optional]: For

Class Options:

  • args: ()
  • autodoc: True
  • coerce_args: False
  • id_equality: False
  • init_validate: True
  • make_hashable: False
  • make_type_object: True
  • optional_none: True
  • register_subclasses: False
  • repr_template:
  • coerce_hooks: ()
  • create_hooks: ()
  • init_hooks: ()
  • init_order: ()
  • metaclass_lookup: (‘coerce_hooks’, ‘init_hooks’, ‘create_hooks’, ‘setstate_hooks’)
  • setstate_hooks: ()

Groups:

  • _all: args, commands, condition, condition_type, kwargs, loop
classmethod from_yaml(name, dct)
run(env, **kwargs)
run_preview(env, **kwargs)

Module contents