Exemple #1
0
def generate_student() -> dict:
    """Generate a student record."""
    person = Person()

    student = {
        "academic_degree": person.academic_degree(),
        "age": person.age(),
        "full_name": person.full_name(),
        "gender": person.gender(),
        "nationality": person.nationality(),
        "university": person.university(),
    }

    return student
Exemple #2
0
    def person(
        cls,
        *,
        locale=Locales.EN,
        qualification=None,
        age=None,
        blood_type=None,
        email=None,
        first_name=None,
        last_name=None,
        gender=None,
        height=None,
        id=None,
        language=None,
        nationality=None,
        occupation=None,
        phone=None,
        title=None,
        university=None,
        weight=None,
        work_experience=None,
    ):
        '''
            Create an Person Data Entity object.

            All individual fields are automatically randomly generated based on locale. If provided, the corresponding values are overriden.

            Note:
                All individual fields are randomly generated. Don't expect correct correlation e.g. correct postal code for the generated city.

            Keyword Arguments:
                locale: Approprite Random.locale.<local_name> object. Default is Random.locale.EN
                qualification: Educational Qualification
                age: Age
                blood_type: Blood type
                email: Email address
                first_name: First name
                last_name: Last name
                gender: Gender
                height: Height
                id: Identifier
                language: Language
                nationality: Nationality
                occupation: Occupation
                phone: Phone number
                title: Title
                university: University
                weight: Weight
                work_experience: Work Experience
        '''
        person = Person(locale=locale)
        from arjuna.engine.data.entity.person import Person as ArjPerson

        first_name = first_name is not None and first_name or person.first_name(
        )
        last_name = last_name is not None and last_name or person.last_name()
        return ArjPerson(
            qualification=qualification is not None and qualification
            or person.academic_degree(),
            age=age is not None and age or person.age(),
            blood_type=blood_type is not None and blood_type
            or person.blood_type(),
            email=email is not None and email or person.email(),
            first_name=first_name,
            last_name=last_name,
            name=first_name + " " + last_name,
            gender=gender is not None and gender or person.gender(),
            height=height is not None and height or person.height(),
            id=id is not None and id or person.identifier(),
            language=language is not None and language or person.language(),
            nationality=nationality is not None and nationality
            or person.nationality(),
            occupation=occupation is not None and occupation
            or person.occupation(),
            phone=phone is not None and phone or person.telephone(),
            title=title is not None and title or person.title(),
            university=university is not None and university
            or person.university(),
            weight=weight is not None and weight or person.weight(),
            work_experience=work_experience is not None and work_experience
            or person.work_experience(),
        )