Project Generator

Overview

The ProjectGenerator is a wrapper for all other generators, and will generate a complete project folder, with subfolders for jsonschema, python, etc

Docs

Command Line

gen-project

Generate an entire project LinkML schema

Generate all downstream artefacts using default configuration:

Exclusion lists: all except ShEx:

Inclusion lists: only jsonschema and python:

Configuration, on command line:

Configuration, via yaml file:

config.yaml:

Both together: -A is layered over the file setting by setting, so naming one setting on the command line keeps the rest of that generator’s settings from the file.

gen-project [OPTIONS] YAMLFILE

Options

-d, --dir <dir>

directory in which to place generated files. E.g. linkml_model, biolink_model

-A, --generator-arguments <generator_arguments>

yaml configuration for generators

-C, --config-file <config_file>

path to yaml configuration

-X, --exclude <exclude>

list of artefacts to be excluded

-I, --include <include>

list of artefacts to be included. If not set, defaults to all

--mergeimports, --no-mergeimports

Merge imports into source file

Default:

True

--log_level <log_level>

Logging level

Default:

'WARNING'

Options:

CRITICAL | ERROR | WARNING | INFO | DEBUG

-V, --version

Show the version and exit.

Arguments

YAMLFILE

Required argument

Code

class linkml.generators.projectgen.ProjectGenerator[source]

Generates complete project folders

Note this doesn’t conform to overall generator framework, as it is a meta-generator

static generate(schema_path: str, config: ~linkml.generators.projectgen.ProjectConfiguration = ProjectConfiguration(directory='tmp', generator_args=defaultdict(<class 'dict'>, {}), includes=None, excludes=None, mergeimports=None))[source]

Generate every configured artefact for schema_path under config.directory.

Parameters:
  • schema_path – Path to the schema to generate from.

  • config – What to generate and how. Checked before use, so a configuration built by hand reports its own mistakes rather than failing part-way through.

Raises:

ValueError – if any part of config has the wrong shape.