SchemaLoaderWiki

class SchemaLoaderWiki(filename, schema_as_string=None)[source]

Loads MediaWiki schemas from filenames or strings.

Expected usage is SchemaLoaderWiki.load(filename)

SchemaLoaderWiki(filename) will load just the header_attributes

Methods

hed.schema.schema_io.wiki2schema.SchemaLoaderWiki.__init__(...)

Loads the given schema from one of the two parameters.

hed.schema.schema_io.wiki2schema.SchemaLoaderWiki.load([...])

Loads and returns the schema, including partnered schema if applicable.

Attributes

hed.schema.schema_io.wiki2schema.SchemaLoaderWiki.schema

The partially loaded schema if you are after just header attributes.

SchemaLoaderWiki.__init__(filename, schema_as_string=None)[source]

Loads the given schema from one of the two parameters.

Parameters:
  • filename (str or None) – A valid filepath or None

  • schema_as_string (str or None) – A full schema as text or None

classmethod SchemaLoaderWiki.load(filename=None, schema_as_string=None)

Loads and returns the schema, including partnered schema if applicable.

Parameters:
  • filename (str or None) – A valid filepath or None

  • schema_as_string (str or None) – A full schema as text or None

Returns:

The new schema

Return type:

schema(HedSchema)

SchemaLoaderWiki.schema

The partially loaded schema if you are after just header attributes.