Created
November 1, 2020 16:24
-
-
Save MartinThoma/0938f1b9f37ad7bde4ed39ee3a177384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from typing import List, Mapping | |
from model import Person, PersonId | |
from pydantic import parse_file_as | |
def get_people(filepath: Path) -> Mapping[PersonId, Person]: | |
people = parse_file_as(List[Person], filepath) | |
return {person.id: person for person in people} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment