laplace-python-sdk 1.5.0__tar.gz → 1.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {laplace_python_sdk-1.5.0/src/laplace_python_sdk.egg-info → laplace_python_sdk-1.6.0}/PKG-INFO +1 -1
  2. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/pyproject.toml +3 -3
  3. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/models.py +165 -10
  4. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/screener.py +1 -1
  5. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0/src/laplace_python_sdk.egg-info}/PKG-INFO +1 -1
  6. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/LICENSE +0 -0
  7. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/MANIFEST.in +0 -0
  8. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/README.md +0 -0
  9. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/setup.cfg +0 -0
  10. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/__init__.py +0 -0
  11. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/base.py +0 -0
  12. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/brokers.py +0 -0
  13. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/capital_increase.py +0 -0
  14. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/client.py +0 -0
  15. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/collections.py +0 -0
  16. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/earnings.py +0 -0
  17. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/financials.py +0 -0
  18. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/funds.py +0 -0
  19. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/live_price.py +0 -0
  20. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/news.py +0 -0
  21. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/politician.py +0 -0
  22. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/search.py +0 -0
  23. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/state.py +0 -0
  24. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/stocks.py +0 -0
  25. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace/websocket.py +0 -0
  26. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace_python_sdk.egg-info/SOURCES.txt +0 -0
  27. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace_python_sdk.egg-info/dependency_links.txt +0 -0
  28. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace_python_sdk.egg-info/requires.txt +0 -0
  29. {laplace_python_sdk-1.5.0 → laplace_python_sdk-1.6.0}/src/laplace_python_sdk.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: laplace-python-sdk
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: Python SDK for Laplace stock data platform
5
5
  Author: Laplace SDK Team
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "laplace-python-sdk"
7
- version = "1.5.0"
7
+ version = "1.6.0"
8
8
  description = "Python SDK for Laplace stock data platform"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -64,14 +64,14 @@ profile = "black"
64
64
  line_length = 100
65
65
 
66
66
  [tool.mypy]
67
- python_version = "1.5.0"
67
+ python_version = "1.6.0"
68
68
  strict = true
69
69
  warn_return_any = true
70
70
  warn_unused_configs = true
71
71
 
72
72
  [tool.ruff]
73
73
  line-length = 100
74
- target-version = "1.5.0"
74
+ target-version = "1.6.0"
75
75
 
76
76
  [tool.ruff.lint]
77
77
  select = ["E", "W", "F", "I", "N", "B", "UP"]
@@ -874,24 +874,21 @@ class NewsPublisher(BaseModel):
874
874
  model_config = {"populate_by_name": True}
875
875
 
876
876
  class NewsIndustry(BaseModel):
877
+ id: str
877
878
  name: str
878
- mean_type: int = Field(alias="meanType")
879
879
 
880
880
  model_config = {"populate_by_name": True}
881
881
 
882
882
  class NewsSector(BaseModel):
883
+ id: str
883
884
  name: str
884
- news_count: int = Field(alias="newsCount")
885
- category_type: Optional[str] = Field(alias="categoryType", default=None)
886
- mean_type: Optional[int] = Field(alias="meanType", default=None)
887
885
 
888
886
  model_config = {"populate_by_name": True}
889
887
 
890
888
  class NewsCategory(BaseModel):
889
+ id: str
891
890
  name: str
892
- news_count: int = Field(alias="newsCount")
893
891
  category_type: Optional[str] = Field(alias="categoryType", default=None)
894
- mean_type: Optional[int] = Field(alias="meanType", default=None)
895
892
 
896
893
  model_config = {"populate_by_name": True}
897
894
 
@@ -945,6 +942,7 @@ class NewsContent(BaseModel):
945
942
  model_config = {"populate_by_name": True}
946
943
 
947
944
  class News(BaseModel):
945
+ id: str
948
946
  created_at: datetime = Field(alias="createdAt")
949
947
  url: str
950
948
  image_url: str = Field(alias="imageUrl")
