avanza.models.inspiration_list

 1from typing import List, Optional, Union
 2from pydantic import BaseModel
 3
 4
 5class HighlightField(BaseModel):
 6    label: str
 7    percent: bool
 8
 9
10class StockOrderBook(BaseModel):
11    """Used when InspirationListItem.instrumentType is STOCK"""
12
13    change: float
14    changePercent: float
15    updated: str
16    """ Example 2011-11-11T11:11:11.504+0200 """
17    priceOneYearAgo: Optional[float] = None
18    priceThreeMonthsAgo: Optional[float] = None
19    currency: str
20    """ ISO 4217 """
21    lastPrice: float
22    flagCode: str
23    """ ISO 3166-1 alpha-2 """
24    highlightValue: float
25    name: str
26    id: str
27
28
29class FundOrderBook(BaseModel):
30    """Used when InspirationListItem.instrumentType is FUND"""
31
32    lastUpdated: str
33    """ YYYY-MM-DD """
34    changeSinceOneDay: float
35    changeSinceThreeMonths: float
36    changeSinceOneYear: float
37    highlightValue: Optional[float] = None
38    name: str
39    id: str
40
41
42class Statistics(BaseModel):
43    positiveCount: int
44    neutralCount: int
45    negativeCount: int
46    positivePercent: float
47    neutralPercent: float
48    negativePercent: float
49
50
51class InspirationList(BaseModel):
52    orderbooks: List[Union[StockOrderBook, FundOrderBook]]
53    imageUrl: str
54    """ relative URL """
55    information: str
56    highlightField: HighlightField
57    averageChange: Optional[float] = None
58    averageChangeSinceThreeMonths: float
59    name: str
60    id: str
61    statistics: Statistics
62    instrumentType: str
class HighlightField(pydantic.main.BaseModel):
6class HighlightField(BaseModel):
7    label: str
8    percent: bool
label: str
percent: bool
class StockOrderBook(pydantic.main.BaseModel):
11class StockOrderBook(BaseModel):
12    """Used when InspirationListItem.instrumentType is STOCK"""
13
14    change: float
15    changePercent: float
16    updated: str
17    """ Example 2011-11-11T11:11:11.504+0200 """
18    priceOneYearAgo: Optional[float] = None
19    priceThreeMonthsAgo: Optional[float] = None
20    currency: str
21    """ ISO 4217 """
22    lastPrice: float
23    flagCode: str
24    """ ISO 3166-1 alpha-2 """
25    highlightValue: float
26    name: str
27    id: str

Used when InspirationListItem.instrumentType is STOCK

change: float
changePercent: float
updated: str

Example 2011-11-11T11:11:11.504+0200

priceOneYearAgo: Optional[float]
priceThreeMonthsAgo: Optional[float]
currency: str

ISO 4217

lastPrice: float
flagCode: str

ISO 3166-1 alpha-2

highlightValue: float
name: str
id: str
class FundOrderBook(pydantic.main.BaseModel):
30class FundOrderBook(BaseModel):
31    """Used when InspirationListItem.instrumentType is FUND"""
32
33    lastUpdated: str
34    """ YYYY-MM-DD """
35    changeSinceOneDay: float
36    changeSinceThreeMonths: float
37    changeSinceOneYear: float
38    highlightValue: Optional[float] = None
39    name: str
40    id: str

Used when InspirationListItem.instrumentType is FUND

lastUpdated: str

YYYY-MM-DD

changeSinceOneDay: float
changeSinceThreeMonths: float
changeSinceOneYear: float
highlightValue: Optional[float]
name: str
id: str
class Statistics(pydantic.main.BaseModel):
43class Statistics(BaseModel):
44    positiveCount: int
45    neutralCount: int
46    negativeCount: int
47    positivePercent: float
48    neutralPercent: float
49    negativePercent: float
positiveCount: int
neutralCount: int
negativeCount: int
positivePercent: float
neutralPercent: float
negativePercent: float
class InspirationList(pydantic.main.BaseModel):
52class InspirationList(BaseModel):
53    orderbooks: List[Union[StockOrderBook, FundOrderBook]]
54    imageUrl: str
55    """ relative URL """
56    information: str
57    highlightField: HighlightField
58    averageChange: Optional[float] = None
59    averageChangeSinceThreeMonths: float
60    name: str
61    id: str
62    statistics: Statistics
63    instrumentType: str
orderbooks: List[Union[StockOrderBook, FundOrderBook]]
imageUrl: str

relative URL

information: str
highlightField: HighlightField
averageChange: Optional[float]
averageChangeSinceThreeMonths: float
name: str
id: str
statistics: Statistics
instrumentType: str