Get Traits

GET

Retrieve all traits from the database.

Returns:

  • List[TraitLevel]: A list of TraitLevel objects representing all valid traits

TraitLevel structure:

  • id: Unique identifier for the trait
  • set_type: Optional category of the trait (e.g., “Big Five”, “8 Values”)
  • type: The type of trait (e.g., “religion”)
  • measurement_type: How the trait is measured (“nominal”, “ordinal”, “interval”, “ratio”)
  • ordinal_rank: Optional ranking for ordinal traits
  • short_description: Brief description of the trait level (e.g., “Satanist”)
  • long_description: Detailed description of the trait level

Example Response:

1[
2 {
3 "id": "religion_1",
4 "set_type": "Personal Values",
5 "type": "religion",
6 "measurement_type": "nominal",
7 "short_description": "Satanist",
8 "long_description": "My religion is Satanism"
9 },
10 {
11 "id": "openness_2",
12 "set_type": "Big Five",
13 "type": "personality",
14 "measurement_type": "ordinal",
15 "ordinal_rank": 2,
16 "short_description": "Medium Openness",
17 "long_description": "I am somewhat open to new experiences"
18 }
19]

Notes:

  • Invalid traits are logged and skipped
  • The total number of retrieved traits is logged

Raises:

  • HTTPException 500: If an error occurs while fetching traits

Response

Successful Response

idstring
typestring
measurement_typestring
short_descriptionstring
long_descriptionstring
set_typestringOptional
ordinal_rankintegerOptional
Built with