massive 2.0.2__tar.gz → 2.0.3__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 (51) hide show
  1. {massive-2.0.2 → massive-2.0.3}/PKG-INFO +1 -1
  2. {massive-2.0.2 → massive-2.0.3}/massive/rest/financials.py +32 -0
  3. massive-2.0.3/massive/rest/models/dividends.py +54 -0
  4. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/financials.py +59 -0
  5. massive-2.0.3/massive/rest/models/splits.py +39 -0
  6. {massive-2.0.2 → massive-2.0.3}/massive/rest/reference.py +158 -0
  7. {massive-2.0.2 → massive-2.0.3}/pyproject.toml +3 -3
  8. massive-2.0.2/massive/rest/models/dividends.py +0 -21
  9. massive-2.0.2/massive/rest/models/splits.py +0 -16
  10. {massive-2.0.2 → massive-2.0.3}/LICENSE +0 -0
  11. {massive-2.0.2 → massive-2.0.3}/massive/__init__.py +0 -0
  12. {massive-2.0.2 → massive-2.0.3}/massive/exceptions.py +0 -0
  13. {massive-2.0.2 → massive-2.0.3}/massive/logging.py +0 -0
  14. {massive-2.0.2 → massive-2.0.3}/massive/modelclass.py +0 -0
  15. {massive-2.0.2 → massive-2.0.3}/massive/rest/__init__.py +0 -0
  16. {massive-2.0.2 → massive-2.0.3}/massive/rest/aggs.py +0 -0
  17. {massive-2.0.2 → massive-2.0.3}/massive/rest/base.py +0 -0
  18. {massive-2.0.2 → massive-2.0.3}/massive/rest/benzinga.py +0 -0
  19. {massive-2.0.2 → massive-2.0.3}/massive/rest/economy.py +0 -0
  20. {massive-2.0.2 → massive-2.0.3}/massive/rest/etf_global.py +0 -0
  21. {massive-2.0.2 → massive-2.0.3}/massive/rest/futures.py +0 -0
  22. {massive-2.0.2 → massive-2.0.3}/massive/rest/indicators.py +0 -0
  23. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/__init__.py +0 -0
  24. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/aggs.py +0 -0
  25. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/benzinga.py +0 -0
  26. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/common.py +0 -0
  27. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/conditions.py +0 -0
  28. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/contracts.py +0 -0
  29. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/economy.py +0 -0
  30. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/etf_global.py +0 -0
  31. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/exchanges.py +0 -0
  32. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/futures.py +0 -0
  33. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/indicators.py +0 -0
  34. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/markets.py +0 -0
  35. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/quotes.py +0 -0
  36. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/request.py +0 -0
  37. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/snapshot.py +0 -0
  38. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/summaries.py +0 -0
  39. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/tickers.py +0 -0
  40. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/tmx.py +0 -0
  41. {massive-2.0.2 → massive-2.0.3}/massive/rest/models/trades.py +0 -0
  42. {massive-2.0.2 → massive-2.0.3}/massive/rest/quotes.py +0 -0
  43. {massive-2.0.2 → massive-2.0.3}/massive/rest/snapshot.py +0 -0
  44. {massive-2.0.2 → massive-2.0.3}/massive/rest/summaries.py +0 -0
  45. {massive-2.0.2 → massive-2.0.3}/massive/rest/tmx.py +0 -0
  46. {massive-2.0.2 → massive-2.0.3}/massive/rest/trades.py +0 -0
  47. {massive-2.0.2 → massive-2.0.3}/massive/rest/vX.py +0 -0
  48. {massive-2.0.2 → massive-2.0.3}/massive/websocket/__init__.py +0 -0
  49. {massive-2.0.2 → massive-2.0.3}/massive/websocket/models/__init__.py +0 -0
  50. {massive-2.0.2 → massive-2.0.3}/massive/websocket/models/common.py +0 -0
  51. {massive-2.0.2 → massive-2.0.3}/massive/websocket/models/models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: massive
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Official Massive (formerly Polygon.io) REST and Websocket client.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -9,6 +9,7 @@ from .models.financials import (
9
9
  FinancialCashFlowStatement,
10
10
  FinancialIncomeStatement,
11
11
  FinancialRatio,
12
+ FinancialFloat,
12
13
  )
13
14
  from .models.common import Sort
14
15
  from .models.request import RequestOptionBuilder
@@ -318,3 +319,34 @@ class FinancialsClient(BaseClient):
318
319
  deserializer=FinancialRatio.from_dict,
319
320
  options=options,
320
321
  )
