This repository was archived by the owner on Jan 16, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +1
-40
lines changed Expand file tree Collapse file tree 2 files changed +1
-40
lines changed Original file line number Diff line number Diff line change 1- import asyncio
21from typing import List
32
43import humps
54
6- from nepse .market .types import FloorSheet , MarketCap
5+ from nepse .market .types import MarketCap
76from nepse .utils import _ClientWrapperHTTPX
87
98BASE_URL = "https://newweb.nepalstock.com/api/nots"
@@ -62,36 +61,3 @@ async def get_market_caps(self) -> List[MarketCap]:
6261 )
6362 data = humps .decamelize (resp )
6463 return [MarketCap (** model ) for model in data ]
65-
66- async def get_floorsheets (self ) -> List [FloorSheet ]:
67- """Returns the floorsheet data for the current date
68-
69- Returns:
70- List[FloorSheet]: List of floorsheet data in form of `FloorSheet`
71- """
72- contents = []
73- tasks = []
74-
75- pages = (
76- await self ._client_wrapper ._get_json (f"{ BASE_URL } /nepse-data/floorsheet" )
77- .get ("floorsheets" )
78- .get ("totalPages" )
79- )
80-
81- async def _get_floorsheet_page (page_no : int ):
82- response = (
83- await self ._client_wrapper ._get_json (
84- f"{ BASE_URL } nots/nepse-data/floorsheet?page={ page_no } &size=2000&sort=contractId,desc"
85- )
86- .get ("floorsheets" )
87- .get ("content" )
88- )
89- data = humps .decamelize (response )
90- return FloorSheet (** data )
91-
92- for page_no in range (pages ):
93- tasks .append (_get_floorsheet_page (page_no ))
94-
95- await asyncio .gather (* tasks )
96-
97- return contents
Original file line number Diff line number Diff line change @@ -13,8 +13,3 @@ class MarketCap:
1313 def __post_init__ (self ) -> None :
1414 year , month , day = self .business_date .split ("-" )
1515 self .business_date = datetime .date (int (year ), int (month ), int (day ))
16-
17-
18- @dataclass
19- class FloorSheet :
20- pass
You can’t perform that action at this time.
0 commit comments