FDL

The FDL class is meant to be an entry point and is a "merge" between a Header class and container class. The Header is created for you based on the arguments you provide at initialisation or you can pass a Header object as an attribute if you wish.

pyfdl.FDL(uuid_=None, version=None, fdl_creator=None, default_framing_intent=None, framing_intents=None, contexts=None, canvas_templates=None)

Bases: Base

header: Header property writable

Returns:
  • Header( Header ) –

    based on attributes

apply_defaults()

Applies default values defined in the defaults attribute to attributes that are None

check_required()

Check that required attributes contain values. Checks linked attributes like: "effective_dimensions.effective_anchor_point" where "effective_anchor_point" is required if "effective_dimensions" is set

Returns:
  • list

    a list of missing attributes

validate()

Validate the current state of the FDL. ID's and relationships between items are checked and values are validated against the json schema.

Raises:
  • FDLValidationError

    if any errors are found

from_dict(raw) classmethod

Create instances of classes from a provided dict.

Parameters:
  • raw (dict) –

    dictionary to convert to supported classes

Returns:
  • cls( Any ) –

    and instance of the current class

to_dict()

Produce a dictionary representation of the current object along with all sub objects.

Raises:
  • FDLError

    if required keys are missing

Returns:
  • dict

    representation of object

load_schema()

Load a jsonschema based on the version in Header or default to current version set in base

Returns:
  • schema( dict ) –

place_canvas_in_context(context_label, canvas)

Place a canvas in a context. If no context with the provided label exist, a new context will be created for you.

Parameters:
  • context_label (str) –

    name of existing or to be created context

  • canvas (Canvas) –

    to be placed in context