322
+
323
+ def list_stocks_floats(
324
+ self,
325
+ ticker: Optional[str] = None,
326
+ ticker_any_of: Optional[str] = None,
327
+ ticker_gt: Optional[str] = None,
328
+ ticker_gte: Optional[str] = None,
329
+ ticker_lt: Optional[str] = None,
330
+ ticker_lte: Optional[str] = None,
331
+ free_float_percent: Optional[float] = None,
332
+ free_float_percent_gt: Optional[float] = None,
333
+ free_float_percent_gte: Optional[float] = None,
334
+ free_float_percent_lt: Optional[float] = None,
335
+ free_float_percent_lte: Optional[float] = None,
336
+ limit: Optional[int] = None,
337
+ sort: Optional[Union[str, Sort]] = None,
338
+ params: Optional[Dict[str, Any]] = None,
339
+ raw: bool = False,
340
+ options: Optional[RequestOptionBuilder] = None,
341
+ ) -> Union[Iterator[FinancialFloat], HTTPResponse]:
342
+ """
343
+ Endpoint: GET /stocks/vX/float
344
+ """
345
+ url = "/stocks/vX/float"
346
+ return self._paginate(
347
+ path=url,
348
+ params=self._get_params(self.list_stocks_floats, locals()),
349
+ raw=raw,
350
+ deserializer=FinancialFloat.from_dict,
351
+ options=options,
352
+ )
@@ -0,0 +1,54 @@
1
+ from typing import Optional
2
+ from ...modelclass import modelclass
3
+
4
+
5
+ @modelclass
6
+ class Dividend:
7
+ "Dividend contains data for a historical cash dividend, including the ticker symbol, declaration date, ex-dividend date, record date, pay date, frequency, and amount."
8
+ id: Optional[int] = None
9
+ cash_amount: Optional[float] = None
10
+ currency: Optional[str] = None
11
+ declaration_date: Optional[str] = None
12
+ dividend_type: Optional[str] = None
13
+ ex_dividend_date: Optional[str] = None
14
+ frequency: Optional[int] = None
15
+ pay_date: Optional[str] = None
16
+ record_date: Optional[str] = None
17
+ ticker: Optional[str] = None
18
+
19
+ @staticmethod
20
+ def from_dict(d):
21
+ return Dividend(**d)
22
+
23
+
24
+ @modelclass
25
+ class StockDividend:
26
+ cash_amount: Optional[float] = None
27
+ currency: Optional[str] = None
28
+ declaration_date: Optional[str] = None
29
+ distribution_type: Optional[str] = None
30
+ ex_dividend_date: Optional[str] = None
31
+ frequency: Optional[int] = None
32
+ historical_adjustment_factor: Optional[float] = None
33
+ id: Optional[str] = None
34
+ pay_date: Optional[str] = None
35
+ record_date: Optional[str] = None
36
+ split_adjusted_cash_amount: Optional[float] = None
37
+ ticker: Optional[str] = None
38
+
39
+ @staticmethod
40
+ def from_dict(d):
41
+ return StockDividend(
42
+ cash_amount=d.get("cash_amount"),
43
+ currency=d.get("currency"),
44
+ declaration_date=d.get("declaration_date"),
45
+ distribution_type=d.get("distribution_type"),
46
+ ex_dividend_date=d.get("ex_dividend_date"),
47
+ frequency=d.get("frequency"),
48
+ historical_adjustment_factor=d.get("historical_adjustment_factor"),
49
+ id=d.get("id"),
50
+ pay_date=d.get("pay_date"),
51
+ record_date=d.get("record_date"),
52
+ split_adjusted_cash_amount=d.get("split_adjusted_cash_amount"),
53
+ ticker=d.get("ticker"),
54
+ )
@@ -861,3 +861,62 @@ class FinancialRatio:
861
861
  return_on_equity=d.get("return_on_equity"),
862
862
  ticker=d.get("ticker"),
863
863
  )
