Yaml configuration


Yaml configuration#

pyCIF can be entirely set up with a Yaml file such as in the example below. The basic idea of Yaml syntax is that you can easily define a tree structure using ‘:’ and indentation, which would be automatically interpreted by Python.

Please note that Yaml is flexible with the keys it accepts for booleans. The following keys will be automatically accepted as True or False:

y / Y / yes / Yes / YES / n / N / no / No / NO / true / True / TRUE / false / False / FALSE / on / On / ON / off / Off / OFF

Basic concept#

For instance, the following Yaml syntax:

   branch1: grub
   branch2: [0, 1]
      subbranch0: some text
      subbranch1: 2004-01-01
      subbranch2: T

will be interpreted into the following Python dictionary:

   'branch1': 'grub',
   'branch2': [0,1],
      'subbranch0': 'some text',
      'subbranch1': datetime.datetime(2004, 01, 01),
      'subbranch2': True

which is itself loaded into a pyCIF plugin automatically integrated with other plugins and dependencies.

Further examples about the Yaml syntax can be found here.