Add docstring and todo note

This commit is contained in:
ines 2017-04-16 22:14:45 +02:00
parent 5c5f8c0a72
commit 97647c46cd

View File

@ -107,6 +107,13 @@ def read_json(location):
def parse_package_meta(package_path, package, require=True):
"""
Check if a meta.json exists in a package and return its contents as a
dictionary. If require is set to True, raise an error if no meta.json found.
"""
# TODO: Allow passing in full model path and only require one argument
# instead of path and package name. This lets us avoid passing in an awkward
# empty string in spacy.load() if user supplies full model path.
location = package_path / package / 'meta.json'
if location.is_file():
return read_json(location)