864
+
865
+
866
+ @modelclass
867
+ class FinancialFloat:
868
+ effective_date: Optional[str] = None
869
+ free_float: Optional[int] = None
870
+ free_float_percent: Optional[float] = None
871
+ ticker: Optional[str] = None
872
+
873
+ @staticmethod
874
+ def from_dict(d):
875
+ return FinancialFloat(
876
+ effective_date=d.get("effective_date"),
877
+ free_float=d.get("free_float"),
878
+ free_float_percent=d.get("free_float_percent"),
879
+ ticker=d.get("ticker"),
880
+ )
881
+
882
+
883
+ @modelclass
884
+ class RiskFactor:
885
+ cik: Optional[str] = None
886
+ filing_date: Optional[str] = None
887
+ primary_category: Optional[str] = None
888
+ secondary_category: Optional[str] = None
889
+ supporting_text: Optional[str] = None
890
+ tertiary_category: Optional[str] = None
891
+ ticker: Optional[str] = None
892
+
893
+ @staticmethod
894
+ def from_dict(d):
895
+ return RiskFactor(
896
+ cik=d.get("cik"),
897
+ filing_date=d.get("filing_date"),
898
+ primary_category=d.get("primary_category"),
899
+ secondary_category=d.get("secondary_category"),
900
+ supporting_text=d.get("supporting_text"),
901
+ tertiary_category=d.get("tertiary_category"),
902
+ ticker=d.get("ticker"),
903
+ )
904
+
905
+
906
+ @modelclass
907
+ class RiskFactorTaxonomy:
908
+ description: Optional[str] = None
909
+ primary_category: Optional[str] = None
910
+ secondary_category: Optional[str] = None
911
+ taxonomy: Optional[float] = None
912
+ tertiary_category: Optional[str] = None
913
+
914
+ @staticmethod
915
+ def from_dict(d):
916
+ return RiskFactorTaxonomy(
917
+ description=d.get("description"),
918
+ primary_category=d.get("primary_category"),
919
+ secondary_category=d.get("secondary_category"),
920
+ taxonomy=d.get("taxonomy"),
921
+ tertiary_category=d.get("tertiary_category"),
922
+ )
@@ -0,0 +1,39 @@
1
+ from typing import Optional
2
+ from ...modelclass import modelclass
3
+
4
+
5
+ @modelclass
6
+ class Split:
7
+ "Split contains data for a historical stock split, including the ticker symbol, the execution date, and the factors of the split ratio."
8
+ id: Optional[int] = None
9
+ execution_date: Optional[str] = None
10
+ split_from: Optional[int] = None
11
+ split_to: Optional[int] = None
12
+ ticker: Optional[str] = None
13
+
14
+ @staticmethod
15
+ def from_dict(d):
16
+ return Split(**d)
17
+
18
+
19
+ @modelclass
20
+ class StockSplit:
21
+ adjustment_type: Optional[str] = None
22
+ execution_date: Optional[str] = None
23
+ historical_adjustment_factor: Optional[float] = None
24
+ id: Optional[str] = None
25
+ split_from: Optional[float] = None
26
+ split_to: Optional[float] = None
27
+ ticker: Optional[str] = None
28
+
29
+ @staticmethod
30
+ def from_dict(d):
31
+ return StockSplit(
32
+ adjustment_type=d.get("adjustment_type"),
33
+ execution_date=d.get("execution_date"),
34
+ historical_adjustment_factor=d.get("historical_adjustment_factor"),
35
+ id=d.get("id"),
36
+ split_from=d.get("split_from"),
37
+ split_to=d.get("split_to"),
38
+ ticker=d.get("ticker"),
39
+ )
@@ -14,7 +14,9 @@ from .models import (
14
14
  AssetClass,
15
15
  Locale,
16
16
  Split,
17
+ StockSplit,
17
18
  Dividend,
19
+ StockDividend,
18
20
  DividendType,
19
21
  Frequency,
20
22
  Condition,
@@ -24,6 +26,8 @@ from .models import (
24
26
  OptionsContract,
25
27
  ShortInterest,
26
28
  ShortVolume,
29
+ RiskFactor,
30
+ RiskFactorTaxonomy,
27
31
  )
28
32
  from urllib3 import HTTPResponse
29
33
  from datetime import date
@@ -695,3 +699,157 @@ class ContractsClient(BaseClient):
695
699
  result_key="results",
696
700
  options=options,
697
701
  )