@@ -952,7 +950,7 @@ class News(BaseModel):
952
950
  publisher_url: str = Field(alias="publisherUrl")
953
951
 
954
952
  publisher: NewsPublisher
955
- related_tickers: List[NewsTicker] = Field(alias="relatedTickers")
953
+ related_tickers: Optional[List[NewsTicker]] = Field(alias="relatedTickers", default=None)
956
954
 
957
955
  tickers: Optional[List[NewsTicker]] = None
958
956
  categories: Optional[NewsCategory] = None
@@ -965,6 +963,7 @@ class News(BaseModel):
965
963
  model_config = {"populate_by_name": True}
966
964
 
967
965
  class NewsV2(BaseModel):
966
+ id: str
968
967
  created_at: datetime = Field(alias="createdAt")
969
968
  url: str
970
969
  image_url: str = Field(alias="imageUrl")
@@ -997,16 +996,40 @@ class NewsHighlight(BaseModel):
997
996
 
998
997
  model_config = {"populate_by_name": True}
999
998
 
999
+ class ScreenerLetterGrade(str, Enum):
1000
+ """Letter grades (A-E) used by the SMR and A/D ratings."""
1001
+
1002
+ A = "A"
1003
+ B = "B"
1004
+ C = "C"
1005
+ D = "D"
1006
+ E = "E"
1007
+
1008
+
1000
1009
  class ScreenerRangeFilter(BaseModel):
1001
- """Min/max numeric range filter for the screener."""
1010
+ """Min/max numeric range filter for the screener.
1011
+
1012
+ Both bounds are optional and inclusive. If both are set, ``min`` must be
1013
+ <= ``max`` (otherwise the API returns 400). Rows whose value is NULL in the
1014
+ filtered column are excluded by any range filter touching it.
1015
+ """
1002
1016
 
1003
1017
  min: Optional[float] = None
1004
1018
  max: Optional[float] = None
1005
1019
 
1006
1020
 
1007
1021
  class ScreenerFilters(BaseModel):
1008
- """Filters accepted by the screener endpoint."""
1022
+ """Filters accepted by the screener endpoint.
1023
+
1024
+ Three filter types are supported:
1009
1025
 
1026
+ - Range filters: an optional ``{min, max}`` pair per field.
1027
+ - Letter-grade list filters: ``smr_rating`` and ``ad_rating`` accept a list
1028
+ of grades ``A``-``E`` (IN match).
1029
+ - Boolean filter: ``eps_acceleration`` accepts ``True``/``False``.
1030
+ """
1031
+
1032
+ # Range filters
1010
1033
  price: Optional[ScreenerRangeFilter] = None
1011
1034
  daily_change: Optional[ScreenerRangeFilter] = Field(default=None, alias="dailyChange")
1012
1035
  pe_ratio: Optional[ScreenerRangeFilter] = Field(default=None, alias="peRatio")
@@ -1019,6 +1042,52 @@ class ScreenerFilters(BaseModel):
1019
1042
  three_year_return: Optional[ScreenerRangeFilter] = Field(default=None, alias="threeYearReturn")
1020
1043
  five_year_return: Optional[ScreenerRangeFilter] = Field(default=None, alias="fiveYearReturn")
1021
1044
  ytd_return: Optional[ScreenerRangeFilter] = Field(default=None, alias="ytdReturn")
