@plac.annotations(<EOL>model=("<STR_LIT>", "<STR_LIT>", None, str),<EOL>markdown=("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", str),<EOL>silent=("<STR_LIT>", "<STR_LIT>", "<STR_LIT:s>"),<EOL>)<EOL>def info(model=None, markdown=False, silent=False):
msg = Printer()<EOL>if model:<EOL><INDENT>if util.is_package(model):<EOL><INDENT>model_path = util.get_package_path(model)<EOL><DEDENT>else:<EOL><INDENT>model_path = util.get_data_path() / model<EOL><DEDENT>meta_path = model_path / "<STR_LIT>"<EOL>if not meta_path.is_file():<EOL><INDENT>msg.fail("<STR_LIT>", meta_path, exits=<NUM_LIT:1>)<EOL><DEDENT>meta = srsly.read_json(meta_path)<EOL>if model_path.resolve() != model_path:<EOL><INDENT>meta["<STR_LIT>"] = path2str(model_path)<EOL>meta["<STR_LIT:source>"] = path2str(model_path.resolve())<EOL><DEDENT>else:<EOL><INDENT>meta["<STR_LIT:source>"] = path2str(model_path)<EOL><DEDENT>if not silent:<EOL><INDENT>title = "<STR_LIT>".format(model)<EOL>model_meta = {<EOL>k: v for k, v in meta.items() if k not in ("<STR_LIT>", "<STR_LIT>")<EOL>}<EOL>if markdown:<EOL><INDENT>print_markdown(model_meta, title=title)<EOL><DEDENT>else:<EOL><INDENT>msg.table(model_meta, title=title)<EOL><DEDENT><DEDENT>return meta<EOL><DEDENT>data = {<EOL>"<STR_LIT>": about.__version__,<EOL>"<STR_LIT>": path2str(Path(__file__).parent.parent),<EOL>"<STR_LIT>": platform.platform(),<EOL>"<STR_LIT>": platform.python_version(),<EOL>"<STR_LIT>": list_models(),<EOL>}<EOL>if not silent:<EOL><INDENT>title = "<STR_LIT>"<EOL>if markdown:<EOL><INDENT>print_markdown(data, title=title)<EOL><DEDENT>else:<EOL><INDENT>msg.table(data, title=title)<EOL><DEDENT><DEDENT>return data<EOL>
Print info about spaCy installation. If a model shortcut link is
speficied as an argument, print model information. Flag --markdown
prints details in Markdown for easy copy-pasting to GitHub issues.