702
+
703
+ # Add these functions to financials.py in the FinancialsClient class
704
+
705
+ def list_stocks_splits(
706
+ self,
707
+ ticker: Optional[str] = None,
708
+ ticker_any_of: Optional[str] = None,
709
+ ticker_gt: Optional[str] = None,
710
+ ticker_gte: Optional[str] = None,
711
+ ticker_lt: Optional[str] = None,
712
+ ticker_lte: Optional[str] = None,
713
+ execution_date: Optional[Union[str, date]] = None,
714
+ execution_date_gt: Optional[Union[str, date]] = None,
715
+ execution_date_gte: Optional[Union[str, date]] = None,
716
+ execution_date_lt: Optional[Union[str, date]] = None,
717
+ execution_date_lte: Optional[Union[str, date]] = None,
718
+ adjustment_type: Optional[str] = None,
719
+ adjustment_type_any_of: Optional[str] = None,
720
+ limit: Optional[int] = None,
721
+ sort: Optional[Union[str, Sort]] = None,
722
+ params: Optional[Dict[str, Any]] = None,
723
+ raw: bool = False,
724
+ options: Optional[RequestOptionBuilder] = None,
725
+ ) -> Union[Iterator[StockSplit], HTTPResponse]:
726
+ """
727
+ Endpoint: GET /stocks/v1/splits
728
+ """
729
+ url = "/stocks/v1/splits"
730
+ return self._paginate(
731
+ path=url,
732
+ params=self._get_params(self.list_stocks_splits, locals()),
733
+ raw=raw,
734
+ deserializer=StockSplit.from_dict,
735
+ options=options,
736
+ )
737
+
738
+ def list_stocks_dividends(
739
+ self,
740
+ ticker: Optional[str] = None,
741
+ ticker_any_of: Optional[str] = None,
742
+ ticker_gt: Optional[str] = None,
743
+ ticker_gte: Optional[str] = None,
744
+ ticker_lt: Optional[str] = None,
745
+ ticker_lte: Optional[str] = None,
746
+ ex_dividend_date: Optional[Union[str, date]] = None,
747
+ ex_dividend_date_gt: Optional[Union[str, date]] = None,
748
+ ex_dividend_date_gte: Optional[Union[str, date]] = None,
749
+ ex_dividend_date_lt: Optional[Union[str, date]] = None,
750
+ ex_dividend_date_lte: Optional[Union[str, date]] = None,
751
+ frequency: Optional[int] = None,
752
+ frequency_gt: Optional[int] = None,
753
+ frequency_gte: Optional[int] = None,
754
+ frequency_lt: Optional[int] = None,
755
+ frequency_lte: Optional[int] = None,
756
+ distribution_type: Optional[str] = None,
757
+ distribution_type_any_of: Optional[str] = None,
758
+ limit: Optional[int] = None,
759
+ sort: Optional[Union[str, Sort]] = None,
760
+ params: Optional[Dict[str, Any]] = None,
761
+ raw: bool = False,
762
+ options: Optional[RequestOptionBuilder] = None,
763
+ ) -> Union[Iterator[StockDividend], HTTPResponse]:
764
+ """
765
+ Endpoint: GET /stocks/v1/dividends
766
+ """
767
+ url = "/stocks/v1/dividends"
768
+ return self._paginate(
769
+ path=url,
770
+ params=self._get_params(self.list_stocks_dividends, locals()),
771
+ raw=raw,
772
+ deserializer=StockDividend.from_dict,
773
+ options=options,
774
+ )
775
+
776
+ def list_stocks_filings_risk_factors(
777
+ self,
778
+ filing_date: Optional[Union[str, date]] = None,
779
+ filing_date_any_of: Optional[str] = None,
780
+ filing_date_gt: Optional[Union[str, date]] = None,
781
+ filing_date_gte: Optional[Union[str, date]] = None,
782
+ filing_date_lt: Optional[Union[str, date]] = None,
783
+ filing_date_lte: Optional[Union[str, date]] = None,
784
+ ticker: Optional[str] = None,
785
+ ticker_any_of: Optional[str] = None,
786
+ ticker_gt: Optional[str] = None,
787
+ ticker_gte: Optional[str] = None,
788
+ ticker_lt: Optional[str] = None,
789
+ ticker_lte: Optional[str] = None,
790
+ cik: Optional[str] = None,
791
+ cik_any_of: Optional[str] = None,
792
+ cik_gt: Optional[str] = None,
793
+ cik_gte: Optional[str] = None,
794
+ cik_lt: Optional[str] = None,
795
+ cik_lte: Optional[str] = None,
796
+ limit: Optional[int] = None,
797
+ sort: Optional[Union[str, Sort]] = None,
798
+ params: Optional[Dict[str, Any]] = None,
799
+ raw: bool = False,
800
+ options: Optional[RequestOptionBuilder] = None,
801
+ ) -> Union[Iterator[RiskFactor], HTTPResponse]:
802
+ """
803
+ Endpoint: GET /stocks/filings/vX/risk-factors
804
+ """
805
+ url = "/stocks/filings/vX/risk-factors"
806
+ return self._paginate(
807
+ path=url,
808
+ params=self._get_params(self.list_stocks_filings_risk_factors, locals()),
809
+ raw=raw,
810
+ deserializer=RiskFactor.from_dict,
811
+ options=options,
812
+ )
813
+
814
+ def list_stocks_taxonomies_risk_factors(
815
+ self,
816
+ taxonomy: Optional[float] = None,
817
+ taxonomy_gt: Optional[float] = None,
818
+ taxonomy_gte: Optional[float] = None,
819
+ taxonomy_lt: Optional[float] = None,
820
+ taxonomy_lte: Optional[float] = None,
821
+ primary_category: Optional[str] = None,
822
+ primary_category_any_of: Optional[str] = None,
823
+ primary_category_gt: Optional[str] = None,
824
+ primary_category_gte: Optional[str] = None,
825
+ primary_category_lt: Optional[str] = None,
826
+ primary_category_lte: Optional[str] = None,
827
+ secondary_category: Optional[str] = None,
828
+ secondary_category_any_of: Optional[str] = None,
829
+ secondary_category_gt: Optional[str] = None,
830
+ secondary_category_gte: Optional[str] = None,
831
+ secondary_category_lt: Optional[str] = None,
832
+ secondary_category_lte: Optional[str] = None,
833
+ tertiary_category: Optional[str] = None,
834
+ tertiary_category_any_of: Optional[str] = None,
835
+ tertiary_category_gt: Optional[str] = None,
836
+ tertiary_category_gte: Optional[str] = None,
837
+ tertiary_category_lt: Optional[str] = None,
838
+ tertiary_category_lte: Optional[str] = None,
839
+ limit: Optional[int] = None,
840
+ sort: Optional[Union[str, Sort]] = None,
841
+ params: Optional[Dict[str, Any]] = None,
842
+ raw: bool = False,
843
+ options: Optional[RequestOptionBuilder] = None,
844
+ ) -> Union[Iterator[RiskFactorTaxonomy], HTTPResponse]:
845
+ """
846
+ Endpoint: GET /stocks/taxonomies/vX/risk-factors
847
+ """
848
+ url = "/stocks/taxonomies/vX/risk-factors"
849
+ return self._paginate(
850
+ path=url,
851
+ params=self._get_params(self.list_stocks_taxonomies_risk_factors, locals()),
852
+ raw=raw,
853
+ deserializer=RiskFactorTaxonomy.from_dict,
854
+ options=options,
855
+ )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "massive"
3
- version = "v2.0.2"
3
+ version = "v2.0.3"
4
4
  description = "Official Massive (formerly Polygon.io) REST and Websocket client."
