Examples¶
Serving a reference through an entry provider and validating a record.
from httk.core import standard_entry_type
from httk.data import ReferenceEntryProvider, validate_record
provider = ReferenceEntryProvider({"ref-1": {"title": "A study", "year": "2021"}})
print(list(provider.entry_types()))
validate_record(
standard_entry_type("references"),
{"id": "ref-1", "type": "references", "title": "A study", "year": "2021"},
)
print("record is valid")
['references']
record is valid