Module src.jsonid.lookup

Provide lookup functions for the registry.

Functions

def lookup_entry(ref: str)
Expand source code
def lookup_entry(ref: str):
    """Provides lookup functions for JSONID to simplify results output."""
    if ref not in registry.REGISTERED:
        ref = ref.lower()
        reg = registry_data.registry()
        for item in reg:
            if ref != item.identifier:
                continue
            print(item)
            return
        logger.error("registry lookup for ref '%s': no entry found", ref)
        return
    if ref == registry.DOCTYPE_JSON:
        print(registry.JSON_ONLY)
        return
    if ref == registry.DOCTYPE_JSONL:
        print(registry.JSONL_ONLY)
        return
    if ref == registry.DOCTYPE_YAML:
        print(registry.YAML_ONLY)
        return
    if ref == registry.DOCTYPE_TOML:
        print(registry.TOML_ONLY)
        return

Provides lookup functions for JSONID to simplify results output.