1045
+ composite_rating: Optional[ScreenerRangeFilter] = Field(default=None, alias="compositeRating")
1046
+ composite_score: Optional[ScreenerRangeFilter] = Field(default=None, alias="compositeScore")
1047
+ rs_rating: Optional[ScreenerRangeFilter] = Field(default=None, alias="rsRating")
1048
+ rs_score: Optional[ScreenerRangeFilter] = Field(default=None, alias="rsScore")
1049
+ perf_q1: Optional[ScreenerRangeFilter] = Field(default=None, alias="perfQ1")
1050
+ perf_q2: Optional[ScreenerRangeFilter] = Field(default=None, alias="perfQ2")
1051
+ perf_q3: Optional[ScreenerRangeFilter] = Field(default=None, alias="perfQ3")
1052
+ perf_q4: Optional[ScreenerRangeFilter] = Field(default=None, alias="perfQ4")
1053
+ eps_rating: Optional[ScreenerRangeFilter] = Field(default=None, alias="epsRating")
1054
+ eps_score: Optional[ScreenerRangeFilter] = Field(default=None, alias="epsScore")
1055
+ eps_growth_yoy: Optional[ScreenerRangeFilter] = Field(default=None, alias="epsGrowthYoy")
1056
+ eps_growth_qoq: Optional[ScreenerRangeFilter] = Field(default=None, alias="epsGrowthQoq")
1057
+ eps_trailing_4q: Optional[ScreenerRangeFilter] = Field(default=None, alias="epsTrailing4q")
1058
+ ad_score: Optional[ScreenerRangeFilter] = Field(default=None, alias="adScore")
1059
+ up_volume_ratio: Optional[ScreenerRangeFilter] = Field(default=None, alias="upVolumeRatio")
1060
+ volume_trend: Optional[ScreenerRangeFilter] = Field(default=None, alias="volumeTrend")
1061
+ smr_score: Optional[ScreenerRangeFilter] = Field(default=None, alias="smrScore")
1062
+ sales_growth_2q: Optional[ScreenerRangeFilter] = Field(default=None, alias="salesGrowth2q")
1063
+ gross_margin: Optional[ScreenerRangeFilter] = Field(default=None, alias="grossMargin")
1064
+ net_margin: Optional[ScreenerRangeFilter] = Field(default=None, alias="netMargin")
1065
+ roe: Optional[ScreenerRangeFilter] = None
1066
+ sma20: Optional[ScreenerRangeFilter] = None
1067
+ sma50: Optional[ScreenerRangeFilter] = None
1068
+ sma150: Optional[ScreenerRangeFilter] = None
1069
+ sma200: Optional[ScreenerRangeFilter] = None
1070
+ volume_sma50: Optional[ScreenerRangeFilter] = Field(default=None, alias="volumeSma50")
1071
+ price_vs_sma20: Optional[ScreenerRangeFilter] = Field(default=None, alias="priceVsSma20")
1072
+ price_vs_sma50: Optional[ScreenerRangeFilter] = Field(default=None, alias="priceVsSma50")
1073
+ price_vs_sma150: Optional[ScreenerRangeFilter] = Field(default=None, alias="priceVsSma150")
1074
+ price_vs_sma200: Optional[ScreenerRangeFilter] = Field(default=None, alias="priceVsSma200")
1075
+ high_52w: Optional[ScreenerRangeFilter] = Field(default=None, alias="high52w")
1076
+ low_52w: Optional[ScreenerRangeFilter] = Field(default=None, alias="low52w")
1077
+ off_high_pct: Optional[ScreenerRangeFilter] = Field(default=None, alias="offHighPct")
1078
+ volume_vs_avg50: Optional[ScreenerRangeFilter] = Field(default=None, alias="volumeVsAvg50")
1079
+ price_change_pct: Optional[ScreenerRangeFilter] = Field(default=None, alias="priceChangePct")
1080
+ price_change_amount: Optional[ScreenerRangeFilter] = Field(
1081
+ default=None, alias="priceChangeAmount"
1082
+ )
1083
+ ytd_change_pct: Optional[ScreenerRangeFilter] = Field(default=None, alias="ytdChangePct")
1084
+
1085
+ # Letter-grade list filters
1086
+ smr_rating: Optional[List[ScreenerLetterGrade]] = Field(default=None, alias="smrRating")
1087
+ ad_rating: Optional[List[ScreenerLetterGrade]] = Field(default=None, alias="adRating")
1088
+
1089
+ # Boolean filter
1090
+ eps_acceleration: Optional[bool] = Field(default=None, alias="epsAcceleration")
1022
1091
 
1023
1092
  model_config = {"populate_by_name": True}
