Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22f8ea17d6 | ||
|
|
440c7947cc | ||
|
|
312f230b08 | ||
|
|
aa4d4bbabb | ||
|
|
569a36edaa | ||
|
|
6b5e8ece84 | ||
|
|
74f2a1e857 | ||
|
|
870d660130 |
No files matched your search
@@ -2,6 +2,7 @@
|
||||
# Imports #
|
||||
# ========================================|======================================== #
|
||||
|
||||
from .__utils import RetriableAsyncClient
|
||||
from httpx import (
|
||||
AsyncClient ,
|
||||
Timeout ,
|
||||
@@ -126,20 +127,23 @@ class AuthAsyncClient:
|
||||
headers = {'origin' : 'https://core.hedgetech.ir'}
|
||||
headers.update(token)
|
||||
|
||||
httpx_Client = AsyncClient(
|
||||
verify=True ,
|
||||
http1=False ,
|
||||
http2=True ,
|
||||
headers=headers,
|
||||
cookies=httpx_Client.cookies,
|
||||
timeout=Timeout(
|
||||
connect=.5,
|
||||
read=1,
|
||||
write=1,
|
||||
pool=.5,
|
||||
httpx_Client = RetriableAsyncClient(
|
||||
client = AsyncClient(
|
||||
verify=True ,
|
||||
http1=False ,
|
||||
http2=True ,
|
||||
headers=headers,
|
||||
cookies=httpx_Client.cookies,
|
||||
timeout=Timeout(
|
||||
connect=.250,
|
||||
read=1.5,
|
||||
write=1.5,
|
||||
pool=.250,
|
||||
),
|
||||
),
|
||||
retries= 10
|
||||
)
|
||||
|
||||
|
||||
return cls(
|
||||
httpx_Client = httpx_Client,
|
||||
token = token
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Imports #
|
||||
# ========================================|======================================== #
|
||||
|
||||
from .__utils import RetriableSyncClient
|
||||
from httpx import (
|
||||
Client ,
|
||||
Timeout ,
|
||||
@@ -128,24 +129,27 @@ class AuthSyncClient:
|
||||
token = login_res.json()
|
||||
headers = {'origin' : 'https://core.hedgetech.ir'}
|
||||
headers.update(token)
|
||||
|
||||
httpx_Client = Client(
|
||||
verify=True ,
|
||||
http1=False ,
|
||||
http2=True ,
|
||||
headers=headers,
|
||||
cookies=httpx_Client.cookies,
|
||||
timeout=Timeout(
|
||||
connect=.5,
|
||||
read=1,
|
||||
write=1,
|
||||
pool=.5,
|
||||
),
|
||||
)
|
||||
|
||||
httpx_Client = RetriableSyncClient(
|
||||
client = Client(
|
||||
verify=True ,
|
||||
http1=False ,
|
||||
http2=True ,
|
||||
headers=headers,
|
||||
cookies=httpx_Client.cookies,
|
||||
timeout=Timeout(
|
||||
connect=.250,
|
||||
read=1.5,
|
||||
write=1.5,
|
||||
pool=.250,
|
||||
),
|
||||
),
|
||||
retries= 10
|
||||
)
|
||||
|
||||
return cls(
|
||||
httpx_Client = httpx_Client,
|
||||
token = login_res.json()
|
||||
token = token
|
||||
)
|
||||
|
||||
else :
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# ========================================|======================================== #
|
||||
# Exports #
|
||||
# ========================================|======================================== #
|
||||
|
||||
__all__ = [
|
||||
'RetriableAsyncClient'
|
||||
]
|
||||
|
||||
# ========================================|======================================== #
|
||||
# Imports #
|
||||
# ========================================|======================================== #
|
||||
|
||||
from httpx import (
|
||||
AsyncClient,
|
||||
|
||||
ConnectTimeout,
|
||||
PoolTimeout,
|
||||
ReadTimeout,
|
||||
WriteTimeout,
|
||||
)
|
||||
|
||||
# ========================================|======================================== #
|
||||
# Class Definitions #
|
||||
# ========================================|======================================== #
|
||||
|
||||
|
||||
class RetriableAsyncClient:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
client: AsyncClient,
|
||||
retries: int = 10,
|
||||
)-> AsyncClient:
|
||||
|
||||
self._client = client
|
||||
self._retries = retries
|
||||
|
||||
async def _request(self, method: str, **kwargs):
|
||||
attempt = self._retries
|
||||
|
||||
while True:
|
||||
try:
|
||||
return await getattr(self._client, method)(**kwargs)
|
||||
|
||||
except (
|
||||
ConnectTimeout,
|
||||
PoolTimeout,
|
||||
ReadTimeout,
|
||||
WriteTimeout,
|
||||
):
|
||||
if attempt <= 0:
|
||||
raise
|
||||
attempt -= 1
|
||||
|
||||
def __getattr__(self, name: str):
|
||||
attr = getattr(self._client, name)
|
||||
|
||||
if name in {"get", "post", "put", "delete", "patch", "options", "head"}:
|
||||
async def wrapper(**kwargs):
|
||||
return await self._request(name, **kwargs)
|
||||
return wrapper
|
||||
|
||||
return attr
|
||||
@@ -0,0 +1,65 @@
|
||||
# ========================================|======================================== #
|
||||
# Exports #
|
||||
# ========================================|======================================== #
|
||||
|
||||
__all__ = [
|
||||
'RetriableSyncClient'
|
||||
]
|
||||
|
||||
# ========================================|======================================== #
|
||||
# Imports #
|
||||
# ========================================|======================================== #
|
||||
|
||||
from httpx import (
|
||||
Client,
|
||||
|
||||
ConnectTimeout,
|
||||
PoolTimeout,
|
||||
ReadTimeout,
|
||||
WriteTimeout,
|
||||
)
|
||||
|
||||
# ========================================|======================================== #
|
||||
# Class Definitions #
|
||||
# ========================================|======================================== #
|
||||
|
||||
|
||||
class RetriableSyncClient:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
client: Client,
|
||||
retries: int = 10,
|
||||
)-> Client:
|
||||
|
||||
self._client = client
|
||||
self._retries = retries
|
||||
|
||||
def _request(self, method: str, **kwargs):
|
||||
attempt = self._retries
|
||||
|
||||
while True:
|
||||
try:
|
||||
return getattr(self._client, method)(**kwargs)
|
||||
|
||||
except (
|
||||
ConnectTimeout,
|
||||
PoolTimeout,
|
||||
ReadTimeout,
|
||||
WriteTimeout,
|
||||
):
|
||||
if attempt <= 0:
|
||||
raise
|
||||
attempt -= 1
|
||||
|
||||
def __getattr__(self, name: str):
|
||||
|
||||
attr = getattr(self._client, name)
|
||||
|
||||
if name in {"get", "post", "put", "delete", "patch", "options", "head"}:
|
||||
|
||||
def wrapper(**kwargs):
|
||||
return self._request(name, **kwargs)
|
||||
return wrapper
|
||||
|
||||
return attr
|
||||
@@ -0,0 +1,2 @@
|
||||
from .__RetriableAsyncClient import *
|
||||
from .__RetriableSyncClient import *
|
||||
@@ -1,4 +1,4 @@
|
||||
from .__tse_ifb import (
|
||||
EmsEngine_TseIfb_SyncClient,
|
||||
EmsEngine_TseIfb_ASyncClient
|
||||
EmsEngine_TseIfb_AsyncClient
|
||||
)
|
||||
@@ -13,17 +13,31 @@ from HedgeTech.Auth import AuthAsyncClient
|
||||
from PIL.Image import open as image_open
|
||||
from PIL.ImageFile import ImageFile
|
||||
from io import BytesIO
|
||||
from asyncio import sleep
|
||||
|
||||
# ========================================|======================================== #
|
||||
# Class Definitions #
|
||||
# ========================================|======================================== #
|
||||
class Order:
|
||||
|
||||
"""
|
||||
Represents a single trading order in EMS Engine.
|
||||
|
||||
This class provides methods to send, edit, check status,
|
||||
and delete an order after creation.
|
||||
|
||||
An Order instance is usually created via
|
||||
`EmsEngine_TseIfb_AsyncClient` methods.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
order_uuid : HexUUID,
|
||||
SendOrder_RequestInfo : dict,
|
||||
AuthASyncClient : AuthAsyncClient,
|
||||
SymbolNameOrIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -32,26 +46,99 @@ class Order:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
SymbolNameOrIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
):
|
||||
|
||||
"""
|
||||
Represents a stock order in the EMS Engine for TSE IFB.
|
||||
|
||||
This class allows sending, editing, deleting, and checking the status
|
||||
of a stock order using an asynchronous client.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
ValidityType : str
|
||||
Type of order validity ('DAY', 'GTC', 'GTD', 'FAK', 'FOK').
|
||||
ValidityDate : int
|
||||
Expiration date of the order (for 'GTD' type).
|
||||
SymbolNameOrIsin : str
|
||||
Symbol name or ISIN code of the security.
|
||||
Price : int
|
||||
Order price.
|
||||
Volume : int
|
||||
Order volume.
|
||||
is_deleted : bool
|
||||
True if the order has been deleted.
|
||||
OrderId : HexUUID | None
|
||||
Unique identifier of the order after submission.
|
||||
|
||||
Methods
|
||||
-------
|
||||
send()
|
||||
Sends the order asynchronously to the EMS engine.
|
||||
Edit(Order_ValidityType, ValidityDate, Price, Volume)
|
||||
Edits the existing order asynchronously.
|
||||
Status()
|
||||
Retrieves the current status of the order asynchronously.
|
||||
Delete()
|
||||
Deletes the order asynchronously.
|
||||
"""
|
||||
|
||||
|
||||
self.__AuthASyncClient = AuthASyncClient
|
||||
self.__order_uuid : HexUUID = order_uuid
|
||||
self.__SendOrder_RequestInfo = SendOrder_RequestInfo
|
||||
|
||||
self.ValidityType : str = Order_ValidityType
|
||||
self.ValidityDate : int = ValidityDate
|
||||
self.SymbolNameOrIsin : str = SymbolNameOrIsin
|
||||
self.Price : int = Price
|
||||
self.Volume : int = Volume
|
||||
self.is_deleted : bool = False
|
||||
|
||||
|
||||
self.OrderId : HexUUID | None = None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
async def send(self)-> None:
|
||||
|
||||
"""
|
||||
Sends the order to the EMS engine asynchronously.
|
||||
|
||||
If the order has not been sent before, it posts the request
|
||||
using the provided AuthAsyncClient.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> order = await client.Buy_by_Name(symbolName="اطلس", Price=100000, Volume=10)
|
||||
>>> await order.send()
|
||||
>>> print(order.OrderId)
|
||||
'953097ac6ced45ca8ef205b76ca6faf2'
|
||||
"""
|
||||
|
||||
if self.OrderId is None :
|
||||
|
||||
SendOrder_Response = await self.__AuthASyncClient.httpx_Client.post(**self.__SendOrder_RequestInfo)
|
||||
|
||||
match SendOrder_Response.status_code :
|
||||
|
||||
case 200 :
|
||||
|
||||
self.OrderId = SendOrder_Response.json()['Data']['order_uuid']
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
async def Edit(
|
||||
self,
|
||||
*,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -60,121 +147,214 @@ class Order:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> None:
|
||||
|
||||
Edit_response = await self.__AuthASyncClient.httpx_Client.patch(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/edit',
|
||||
data={
|
||||
'order_uuid' : self.__order_uuid,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
match Edit_response.status_code:
|
||||
|
||||
case 200:
|
||||
|
||||
Edit_response = Edit_response.json()
|
||||
|
||||
self.__order_uuid = Edit_response['Data']['order_uuid']
|
||||
self.ValidityType = Edit_response['Data']['order_validity_type']
|
||||
self.ValidityDate = ValidityDate
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(Edit_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(Edit_response.text)
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
@property
|
||||
async def Status(self)-> OrderStatus:
|
||||
|
||||
status_respnse = await self.__AuthASyncClient.httpx_Client.get(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/status',
|
||||
params={'order_uuid' : self.__order_uuid}
|
||||
)
|
||||
|
||||
match status_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
return status_respnse.json()['Data']
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(status_respnse.json()['detail']['Status']['Description']['en'])
|
||||
"""
|
||||
Edits an existing order asynchronously.
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(status_respnse.text)
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@property
|
||||
async def order_is_valid(self)-> bool:
|
||||
|
||||
status = await self.Status
|
||||
|
||||
if (status['Price'] == self.Price) and (
|
||||
status['Volume'] == self.Volume
|
||||
) and (status['ValidityType'] == self.ValidityType) and status['OrderInQueue']:
|
||||
|
||||
return True
|
||||
|
||||
else : return False
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@property
|
||||
async def Delete(self)-> bool :
|
||||
|
||||
Delete_respnse = await self.__AuthASyncClient.httpx_Client.delete(
|
||||
url= 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/delete',
|
||||
params={'order_uuid' : self.__order_uuid}
|
||||
)
|
||||
|
||||
Parameters
|
||||
----------
|
||||
Order_ValidityType : str
|
||||
The new order validity type.
|
||||
ValidityDate : int
|
||||
New expiration date if validity type is 'GTD'.
|
||||
Price : int
|
||||
New order price.
|
||||
Volume : int
|
||||
New order volume.
|
||||
|
||||
match Delete_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
self.is_deleted = True
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(Delete_respnse.json()['detail']['Status']['Description']['en'])
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> await order.Edit(Price=105, Volume=15)
|
||||
"""
|
||||
|
||||
case _ :
|
||||
if self.OrderId is not None:
|
||||
|
||||
Edit_response = await self.__AuthASyncClient.httpx_Client.patch(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/edit',
|
||||
data={
|
||||
'order_uuid' : self.OrderId,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
match Edit_response.status_code:
|
||||
|
||||
raise ValueError(Delete_respnse.text)
|
||||
case 200:
|
||||
|
||||
Edit_response = Edit_response.json()
|
||||
|
||||
self.OrderId = Edit_response['Data']['order_uuid']
|
||||
self.ValidityType = Edit_response['Data']['order_validity_type']
|
||||
self.ValidityDate = ValidityDate
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
async def Status(self)-> OrderStatus | None:
|
||||
|
||||
"""
|
||||
Retrieves the current status of the order asynchronously.
|
||||
|
||||
Returns
|
||||
-------
|
||||
OrderStatus | None
|
||||
A dictionary containing the current order status with the following keys:
|
||||
- order_uuid: HexUUID, unique identifier of the order.
|
||||
- order_status: 'InQueue' | 'Cancelled' | 'Broken' | 'Settled'
|
||||
- Price: int, the order price.
|
||||
- Volume: int, the original order volume.
|
||||
- RemainedVolume: int, volume remaining unexecuted.
|
||||
- ExecutedVolume: int, executed volume.
|
||||
- OrderSide: 'Buy' | 'Sell', the order side.
|
||||
- ValidityType: 'DAY' | 'GTC' | 'GTD', the type of order validity.
|
||||
- ValidityDate: int, expiration date if applicable.
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> status = await order.Status()
|
||||
>>> print(status)
|
||||
{
|
||||
'order_uuid': '953097ac6ced45ca8ef205b76ca6faf2',
|
||||
'order_status': 'InQueue',
|
||||
'Price': 100,
|
||||
'Volume': 10,
|
||||
'RemainedVolume': 10,
|
||||
'ExecutedVolume': 0,
|
||||
'OrderSide': 'Buy',
|
||||
'ValidityType': 'DAY',
|
||||
'ValidityDate': 0
|
||||
}
|
||||
"""
|
||||
|
||||
if self.OrderId is not None:
|
||||
|
||||
status_respnse = await self.__AuthASyncClient.httpx_Client.get(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/status',
|
||||
params={'order_uuid' : self.OrderId}
|
||||
)
|
||||
|
||||
match status_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
return status_respnse.json()['Data']
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
async def Delete(self)-> None:
|
||||
|
||||
"""
|
||||
Deletes the order asynchronously.
|
||||
|
||||
Sets `is_deleted` to True if successful.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> await order.Delete()
|
||||
>>> print(order.is_deleted)
|
||||
True
|
||||
"""
|
||||
|
||||
if self.OrderId is not None:
|
||||
|
||||
Delete_respnse = await self.__AuthASyncClient.httpx_Client.delete(
|
||||
url= 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/delete',
|
||||
params={'order_uuid' : self.OrderId}
|
||||
)
|
||||
|
||||
|
||||
match Delete_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
self.is_deleted = True
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# ================================================================================= #
|
||||
|
||||
class EmsEngine_TseIfb_ASyncClient:
|
||||
class EmsEngine_TseIfb_AsyncClient:
|
||||
|
||||
"""
|
||||
Asynchronous EMS Engine client for TSE/IFB markets.
|
||||
|
||||
This client manages authentication, OMS login,
|
||||
and order creation.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
AuthASyncClient : AuthAsyncClient,
|
||||
):
|
||||
|
||||
|
||||
"""
|
||||
Asynchronous client for interacting with the EMS Engine (TSE IFB).
|
||||
|
||||
Provides methods for logging in, retrieving CAPTCHA, and creating buy/sell orders
|
||||
by symbol name or ISIN.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
Customer_FullName : str | None
|
||||
Full name of the logged-in customer.
|
||||
Customer_TSEBourseCode : str | None
|
||||
TSE bourse code of the customer.
|
||||
oms_session : HexUUID | None
|
||||
Session token obtained after login.
|
||||
|
||||
Methods
|
||||
-------
|
||||
Get_Captcha(OMS)
|
||||
Retrieves the login CAPTCHA image asynchronously.
|
||||
|
||||
oms_login(username, password, captcha_value)
|
||||
Logs into the OMS asynchronously.
|
||||
|
||||
Buy_by_Name(Order_ValidityType, ValidityDate, symbolName, Price, Volume)
|
||||
Creates a new buy order by symbol name asynchronously.
|
||||
|
||||
Sell_by_Name(Order_ValidityType, ValidityDate, symbolName, Price, Volume)
|
||||
Creates a new sell order by symbol name asynchronously.
|
||||
|
||||
Buy_by_isin(Order_ValidityType, ValidityDate, symbolIsin, Price, Volume)
|
||||
Creates a new buy order by ISIN asynchronously.
|
||||
|
||||
Sell_by_isin(Order_ValidityType, ValidityDate, symbolIsin, Price, Volume)
|
||||
Creates a new sell order by ISIN asynchronously.
|
||||
"""
|
||||
|
||||
self.__AuthASyncClient = AuthASyncClient
|
||||
|
||||
self.Customer_FullName : str | None = None
|
||||
self.Customer_TSEBourseCode : str | None = None
|
||||
self.oms_session : str | None = None
|
||||
self.oms_session : HexUUID | None = None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@@ -187,6 +367,30 @@ class EmsEngine_TseIfb_ASyncClient:
|
||||
]
|
||||
)-> ImageFile:
|
||||
|
||||
"""
|
||||
Retrieves the CAPTCHA image for the specified OMS asynchronously.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
OMS : str
|
||||
OMS identifier ('Omex | Parsian' or 'Sahra | Karamad').
|
||||
|
||||
Returns
|
||||
-------
|
||||
ImageFile
|
||||
The CAPTCHA image object.
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If the request fails or returns an error.
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> captcha = await client.Get_Captcha('Omex | Parsian')
|
||||
>>> captcha.show()
|
||||
"""
|
||||
|
||||
Captcha = await self.__AuthASyncClient.httpx_Client.get(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/oms/login',
|
||||
params={'oms' : OMS }
|
||||
@@ -205,6 +409,34 @@ class EmsEngine_TseIfb_ASyncClient:
|
||||
password: str,
|
||||
captcha_value: str,
|
||||
) -> None :
|
||||
|
||||
"""
|
||||
Logs into the OMS asynchronously with provided credentials and CAPTCHA.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
username : str
|
||||
OMS username.
|
||||
password : str
|
||||
OMS password.
|
||||
captcha_value : str
|
||||
Solved CAPTCHA value.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If login fails or CAPTCHA is invalid.
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> await client.oms_login("user123", "pass123", "abcd")
|
||||
>>> print(client.oms_session)
|
||||
'session_token_here'
|
||||
"""
|
||||
|
||||
response = await self.__AuthASyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/oms/login',
|
||||
@@ -241,6 +473,9 @@ class EmsEngine_TseIfb_ASyncClient:
|
||||
async def Buy_by_Name(
|
||||
self,
|
||||
*,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -249,55 +484,70 @@ class EmsEngine_TseIfb_ASyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = await self.__AuthASyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/name',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
|
||||
match order_response.status_code:
|
||||
|
||||
|
||||
case 200:
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
|
||||
"""
|
||||
Creates a new buy order by symbol name asynchronously.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
Order_ValidityType : str
|
||||
Order validity type.
|
||||
ValidityDate : int
|
||||
Expiration date if validity type is 'GTD'.
|
||||
symbolName : str
|
||||
Symbol name of the security.
|
||||
Price : int
|
||||
Order price.
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
A new Order instance if OMS session exists, else None.
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> order = await client.Buy_by_Name(symbolName="اطلس", Price=100000, Volume=10)
|
||||
>>> await order.send()
|
||||
"""
|
||||
|
||||
await sleep(0)
|
||||
|
||||
if self.oms_session is not None:
|
||||
|
||||
return Order(
|
||||
AuthASyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/name',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
|
||||
async def Sell_by_Name(
|
||||
self,
|
||||
*,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -306,53 +556,69 @@ class EmsEngine_TseIfb_ASyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = await self.__AuthASyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/name',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
"""
|
||||
Creates a new sell order by symbol name asynchronously.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
Order_ValidityType : str
|
||||
Order validity type.
|
||||
ValidityDate : int
|
||||
Expiration date if validity type is 'GTD'.
|
||||
symbolName : str
|
||||
Symbol name of the security.
|
||||
Price : int
|
||||
Order price.
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
A new Order instance if OMS session exists, else None.
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> order = await client.Sell_by_Name(symbolName="اطلس", Price=100000, Volume=10)
|
||||
>>> await order.send()
|
||||
"""
|
||||
|
||||
match order_response.status_code:
|
||||
await sleep(0)
|
||||
|
||||
if self.oms_session is not None:
|
||||
|
||||
return Order(
|
||||
AuthASyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/name',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
case 200:
|
||||
else : return None
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
async def Buy_by_isin(
|
||||
self,
|
||||
*,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -361,54 +627,69 @@ class EmsEngine_TseIfb_ASyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = await self.__AuthASyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/isin',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
"""
|
||||
Creates a new buy order by symbol isin asynchronously.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
Order_ValidityType : str
|
||||
Order validity type.
|
||||
ValidityDate : int
|
||||
Expiration date if validity type is 'GTD'.
|
||||
symbolIsin : str
|
||||
Symbol name of the security.
|
||||
Price : int
|
||||
Order price.
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
A new Order instance if OMS session exists, else None.
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> order = await client.Buy_by_isin(symbolIsin="اطلس", Price=100000, Volume=10)
|
||||
>>> await order.send()
|
||||
"""
|
||||
|
||||
match order_response.status_code:
|
||||
await sleep(0)
|
||||
|
||||
if self.oms_session is not None:
|
||||
|
||||
|
||||
case 200:
|
||||
return Order(
|
||||
AuthASyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/isin',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
async def Sell_by_isin(
|
||||
self,
|
||||
*,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -417,47 +698,60 @@ class EmsEngine_TseIfb_ASyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = await self.__AuthASyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/isin',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
"""
|
||||
Creates a new sell order by symbol isin asynchronously.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
Order_ValidityType : str
|
||||
Order validity type.
|
||||
ValidityDate : int
|
||||
Expiration date if validity type is 'GTD'.
|
||||
symbolIsin : str
|
||||
Symbol name of the security.
|
||||
Price : int
|
||||
Order price.
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
A new Order instance if OMS session exists, else None.
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> order = await client.Sell_by_isin(symbolIsin="اطلس", Price=100000, Volume=10)
|
||||
>>> await order.send()
|
||||
"""
|
||||
|
||||
match order_response.status_code:
|
||||
|
||||
|
||||
case 200:
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
await sleep(0)
|
||||
|
||||
if self.oms_session is not None:
|
||||
|
||||
return Order(
|
||||
AuthASyncClient=self.__AuthASyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/isin',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@@ -20,11 +20,25 @@ from io import BytesIO
|
||||
|
||||
class Order:
|
||||
|
||||
"""
|
||||
Represents a single trading order in EMS Engine.
|
||||
|
||||
This class provides methods to send, edit, check status,
|
||||
and delete an order after creation.
|
||||
|
||||
An Order instance is usually created via
|
||||
`EmsEngine_TseIfb_SyncClient` methods.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
order_uuid : HexUUID,
|
||||
SendOrder_RequestInfo : dict,
|
||||
AuthSyncClient : AuthSyncClient,
|
||||
SymbolNameOrIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
ValidityDate : int = 0,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -32,14 +46,46 @@ class Order:
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
SymbolNameOrIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
):
|
||||
|
||||
"""
|
||||
Initialize a new Order object.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
SendOrder_RequestInfo : dict
|
||||
HTTP request configuration for sending the order.
|
||||
|
||||
AuthSyncClient : AuthSyncClient
|
||||
Authenticated HTTP client.
|
||||
|
||||
Order_ValidityType : Literal
|
||||
Order validity type.
|
||||
|
||||
ValidityDate : int
|
||||
Expiration date (for GTD orders).
|
||||
|
||||
SymbolNameOrIsin : str
|
||||
Symbol name or ISIN code.
|
||||
|
||||
Price : int
|
||||
Order price.
|
||||
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order = client.Buy_by_Name(
|
||||
... symbolName="اهرم",
|
||||
... Price=12000,
|
||||
... Volume=1000
|
||||
... )
|
||||
"""
|
||||
|
||||
self.__AuthSyncClient = AuthSyncClient
|
||||
self.__order_uuid : HexUUID = order_uuid
|
||||
self.__SendOrder_RequestInfo = SendOrder_RequestInfo
|
||||
|
||||
self.ValidityType : str = Order_ValidityType
|
||||
self.ValidityDate : int = ValidityDate
|
||||
self.SymbolNameOrIsin : str = SymbolNameOrIsin
|
||||
@@ -47,12 +93,57 @@ class Order:
|
||||
self.Volume : int = Volume
|
||||
self.is_deleted : bool = False
|
||||
|
||||
self.OrderId : HexUUID | None = None
|
||||
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
def send(self)-> None:
|
||||
|
||||
"""
|
||||
Send the order to the trading engine.
|
||||
|
||||
This method submits the order to EMS Engine
|
||||
and assigns OrderId on success.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Notes
|
||||
-----
|
||||
- Can be called only once.
|
||||
- Subsequent calls have no effect.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order.send()
|
||||
>>> print(order.OrderId)
|
||||
'0xA23F...'
|
||||
"""
|
||||
|
||||
if self.OrderId is None :
|
||||
|
||||
SendOrder_Response = self.__AuthSyncClient.httpx_Client.post(**self.__SendOrder_RequestInfo)
|
||||
|
||||
match SendOrder_Response.status_code :
|
||||
|
||||
case 200 :
|
||||
|
||||
self.OrderId = SendOrder_Response.json()['Data']['order_uuid']
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
def Edit(
|
||||
self,
|
||||
*,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -61,112 +152,230 @@ class Order:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> None:
|
||||
|
||||
Edit_response = self.__AuthSyncClient.httpx_Client.patch(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/edit',
|
||||
data={
|
||||
'order_uuid' : self.__order_uuid,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
match Edit_response.status_code:
|
||||
|
||||
case 200:
|
||||
|
||||
Edit_response = Edit_response.json()
|
||||
|
||||
self.__order_uuid = Edit_response['Data']['order_uuid']
|
||||
self.ValidityType = Edit_response['Data']['order_validity_type']
|
||||
self.ValidityDate = ValidityDate
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(Edit_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(Edit_response.text)
|
||||
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@property
|
||||
def Status(self)-> OrderStatus:
|
||||
|
||||
status_respnse = self.__AuthSyncClient.httpx_Client.get(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/status',
|
||||
params={'order_uuid' : self.__order_uuid}
|
||||
)
|
||||
|
||||
match status_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
return status_respnse.json()['Data']
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(status_respnse.json()['detail']['Status']['Description']['en'])
|
||||
"""
|
||||
Edit an existing order.
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(status_respnse.text)
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@property
|
||||
def order_is_valid(self)-> bool:
|
||||
|
||||
status = self.Status
|
||||
|
||||
if (status['Price'] == self.Price) and (
|
||||
status['Volume'] == self.Volume
|
||||
) and (status['ValidityType'] == self.ValidityType) and status['OrderInQueue']:
|
||||
|
||||
return True
|
||||
|
||||
else : return False
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@property
|
||||
def Delete(self)-> bool :
|
||||
|
||||
Delete_respnse = self.__AuthSyncClient.httpx_Client.delete(
|
||||
url= 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/delete',
|
||||
params={'order_uuid' : self.__order_uuid}
|
||||
)
|
||||
|
||||
Parameters
|
||||
----------
|
||||
Order_ValidityType : Literal
|
||||
New validity type.
|
||||
|
||||
match Delete_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
self.is_deleted = True
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(Delete_respnse.json()['detail']['Status']['Description']['en'])
|
||||
ValidityDate : int
|
||||
New expiration date.
|
||||
|
||||
Price : int
|
||||
New order price.
|
||||
|
||||
Volume : int
|
||||
New order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Raises
|
||||
------
|
||||
None
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order.Edit(Price=12500, Volume=800)
|
||||
"""
|
||||
|
||||
case _ :
|
||||
if self.OrderId is not None:
|
||||
|
||||
Edit_response = self.__AuthSyncClient.httpx_Client.patch(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/edit',
|
||||
data={
|
||||
'order_uuid' : self.OrderId,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
match Edit_response.status_code:
|
||||
|
||||
raise ValueError(Delete_respnse.text)
|
||||
case 200:
|
||||
|
||||
Edit_response = Edit_response.json()
|
||||
|
||||
self.OrderId = Edit_response['Data']['order_uuid']
|
||||
self.ValidityType = Edit_response['Data']['order_validity_type']
|
||||
self.ValidityDate = ValidityDate
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
def Status(self)-> OrderStatus | None:
|
||||
|
||||
"""
|
||||
Retrieve the current status of the order.
|
||||
|
||||
This method queries the EMS Engine and returns detailed
|
||||
execution and lifecycle information of the order.
|
||||
|
||||
Returns
|
||||
-------
|
||||
OrderStatus | None
|
||||
A dictionary containing order status information.
|
||||
|
||||
On success, the returned object contains the following fields:
|
||||
|
||||
- order_uuid : HexUUID
|
||||
Unique identifier of the order.
|
||||
|
||||
- order_status : Literal['InQueue', 'Cancelled', 'Broken', 'Settled']
|
||||
Current lifecycle state of the order.
|
||||
|
||||
* InQueue : Order is waiting for execution.
|
||||
* Cancelled : Order was cancelled.
|
||||
* Broken : Order was rejected or failed.
|
||||
* Settled : Order fully executed.
|
||||
|
||||
- Price : int
|
||||
Order price.
|
||||
|
||||
- Volume : int
|
||||
Total requested volume.
|
||||
|
||||
- RemainedVolume : int
|
||||
Remaining unexecuted volume.
|
||||
|
||||
- ExecutedVolume : int
|
||||
Total executed volume.
|
||||
|
||||
- OrderSide : Literal['Buy', 'Sell']
|
||||
Side of the order.
|
||||
|
||||
- ValidityType : Literal['DAY', 'GTC', 'GTD']
|
||||
Order validity type.
|
||||
|
||||
- ValidityDate : int
|
||||
Expiration date (for GTD orders).
|
||||
|
||||
Returns None if the request fails or if the order
|
||||
has not been sent yet.
|
||||
|
||||
Raises
|
||||
------
|
||||
None
|
||||
|
||||
Notes
|
||||
-----
|
||||
- This method requires a valid OrderId.
|
||||
- If OrderId is None, None is returned.
|
||||
- Network or server errors are silently ignored.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> status = order.Status()
|
||||
>>> print(status["order_status"])
|
||||
'Settled'
|
||||
|
||||
>>> print(status["ExecutedVolume"])
|
||||
1000
|
||||
|
||||
>>> if status["RemainedVolume"] == 0:
|
||||
... print("Order fully executed")
|
||||
|
||||
Example Output
|
||||
--------------
|
||||
{
|
||||
"order_uuid": "0xA91F23BC...",
|
||||
"order_status": "Settled",
|
||||
"Price": 12000,
|
||||
"Volume": 1000,
|
||||
"RemainedVolume": 0,
|
||||
"ExecutedVolume": 1000,
|
||||
"OrderSide": "Buy",
|
||||
"ValidityType": "DAY",
|
||||
"ValidityDate": 0
|
||||
}
|
||||
"""
|
||||
|
||||
if self.OrderId is not None:
|
||||
|
||||
status_respnse = self.__AuthSyncClient.httpx_Client.get(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/status',
|
||||
params={'order_uuid' : self.OrderId}
|
||||
)
|
||||
|
||||
match status_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
return status_respnse.json()['Data']
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
def Delete(self)-> None :
|
||||
|
||||
"""
|
||||
Cancel/Delete the order.
|
||||
|
||||
Sends delete request to EMS Engine.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Notes
|
||||
-----
|
||||
After deletion, `is_deleted` becomes True.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order.Delete()
|
||||
>>> print(order.is_deleted)
|
||||
True
|
||||
"""
|
||||
|
||||
if self.OrderId is not None:
|
||||
|
||||
Delete_respnse = self.__AuthSyncClient.httpx_Client.delete(
|
||||
url= 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/delete',
|
||||
params={'order_uuid' : self.OrderId}
|
||||
)
|
||||
|
||||
|
||||
match Delete_respnse.status_code :
|
||||
|
||||
case 200:
|
||||
|
||||
self.is_deleted = True
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
|
||||
else : return None
|
||||
|
||||
# ================================================================================= #
|
||||
|
||||
class EmsEngine_TseIfb_SyncClient:
|
||||
|
||||
"""
|
||||
Synchronous EMS Engine client for TSE/IFB markets.
|
||||
|
||||
This client manages authentication, OMS login,
|
||||
and order creation.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
AuthSyncClient : AuthSyncClient,
|
||||
@@ -190,6 +399,30 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
]
|
||||
)-> ImageFile:
|
||||
|
||||
"""
|
||||
Fetch captcha image for OMS login.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
OMS : Literal
|
||||
OMS provider name.
|
||||
|
||||
Returns
|
||||
-------
|
||||
ImageFile
|
||||
Captcha image.
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If server returns error.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> img = client.Get_Captcha("Omex | Parsian")
|
||||
>>> img.show()
|
||||
"""
|
||||
|
||||
Captcha = self.__AuthSyncClient.httpx_Client.get(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/oms/login',
|
||||
params={'oms' : OMS }
|
||||
@@ -207,7 +440,34 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
password: str,
|
||||
captcha_value: str,
|
||||
) -> None :
|
||||
"""
|
||||
Authenticate user in OMS system.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
username : str
|
||||
Trading account username.
|
||||
|
||||
password : str
|
||||
Trading account password.
|
||||
|
||||
captcha_value : str
|
||||
Captcha solution.
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If authentication fails.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> client.oms_login("user1", "pass123", "A7B9")
|
||||
"""
|
||||
|
||||
response = self.__AuthSyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/oms/login',
|
||||
data={
|
||||
@@ -245,6 +505,9 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
def Buy_by_Name(
|
||||
self,
|
||||
*,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -253,47 +516,60 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = self.__AuthSyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/name',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
"""
|
||||
Create a buy order using symbol name.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbolName : str
|
||||
Trading symbol name.
|
||||
|
||||
Price : int
|
||||
Order price.
|
||||
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
Order instance if logged in, otherwise None.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order = client.Buy_by_Name(
|
||||
... symbolName="اهرم",
|
||||
... Price=12000,
|
||||
... Volume=1000
|
||||
... )
|
||||
>>> order.send()
|
||||
"""
|
||||
|
||||
match order_response.status_code:
|
||||
if self.oms_session is not None:
|
||||
|
||||
return Order(
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/name',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
case 200:
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
else : return None
|
||||
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
@@ -302,6 +578,9 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
def Sell_by_Name(
|
||||
self,
|
||||
*,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -310,53 +589,69 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolName : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = self.__AuthSyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/name',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
"""
|
||||
Create a sell order using symbol name.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbolName : str
|
||||
Trading symbol name.
|
||||
|
||||
Price : int
|
||||
Order price.
|
||||
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
Order instance if logged in, otherwise None.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order = client.Sell_by_Name(
|
||||
... symbolName="اهرم",
|
||||
... Price=12000,
|
||||
... Volume=1000
|
||||
... )
|
||||
>>> order.send()
|
||||
"""
|
||||
|
||||
match order_response.status_code:
|
||||
if self.oms_session is not None:
|
||||
|
||||
return Order(
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/name',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
case 200:
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolName,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
def Buy_by_isin(
|
||||
self,
|
||||
*,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -365,54 +660,69 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = self.__AuthSyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/isin',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
"""
|
||||
Create a buy order using symbol isin.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbolIsin : str
|
||||
Trading symbol isin.
|
||||
|
||||
Price : int
|
||||
Order price.
|
||||
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
Order instance if logged in, otherwise None.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order = client.Buy_by_isin(
|
||||
... symbolName="اهرم",
|
||||
... Price=12000,
|
||||
... Volume=1000
|
||||
... )
|
||||
>>> order.send()
|
||||
"""
|
||||
|
||||
match order_response.status_code:
|
||||
if self.oms_session is not None:
|
||||
|
||||
return Order(
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/buy/isin',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
case 200:
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
def Sell_by_isin(
|
||||
self,
|
||||
*,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
Order_ValidityType : Literal[
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
@@ -421,47 +731,60 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
symbolIsin : str,
|
||||
Price : int,
|
||||
Volume :int,
|
||||
)-> Order:
|
||||
)-> Order | None:
|
||||
|
||||
order_response = self.__AuthSyncClient.httpx_Client.post(
|
||||
url='https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/isin',
|
||||
data={
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
)
|
||||
"""
|
||||
Create a sell order using symbol isin.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbolIsin : str
|
||||
Trading symbol isin.
|
||||
|
||||
Price : int
|
||||
Order price.
|
||||
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Order | None
|
||||
Order instance if logged in, otherwise None.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> order = client.Sell_by_isin(
|
||||
... symbolName="اهرم",
|
||||
... Price=12000,
|
||||
... Volume=1000
|
||||
... )
|
||||
>>> order.send()
|
||||
"""
|
||||
|
||||
match order_response.status_code:
|
||||
if self.oms_session is not None:
|
||||
|
||||
return Order(
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume,
|
||||
SendOrder_RequestInfo = {
|
||||
'url' : 'https://core.hedgetech.ir/ems-engine/tse-ifb/order/new/sell/isin',
|
||||
'data' : {
|
||||
'oms_session' : self.oms_session,
|
||||
'Order_ValidityType' : Order_ValidityType,
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
case 200:
|
||||
|
||||
order_response = order_response.json()
|
||||
|
||||
return Order(
|
||||
order_uuid=order_response['Data']['order_uuid'],
|
||||
AuthSyncClient=self.__AuthSyncClient,
|
||||
Order_ValidityType=Order_ValidityType,
|
||||
ValidityDate=ValidityDate,
|
||||
SymbolNameOrIsin = symbolIsin,
|
||||
Price=Price,
|
||||
Volume=Volume
|
||||
)
|
||||
|
||||
case 400:
|
||||
|
||||
raise ValueError(order_response.json()['detail']['Status']['Description']['en'])
|
||||
|
||||
case _ :
|
||||
|
||||
raise ValueError(order_response.text)
|
||||
else : return None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
from .__SyncClient import EmsEngine_TseIfb_SyncClient
|
||||
from .__AsyncClient import EmsEngine_TseIfb_ASyncClient
|
||||
from .__AsyncClient import EmsEngine_TseIfb_AsyncClient
|
||||
@@ -19,7 +19,7 @@ HexUUID = NewType("HexUUID", str)
|
||||
class OrderStatus(TypedDict):
|
||||
|
||||
order_uuid : HexUUID
|
||||
OrderInQueue : bool
|
||||
order_status : Literal['InQueue','Cancelled','Broken','Settled']
|
||||
Price : int
|
||||
Volume : int
|
||||
RemainedVolume : int
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "HedgeTech"
|
||||
version = "0.2.0b1"
|
||||
version = "0.2.2b0"
|
||||
description = "A unified, high-performance API layer that powers all trading infrastructure across the HedgeTech ecosystem, providing modular, scalable, and real-time interfaces for market data, order management, and execution systems."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
Reference in new issue
Block a user