5
5
  authors = ["massive.com"]
6
6
  license = "MIT"
@@ -31,7 +31,7 @@ certifi = ">=2022.5.18,<2026.0.0"
31
31
 
32
32
  [tool.poetry.dev-dependencies]
33
33
  black = "^24.8.0"
34
- mypy = "^1.18"
34
+ mypy = "^1.19"
35
35
  types-urllib3 = "^1.26.25"
36
36
  Sphinx = "^7.4.7"
37
37
  sphinx-rtd-theme = "^3.0.2"
@@ -40,7 +40,7 @@ sphinx-autodoc-typehints = "^2.3.0"
40
40
  types-certifi = "^2021.10.8"
41
41
  types-setuptools = "^80.9.0"
42
42
  pook = "^2.1.4"
43
- orjson = "^3.11.4"
43
+ orjson = "^3.11.5"
44
44
 
45
45
  [build-system]
46
46
  requires = ["poetry-core>=1.0.0"]
@@ -1,21 +0,0 @@
1
- from typing import Optional
2
- from ...modelclass import modelclass
3
-
4
-
5
- @modelclass
6
- class Dividend:
7
- "Dividend contains data for a historical cash dividend, including the ticker symbol, declaration date, ex-dividend date, record date, pay date, frequency, and amount."
8
- id: Optional[int] = None
9
- cash_amount: Optional[float] = None
10
- currency: Optional[str] = None
11
- declaration_date: Optional[str] = None
12
- dividend_type: Optional[str] = None
13
- ex_dividend_date: Optional[str] = None
14
- frequency: Optional[int] = None
15
- pay_date: Optional[str] = None
16
- record_date: Optional[str] = None
17
- ticker: Optional[str] = None
18
-
19
- @staticmethod
20
- def from_dict(d):
21
- return Dividend(**d)
@@ -1,16 +0,0 @@
1
- from typing import Optional
2
- from ...modelclass import modelclass
3
-
4
-
5
- @modelclass
6
- class Split:
7
- "Split contains data for a historical stock split, including the ticker symbol, the execution date, and the factors of the split ratio."
8
- id: Optional[int] = None
9
- execution_date: Optional[str] = None
10
- split_from: Optional[int] = None
11
- split_to: Optional[int] = None
12
- ticker: Optional[str] = None
13
-
14
- @staticmethod
15
- def from_dict(d):
16
- return Split(**d)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes