dialogy.cli package

Submodules

dialogy.cli.project module

manage_project(destination_path, template='dialogy-template-simple-transformers', namespace='vernacular-ai', use_master=False, pretend=False, is_update=False)[source]

Create a new project using scaffolding from an existing template.

This function uses copier’s copy to use an existing template.

An example template is here:.

Parameters
  • destination_path (str) – The directory where the scaffolding must be generated, creates a dir if missing but aborts if there are files already in the specified location.

  • template (str) – Scaffolding will be generated using a copier template project. This is the link to the project.

  • namespace (str, optional) – The user or the organization that supports the template, defaults to “vernacular-ai”

  • vcs_ref (str, optional) – support for building from local git templates optionally, –vcs takes “TAG” or “HEAD”. defaults to None.

Returns

None

Return type

NoneType

project_cli(args)[source]

CLI for project command.

Return type

None

dialogy.cli.workflow module

get_workflow(module, get_workflow_fn, purpose, **kwargs)[source]
Return type

Workflow

train_workflow(args)[source]

Train a workflow.

Return type

None

workflow_cli(args)[source]

CLI entry point for workflows.

args contain the following attributes:

module - We expect the Workflow or its subclass to be available at this path. fn - A function that provides a Workflow or its subclass’ instance. data - Path to dataset (.csv). output_dir - Path where artifacts are expected.

Return type

None

Module contents

This module exposes a command line utility to create project scaffolding. This creates a starting point for any project, an exhibit:

1dialogy create hello-world
2cd hello-world
3poetry install
4make lint

usage: dialogy [-h] [–template TEMPLATE] [–namespace NAMESPACE] [–vcs {HEAD,TAG}] {create,update} project

positional arguments:

{create,update} project A directory with this name will be created at the root of command invocation.

optional arguments:
-h, --help

show this help message and exit

–template TEMPLATE –namespace NAMESPACE

The github/gitlab user or organization name where the template project lies.

–vcs {HEAD,TAG} Download the template’s latest tag (TAG) or master branch (HEAD).

add_project_command_arguments(parser)[source]
Return type

ArgumentParser

add_workflow_command_arguments(parser, objective)[source]
Return type

ArgumentParser

main(command_string=None)[source]

Create project scaffolding cli.

Return type

None

project_command_parser(command_string)[source]
Return type

Namespace