Skip to content

institution

institution

Address

institution address.

building class-attribute

building = attr.ib()

city class-attribute

city = attr.ib()

state class-attribute

state = attr.ib()

street class-attribute

street = attr.ib()

zip_code class-attribute

zip_code = attr.ib()

ComponentType

component type.

code class-attribute

code = attr.ib()

item_list class-attribute

item_list = attr.ib()

name class-attribute

name = attr.ib()

Contact

institution contact.

email class-attribute

email = attr.ib()

phone class-attribute

phone = attr.ib()

web class-attribute

web = attr.ib()

Institution

institution.

address class-attribute

address = attr.ib()

code class-attribute

code = attr.ib()

component_type class-attribute

component_type = attr.ib()

contacts class-attribute

contacts = attr.ib()

id class-attribute

id = attr.ib()

latitude class-attribute

latitude = attr.ib()

longitude class-attribute

longitude = attr.ib()

name class-attribute

name = attr.ib()

supervisor class-attribute

supervisor = attr.ib()

InstitutionList

list of institutions.

institutions class-attribute

institutions = attr.ib(type=list)

Item

institution item.

code class-attribute

code = attr.ib()

id class-attribute

id = attr.ib()

name class-attribute

name = attr.ib()

make_address

make_address(data)

make Address.

Source code in itkdb/models/institution.py
def make_address(data):
    """
    make Address.
    """
    return Address(
        building=data.get("building"),
        city=data.get("city"),
        state=data.get("state"),
        street=data.get("street"),
        zip_code=data.get("zipCode"),
    )

make_component_type

make_component_type(data)

make ComponentType.

Source code in itkdb/models/institution.py
def make_component_type(data):
    """
    make ComponentType.
    """
    return ComponentType(
        name=data["name"],
        code=data["code"],
        item_list=list(map(make_item, data["itemList"])),
    )

make_contacts

make_contacts(data)

make Contact.

Source code in itkdb/models/institution.py
def make_contacts(data):
    """
    make Contact.
    """
    return Contact(
        email=data.get("email"), phone=data.get("phone"), web=data.get("web")
    )

make_institution

make_institution(data)

make Institution.

Source code in itkdb/models/institution.py
def make_institution(data):
    """
    make Institution.
    """
    return Institution(
        address=make_address(data["address"]),
        code=data["code"],
        component_type=list(map(make_component_type, data["componentType"])),
        contacts=make_contacts(data["contacts"]),
        id=data["id"],
        latitude=data["latitude"],
        longitude=data["longitude"],
        name=data["name"],
        supervisor=data["supervisor"],
    )

make_institution_list

make_institution_list(data)

make InstitutionList.

Source code in itkdb/models/institution.py
def make_institution_list(data):
    """
    make InstitutionList.
    """
    return InstitutionList(institutions=list(map(make_institution, data)))

make_item

make_item(data)

make Item.

Source code in itkdb/models/institution.py
def make_item(data):
    """
    make Item.
    """
    return Item(code=data["code"], id=data["id"], name=data["name"])

Last update: April 19, 2023