1024
1093
 
@@ -1039,10 +1108,56 @@ class ScreenerSortBy(str, Enum):
1039
1108
  THREE_YEAR_RETURN = "threeYearReturn"
1040
1109
  FIVE_YEAR_RETURN = "fiveYearReturn"
1041
1110
  YTD_RETURN = "ytdReturn"
1111
+ COMPOSITE_RATING = "compositeRating"
1112
+ COMPOSITE_SCORE = "compositeScore"
1113
+ RS_RATING = "rsRating"
1114
+ RS_SCORE = "rsScore"
1115
+ PERF_Q1 = "perfQ1"
1116
+ PERF_Q2 = "perfQ2"
1117
+ PERF_Q3 = "perfQ3"
1118
+ PERF_Q4 = "perfQ4"
1119
+ EPS_RATING = "epsRating"
1120
+ EPS_SCORE = "epsScore"
1121
+ EPS_GROWTH_YOY = "epsGrowthYoy"
1122
+ EPS_GROWTH_QOQ = "epsGrowthQoq"
1123
+ EPS_TRAILING_4Q = "epsTrailing4q"
1124
+ EPS_ACCELERATION = "epsAcceleration"
1125
+ AD_RATING = "adRating"
1126
+ AD_SCORE = "adScore"
1127
+ UP_VOLUME_RATIO = "upVolumeRatio"
1128
+ VOLUME_TREND = "volumeTrend"
1129
+ SMR_RATING = "smrRating"
1130
+ SMR_SCORE = "smrScore"
1131
+ SALES_GROWTH_2Q = "salesGrowth2q"
1132
+ GROSS_MARGIN = "grossMargin"
1133
+ NET_MARGIN = "netMargin"
1134
+ ROE = "roe"
1135
+ SMA20 = "sma20"
1136
+ SMA50 = "sma50"
1137
+ SMA150 = "sma150"
1138
+ SMA200 = "sma200"
1139
+ VOLUME_SMA50 = "volumeSma50"
1140
+ PRICE_VS_SMA20 = "priceVsSma20"
1141
+ PRICE_VS_SMA50 = "priceVsSma50"
1142
+ PRICE_VS_SMA150 = "priceVsSma150"
1143
+ PRICE_VS_SMA200 = "priceVsSma200"
1144
+ HIGH_52W = "high52w"
1145
+ LOW_52W = "low52w"
1146
+ OFF_HIGH_PCT = "offHighPct"
1147
+ VOLUME_VS_AVG50 = "volumeVsAvg50"
1148
+ PRICE_CHANGE_PCT = "priceChangePct"
1149
+ PRICE_CHANGE_AMOUNT = "priceChangeAmount"
1150
+ YTD_CHANGE_PCT = "ytdChangePct"
1042
1151
 
1043
1152
 
1044
1153
  class ScreenerStock(BaseModel):
1045
- """A single stock entry returned by the screener endpoint."""
1154
+ """A single stock entry returned by the screener endpoint.
1155
+
1156
+ Decimal fields return 0 when there is no data. Rating integers
1157
+ (``composite_rating``, ``rs_rating``, ``eps_rating``), letter grades
1158
+ (``ad_rating``, ``smr_rating``) and ``eps_acceleration`` may be ``None``
1159
+ when absent.
1160
+ """
1046
1161
 
1047
1162
  symbol: str
1048
1163
  price: Optional[float] = None
@@ -1057,6 +1172,46 @@ class ScreenerStock(BaseModel):
1057
1172
  three_year_return: Optional[float] = Field(default=None, alias="threeYearReturn")
1058
1173
  five_year_return: Optional[float] = Field(default=None, alias="fiveYearReturn")
1059
1174
  ytd_return: Optional[float] = Field(default=None, alias="ytdReturn")
