--- title: Template Configuration formatter keywords: fastai sidebar: home_sidebar nb_path: "nbs/template.config.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

get_params[source]

get_params()

{% endraw %} {% raw %}

identifier_to_displayname[source]

identifier_to_displayname(identifier:str)

{% endraw %} {% raw %}

get_param_config[source]

get_param_config(name, dtype, is_optional, default)

{% endraw %} {% raw %}

create_config[source]

create_config(plugin_cls:type)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

create_plugin_config[source]

create_plugin_config(metadata:"metadata.json of the plugin"=None, tgt_file:"Filename of config file"='config.json')

{% endraw %} {% raw %}
{% endraw %} {% raw %}
class MyPlugin(PluginBase):
    def __init__(self, my_arg: str, my_str: str = None, my_int: int = None, my_float: float = None, unannotated=None, _private = None, **kwargs):
        super().__init__(**kwargs)
    
    def run(self):
        pass
    
    def add_to_schema(self):
        pass
{% endraw %} {% raw %}
config = create_config(MyPlugin)
pprint(config)
Skipping unannotated parameter `unannotated`
[{'data_type': 'Text',
  'default': None,
  'display': 'My Arg',
  'name': 'my_arg',
  'optional': False,
  'type': 'textbox'},
 {'data_type': 'Text',
  'default': None,
  'display': 'My Str',
  'name': 'my_str',
  'optional': True,
  'type': 'textbox'},
 {'data_type': 'Integer',
  'default': None,
  'display': 'My Int',
  'name': 'my_int',
  'optional': True,
  'type': 'textbox'},
 {'data_type': 'Real',
  'default': None,
  'display': 'My Float',
  'name': 'my_float',
  'optional': True,
  'type': 'textbox'}]
{% endraw %}