This repository was archived by the owner on Jan 16, 2022. It is now read-only.
File tree 2 files changed +1
-40
lines changed
2 files changed +1
-40
lines changed Original file line number Diff line number Diff line change 1
- import asyncio
2
1
from typing import List
3
2
4
3
import humps
5
4
6
- from nepse .market .types import FloorSheet , MarketCap
5
+ from nepse .market .types import MarketCap
7
6
from nepse .utils import _ClientWrapperHTTPX
8
7
9
8
BASE_URL = "https://newweb.nepalstock.com/api/nots"
@@ -62,36 +61,3 @@ async def get_market_caps(self) -> List[MarketCap]:
62
61
)
63
62
data = humps .decamelize (resp )
64
63
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:
13
13
def __post_init__ (self ) -> None :
14
14
year , month , day = self .business_date .split ("-" )
15
15
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