1175
+ composite_rating: Optional[int] = Field(default=None, alias="compositeRating")
1176
+ composite_score: Optional[float] = Field(default=None, alias="compositeScore")
1177
+ rs_rating: Optional[int] = Field(default=None, alias="rsRating")
1178
+ rs_score: Optional[float] = Field(default=None, alias="rsScore")
1179
+ perf_q1: Optional[float] = Field(default=None, alias="perfQ1")
1180
+ perf_q2: Optional[float] = Field(default=None, alias="perfQ2")
1181
+ perf_q3: Optional[float] = Field(default=None, alias="perfQ3")
1182
+ perf_q4: Optional[float] = Field(default=None, alias="perfQ4")
1183
+ eps_rating: Optional[int] = Field(default=None, alias="epsRating")
1184
+ eps_score: Optional[float] = Field(default=None, alias="epsScore")
1185
+ eps_growth_yoy: Optional[float] = Field(default=None, alias="epsGrowthYoy")
1186
+ eps_growth_qoq: Optional[float] = Field(default=None, alias="epsGrowthQoq")
1187
+ eps_trailing_4q: Optional[float] = Field(default=None, alias="epsTrailing4q")
1188
+ eps_acceleration: Optional[bool] = Field(default=None, alias="epsAcceleration")
1189
+ ad_rating: Optional[str] = Field(default=None, alias="adRating")
1190
+ ad_score: Optional[float] = Field(default=None, alias="adScore")
1191
+ up_volume_ratio: Optional[float] = Field(default=None, alias="upVolumeRatio")
1192
+ volume_trend: Optional[float] = Field(default=None, alias="volumeTrend")
1193
+ smr_rating: Optional[str] = Field(default=None, alias="smrRating")
1194
+ smr_score: Optional[float] = Field(default=None, alias="smrScore")
1195
+ sales_growth_2q: Optional[float] = Field(default=None, alias="salesGrowth2q")
1196
+ gross_margin: Optional[float] = Field(default=None, alias="grossMargin")
1197
+ net_margin: Optional[float] = Field(default=None, alias="netMargin")
1198
+ roe: Optional[float] = None
1199
+ sma20: Optional[float] = None
1200
+ sma50: Optional[float] = None
1201
+ sma150: Optional[float] = None
1202
+ sma200: Optional[float] = None
1203
+ volume_sma50: Optional[float] = Field(default=None, alias="volumeSma50")
1204
+ price_vs_sma20: Optional[float] = Field(default=None, alias="priceVsSma20")
1205
+ price_vs_sma50: Optional[float] = Field(default=None, alias="priceVsSma50")
1206
+ price_vs_sma150: Optional[float] = Field(default=None, alias="priceVsSma150")
1207
+ price_vs_sma200: Optional[float] = Field(default=None, alias="priceVsSma200")
1208
+ high_52w: Optional[float] = Field(default=None, alias="high52w")
1209
+ low_52w: Optional[float] = Field(default=None, alias="low52w")
1210
+ off_high_pct: Optional[float] = Field(default=None, alias="offHighPct")
1211
+ volume_vs_avg50: Optional[float] = Field(default=None, alias="volumeVsAvg50")
1212
+ price_change_pct: Optional[float] = Field(default=None, alias="priceChangePct")
1213
+ price_change_amount: Optional[float] = Field(default=None, alias="priceChangeAmount")
1214
+ ytd_change_pct: Optional[float] = Field(default=None, alias="ytdChangePct")
1060
1215
 
1061
1216
  model_config = {"populate_by_name": True}
1062
1217
 
@@ -48,7 +48,7 @@ class ScreenerClient:
48
48
  body: dict = {"page": page, "pageSize": page_size}
49
49
 
50
50
  if filters is not None:
51
- filters_body = filters.model_dump(by_alias=True, exclude_none=True)
51
+ filters_body = filters.model_dump(mode="json", by_alias=True, exclude_none=True)
52
52
  if filters_body:
53
53
  body["filters"] = filters_body
54
54
  if sort_by is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: laplace-python-sdk
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: Python SDK for Laplace stock data platform
5
5
  Author: Laplace SDK Team
6
6
  License: MIT