There's a preference to not need a separate function (e.g. yaml.load vs yaml.loads), but if it's the only way, that's fine.
PR 120 attempts to address this, but I don't like how it designates a file vs a string by the presence of a file header. I think it should be something like if os.exists(filename), then parse file, otherwise try to parse string as raml.
My preference would be separate functions. The caller should know what they have; a YAML syntax error on what was expected to be a path is likely to confuse an end user.
Like in pyyaml's
yaml.loads
,ramlfication.parse
should be able to take a string of raml format, e.g.There's a preference to not need a separate function (e.g.
yaml.load
vsyaml.loads
), but if it's the only way, that's fine.PR 120 attempts to address this, but I don't like how it designates a file vs a string by the presence of a file header. I think it should be something like if os.exists(filename), then parse file, otherwise try to parse string as raml.