Compare commits

..
6 Commits
Author SHA1 Message Date
mtrshirazi21 ecc1070f1c defin websocket io types 2026-05-25 19:12:00 +03:30
mtrshirazi21 126eab66f7 edit io types 2026-05-25 19:11:10 +03:30
mtrshirazi21 8a5f3142ef edit io_types 2026-05-24 21:18:57 +03:30
mtrshirazi21 9cfd36a891 define io types 2026-05-24 21:18:41 +03:30
mtrshirazi21 034c9a50ea define DE IME 2026-05-24 19:27:24 +03:30
mtrshirazi21 17bea4f2a3 Modifications to the terms and conditions related to Internet force majeure during times of war. 2026-05-17 21:44:05 +03:30
8 changed files with 1380 additions and 50 deletions

No files matched your search

Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
File diff suppressed because it is too large. Load diff
@@ -9,6 +9,7 @@ from typing import (
Dict, Dict,
Optional, Optional,
TypedDict, TypedDict,
Literal,
) )
# ========================================|======================================== # # ========================================|======================================== #
@@ -37,7 +38,15 @@ class WebsocketBase_symbolIsin(TypedDict):
>>> message["symbolIsin"] >>> message["symbolIsin"]
'IR0001234567' 'IR0001234567'
""" """
channel: str channel: Literal[
"best-limit",
"order-book",
"ohlcv-last-1m",
"aggregate",
"institutional-vs-individual",
"contract-info",
"fund-info",
]
symbolIsin: str symbolIsin: str
timestamp: str timestamp: str
@@ -64,7 +73,15 @@ class WebsocketBase_symbolName(TypedDict):
>>> message["symbolName"] >>> message["symbolName"]
'ETF001' 'ETF001'
""" """
channel: str channel: Literal[
"best-limit",
"order-book",
"ohlcv-last-1m",
"aggregate",
"institutional-vs-individual",
"contract-info",
"fund-info",
]
symbolName: str symbolName: str
timestamp: str timestamp: str
@@ -734,7 +751,6 @@ class Instruments(TypedDict):
# +--------------------------------------------------------------------------------------+ # # +--------------------------------------------------------------------------------------+ #
class BestLimitItem(TypedDict): class BestLimitItem(TypedDict):
""" """
Represents the best limit order information at a given price level for a financial instrument. Represents the best limit order information at a given price level for a financial instrument.
@@ -766,39 +782,6 @@ class BestLimitItem(TypedDict):
sell_quantity: int sell_quantity: int
sell_price: int sell_price: int
class BestLimit(TypedDict):
"""
Represents the aggregated best limit orders for multiple instruments.
The structure is a nested dictionary where the first key is typically a symbol
identifier (ISIN or symbolName) and the second key represents the order level or priority.
Attributes:
items (Dict[str, Dict[str, BestLimitItem]]): Nested dictionary of BestLimitItem objects.
- Outer key: Instrument identifier (e.g., ISIN or symbolName)
- Inner key: Price level or order priority
- Value: BestLimitItem for that level
Example:
>>> best_limit: BestLimit = {
... "ETF001": {
... "1": {
... "buy_order_count": 5,
... "buy_quantity": 1000,
... "buy_price": 12000,
... "sell_order_count": 3,
... "sell_quantity": 800,
... "sell_price": 12100
... }
... }
... }
>>> best_limit["ETF001"]["1"]["sell_quantity"]
800
"""
items: Dict[str, Dict[str, BestLimitItem]]
class BestLimitResponse(TypedDict): class BestLimitResponse(TypedDict):
""" """
Response structure for best limit orders from a REST API call. Response structure for best limit orders from a REST API call.
@@ -810,7 +793,18 @@ class BestLimitResponse(TypedDict):
Example: Example:
>>> response: BestLimitResponse = { >>> response: BestLimitResponse = {
... "Data": best_limit, ... "Data": {
... "ETF001": {
... "1": {
... "buy_order_count": 5,
... "buy_quantity": 1000,
... "buy_price": 12000,
... "sell_order_count": 3,
... "sell_quantity": 800,
... "sell_price": 12100
... },
... },
... },
... "Status": { ... "Status": {
... "State": True, ... "State": True,
... "ServerTimeStamp": 1700350200.0, ... "ServerTimeStamp": 1700350200.0,
@@ -825,7 +819,13 @@ class BestLimitResponse(TypedDict):
>>> response["Status"]["State"] >>> response["Status"]["State"]
True True
""" """
Data: BestLimit Data: Dict[
str,
Dict[
Literal['1','2','3','4','5','6',],
BestLimitItem
]
]
Status: Status Status: Status
@@ -867,7 +867,10 @@ class BestLimit_WS_symbolIsin(WebsocketBase_symbolIsin):
>>> ws_data["data"]["1"]["sell_price"] >>> ws_data["data"]["1"]["sell_price"]
12100 12100
""" """
data: Dict[str, BestLimitItem] data: Dict[
Literal['1','2','3','4','5','6',],
BestLimitItem,
]
class BestLimit_WS_symbolName(WebsocketBase_symbolName): class BestLimit_WS_symbolName(WebsocketBase_symbolName):
@@ -908,7 +911,10 @@ class BestLimit_WS_symbolName(WebsocketBase_symbolName):
>>> ws_data["data"]["2"]["buy_price"] >>> ws_data["data"]["2"]["buy_price"]
11950 11950
""" """
data: Dict[str, BestLimitItem] data: Dict[
Literal['1','2','3','4','5','6',],
BestLimitItem,
]
# +--------------------------------------------------------------------------------------+ # # +--------------------------------------------------------------------------------------+ #
@@ -1628,7 +1634,10 @@ class OverviewSecuritiesAndFunds(SecuritiesAndFunds):
>>> overview["FundInfo"]["nav"] >>> overview["FundInfo"]["nav"]
12500.0 12500.0
""" """
BestLimit: Dict[str, BestLimitItem] BestLimit: Dict[
Literal['1','2','3','4','5','6',],
BestLimitItem,
]
Aggregate: Aggregate Aggregate: Aggregate
institutional_vs_individual: institutional_vs_individual institutional_vs_individual: institutional_vs_individual
FundInfo: FundInfo FundInfo: FundInfo
@@ -1649,7 +1658,10 @@ class OverviewTreasuryBonds(TreasuryBonds):
FundInfo (FundInfo) FundInfo (FundInfo)
ContractInfo (ContractInfo) ContractInfo (ContractInfo)
""" """
BestLimit: Dict[str, BestLimitItem] BestLimit: Dict[
Literal['1','2','3','4','5','6',],
BestLimitItem,
]
Aggregate: Aggregate Aggregate: Aggregate
institutional_vs_individual: institutional_vs_individual institutional_vs_individual: institutional_vs_individual
FundInfo: FundInfo FundInfo: FundInfo
@@ -1670,7 +1682,10 @@ class OverviewStockOptions(StockOptions):
FundInfo (FundInfo) FundInfo (FundInfo)
ContractInfo (ContractInfo) ContractInfo (ContractInfo)
""" """
BestLimit: Dict[str, BestLimitItem] BestLimit: Dict[
Literal['1','2','3','4','5','6',],
BestLimitItem,
]
Aggregate: Aggregate Aggregate: Aggregate
institutional_vs_individual: institutional_vs_individual institutional_vs_individual: institutional_vs_individual
FundInfo: FundInfo FundInfo: FundInfo
@@ -1691,7 +1706,10 @@ class OverviewStockFuturess(StockFutures):
FundInfo (FundInfo) FundInfo (FundInfo)
ContractInfo (ContractInfo) ContractInfo (ContractInfo)
""" """
BestLimit: Dict[str, BestLimitItem] BestLimit: Dict[
Literal['1','2','3','4','5','6',],
BestLimitItem,
]
Aggregate: Aggregate Aggregate: Aggregate
institutional_vs_individual: institutional_vs_individual institutional_vs_individual: institutional_vs_individual
FundInfo: FundInfo FundInfo: FundInfo
@@ -1728,7 +1746,8 @@ class OverviewResponse:
True True
""" """
Data : Dict[ Data : Dict[
str,Optional[ str,
Optional[
Union[ Union[
OverviewSecuritiesAndFunds, OverviewSecuritiesAndFunds,
OverviewTreasuryBonds, OverviewTreasuryBonds,
+3 -3
View File
@@ -32,13 +32,13 @@ maximum flexibility and performance for different application scenarios.
Install via PyPI: Install via PyPI:
``` bash ``` bash
pip install HedgeTech pip install git+https://gitea.hedgetech.ir/HedgeTech/HedgeTech
``` ```
### Update ### Update
``` bash ``` bash
pip install --upgrade HedgeTech pip install --upgrade --force-reinstall git+https://gitea.hedgetech.ir/HedgeTech/HedgeTech
``` ```
------------------------------------------------------------------------ ------------------------------------------------------------------------
@@ -367,7 +367,7 @@ See LICENSE file.
## Support ## Support
GitHub Issues: https://github.com/HedgeTech-ir/HedgeTech/issues GitHub Issues: https://gitea.hedgetech.ir/HedgeTech/HedgeTech/issues
Email: info@hedgetech.ir Email: info@hedgetech.ir
+2 -2
View File
@@ -59,5 +59,5 @@ dependencies = [
[project.urls] [project.urls]
Homepage = "https://hedgetech.ir/landing/" Homepage = "https://hedgetech.ir/landing/"
Documentation = "https://github.com/HedgeTech-ir/HedgeTech/blob/main/README.md" Documentation = "https://gitea.hedgetech.ir/HedgeTech/HedgeTech/src/branch/main/README.md"
Repository = "https://github.com/HedgeTech-ir/HedgeTech" Repository = "https://gitea.hedgetech.ir/HedgeTech/HedgeTech"