New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

finatic-server-python

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

finatic-server-python - pypi Package Compare versions

Comparing version
0.9.1
to
0.9.3
+2
-1
demo-app/demo_cli.py

@@ -96,3 +96,4 @@ #!/usr/bin/env python3

paginated_data = orders["success"]["data"]
print(paginated_data)
print("orders length", len(paginated_data))
print("orders toJSON", paginated_data.to_dict())
if paginated_data.has_more:

@@ -99,0 +100,0 @@ print("orders has more")

+11
-11
Metadata-Version: 2.4
Name: finatic-server-python
Version: 0.9.1
Version: 0.9.3
Summary: Python SDK for Finatic Server API

@@ -24,12 +24,12 @@ Project-URL: Homepage, https://github.com/FinaticORG/FinaticServerSDK-Python

Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8.1
Requires-Dist: aiohttp-retry>=2.8.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: cachetools>=5.3.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dateutil>=2.8.0
Requires-Dist: structlog>=23.2.0
Requires-Dist: tenacity>=8.2.0
Requires-Dist: typing-extensions>=4.0.0
Requires-Dist: urllib3>=1.25.0
Requires-Python: >=3.9
Requires-Dist: aiohttp-retry>=2.9.1
Requires-Dist: aiohttp>=3.13.2
Requires-Dist: cachetools>=6.2.2
Requires-Dist: pydantic>=2.12.5
Requires-Dist: python-dateutil>=2.9.0.post0
Requires-Dist: structlog>=25.5.0
Requires-Dist: tenacity>=9.1.2
Requires-Dist: typing-extensions>=4.15.0
Requires-Dist: urllib3>=2.6.1
Provides-Extra: dev

@@ -36,0 +36,0 @@ Requires-Dist: black>=23.0.0; extra == 'dev'

@@ -7,3 +7,3 @@ [build-system]

name = "finatic-server-python"
version = "0.9.1"
version = "0.9.3"
description = "Python SDK for Finatic Server API"

@@ -13,3 +13,3 @@ authors = [{ name = "Finatic", email = "support@finatic.dev" }]

readme = "README.md"
requires-python = ">=3.8.1"
requires-python = ">=3.9"
classifiers = [

@@ -30,11 +30,11 @@ "Development Status :: 3 - Alpha",

dependencies = [
"aiohttp-retry>=2.8.0",
"aiohttp>=3.8.0",
"cachetools>=5.3.0",
"pydantic>=2.0.0",
"python-dateutil>=2.8.0",
"structlog>=23.2.0",
"tenacity>=8.2.0",
"typing-extensions>=4.0.0",
"urllib3>=1.25.0",
"aiohttp-retry>=2.9.1",
"aiohttp>=3.13.2",
"cachetools>=6.2.2",
"pydantic>=2.12.5",
"python-dateutil>=2.9.0.post0",
"structlog>=25.5.0",
"tenacity>=9.1.2",
"typing-extensions>=4.15.0",
"urllib3>=2.6.1",
]

@@ -41,0 +41,0 @@

@@ -46,3 +46,2 @@ # coding: utf-8

"BrokerDataOrderSideEnum",
"BrokerDataOrderStatusEnum",
"BrokerDataPositionStatusEnum",

@@ -210,3 +209,2 @@ "BrokerInfo",

from .models.broker_data_order_side_enum import BrokerDataOrderSideEnum as BrokerDataOrderSideEnum
from .models.broker_data_order_status_enum import BrokerDataOrderStatusEnum as BrokerDataOrderStatusEnum
from .models.broker_data_position_status_enum import BrokerDataPositionStatusEnum as BrokerDataPositionStatusEnum

@@ -213,0 +211,0 @@ from .models.broker_info import BrokerInfo as BrokerInfo

@@ -29,3 +29,2 @@ # coding: utf-8

from .broker_data_order_side_enum import BrokerDataOrderSideEnum
from .broker_data_order_status_enum import BrokerDataOrderStatusEnum
from .broker_data_position_status_enum import BrokerDataPositionStatusEnum

@@ -32,0 +31,0 @@ from .broker_info import BrokerInfo

@@ -45,2 +45,4 @@ # coding: utf-8

account_id: StrictStr = Field(description="Associated account identifier", alias="accountId")
internal_account_id: Optional[StrictStr] = Field(default=None, alias="internalAccountId")
connection_id: Optional[StrictStr] = Field(default=None, alias="connectionId")
balance_type: Balancetype = Field(alias="balanceType")

@@ -64,3 +66,3 @@ balance_name: Optional[StrictStr] = Field(default=None, alias="balanceName")

additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["_id", "balanceId", "accountId", "balanceType", "balanceName", "availableBalance", "currentBalance", "pendingBalance", "buyingPower", "cashBalance", "netLiquidationValue", "initialMargin", "maintenanceMargin", "totalCashValue", "availableToWithdraw", "totalRealizedPnl", "currencyCode", "balanceDate", "lastUpdated", "metadata"]
__properties: ClassVar[List[str]] = ["_id", "balanceId", "accountId", "internalAccountId", "connectionId", "balanceType", "balanceName", "availableBalance", "currentBalance", "pendingBalance", "buyingPower", "cashBalance", "netLiquidationValue", "initialMargin", "maintenanceMargin", "totalCashValue", "availableToWithdraw", "totalRealizedPnl", "currencyCode", "balanceDate", "lastUpdated", "metadata"]

@@ -149,2 +151,12 @@ model_config = ConfigDict(

# set to None if internal_account_id (nullable) is None
# and model_fields_set contains the field
if self.internal_account_id is None and "internal_account_id" in self.model_fields_set:
_dict['internalAccountId'] = None
# set to None if connection_id (nullable) is None
# and model_fields_set contains the field
if self.connection_id is None and "connection_id" in self.model_fields_set:
_dict['connectionId'] = None
# set to None if balance_name (nullable) is None

@@ -245,2 +257,4 @@ # and model_fields_set contains the field

"accountId": obj.get("accountId"),
"internalAccountId": obj.get("internalAccountId"),
"connectionId": obj.get("connectionId"),
"balanceType": Balancetype.from_dict(obj["balanceType"]) if obj.get("balanceType") is not None else None,

@@ -247,0 +261,0 @@ "balanceName": obj.get("balanceName"),

@@ -40,2 +40,3 @@ # coding: utf-8

account_id: StrictStr = Field(description="Broker account identifier", alias="accountId")
internal_account_id: Optional[StrictStr] = Field(default=None, alias="internalAccountId")
connection_id: Optional[StrictStr] = Field(default=None, alias="connectionId")

@@ -55,3 +56,3 @@ order_type: Optional[Ordertype] = Field(default=None, alias="orderType")

additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["_id", "orderId", "brokerOrderId", "clientOrderId", "accountId", "connectionId", "orderType", "orderClass", "timeInForce", "status", "state", "legs", "orderGroupId", "orderCreatedAt", "orderLiveAt", "orderUpdatedAt", "orderTerminalAt", "metadata"]
__properties: ClassVar[List[str]] = ["_id", "orderId", "brokerOrderId", "clientOrderId", "accountId", "internalAccountId", "connectionId", "orderType", "orderClass", "timeInForce", "status", "state", "legs", "orderGroupId", "orderCreatedAt", "orderLiveAt", "orderUpdatedAt", "orderTerminalAt", "metadata"]

@@ -133,2 +134,7 @@ model_config = ConfigDict(

# set to None if internal_account_id (nullable) is None
# and model_fields_set contains the field
if self.internal_account_id is None and "internal_account_id" in self.model_fields_set:
_dict['internalAccountId'] = None
# set to None if connection_id (nullable) is None

@@ -206,2 +212,3 @@ # and model_fields_set contains the field

"accountId": obj.get("accountId"),
"internalAccountId": obj.get("internalAccountId"),
"connectionId": obj.get("connectionId"),

@@ -208,0 +215,0 @@ "orderType": Ordertype.from_dict(obj["orderType"]) if obj.get("orderType") is not None else None,

@@ -46,2 +46,4 @@ # coding: utf-8

account_id: StrictStr = Field(description="Broker account identifier", alias="accountId")
internal_account_id: Optional[StrictStr] = Field(default=None, alias="internalAccountId")
connection_id: Optional[StrictStr] = Field(default=None, alias="connectionId")
security_id: StrictStr = Field(description="Security identifier", alias="securityId")

@@ -64,3 +66,3 @@ asset_type: Assettype = Field(alias="assetType")

additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["_id", "lotId", "positionId", "accountId", "securityId", "assetType", "side", "openedAt", "closedAt", "openQuantity", "remainingQuantity", "closedQuantity", "openPrice", "closePriceAvg", "costBasis", "costBasisWithCommission", "realizedProfitLoss", "realizedProfitLossWithCommission", "positionLotFills", "metadata"]
__properties: ClassVar[List[str]] = ["_id", "lotId", "positionId", "accountId", "internalAccountId", "connectionId", "securityId", "assetType", "side", "openedAt", "closedAt", "openQuantity", "remainingQuantity", "closedQuantity", "openPrice", "closePriceAvg", "costBasis", "costBasisWithCommission", "realizedProfitLoss", "realizedProfitLossWithCommission", "positionLotFills", "metadata"]

@@ -158,2 +160,12 @@ model_config = ConfigDict(

# set to None if internal_account_id (nullable) is None
# and model_fields_set contains the field
if self.internal_account_id is None and "internal_account_id" in self.model_fields_set:
_dict['internalAccountId'] = None
# set to None if connection_id (nullable) is None
# and model_fields_set contains the field
if self.connection_id is None and "connection_id" in self.model_fields_set:
_dict['connectionId'] = None
# set to None if side (nullable) is None

@@ -195,2 +207,4 @@ # and model_fields_set contains the field

"accountId": obj.get("accountId"),
"internalAccountId": obj.get("internalAccountId"),
"connectionId": obj.get("connectionId"),
"securityId": obj.get("securityId"),

@@ -197,0 +211,0 @@ "assetType": Assettype.from_dict(obj["assetType"]) if obj.get("assetType") is not None else None,

@@ -49,2 +49,3 @@ # coding: utf-8

account_id: StrictStr = Field(description="Broker account identifier", alias="accountId")
internal_account_id: Optional[StrictStr] = Field(default=None, alias="internalAccountId")
connection_id: StrictStr = Field(description="User-broker connection identifier", alias="connectionId")

@@ -77,3 +78,3 @@ security_id: StrictStr = Field(description="Symbol or instrument", alias="securityId")

additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["id", "accountId", "connectionId", "securityId", "securityIdType", "assetType", "quantity", "side", "status", "costBasis", "marketValue", "units", "averageBuyPrice", "averageSellPrice", "costBasisWithCommission", "currentPrice", "realizedProfitLoss", "realizedProfitLossWithCommission", "realizedProfitLossPercent", "unrealizedProfitLoss", "unrealizedProfitLossPercent", "positionCreatedAt", "positionUpdatedAt", "positionClosedAt", "positionGroupId", "snapshotDate", "instrumentKey", "metadata"]
__properties: ClassVar[List[str]] = ["id", "accountId", "internalAccountId", "connectionId", "securityId", "securityIdType", "assetType", "quantity", "side", "status", "costBasis", "marketValue", "units", "averageBuyPrice", "averageSellPrice", "costBasisWithCommission", "currentPrice", "realizedProfitLoss", "realizedProfitLossWithCommission", "realizedProfitLossPercent", "unrealizedProfitLoss", "unrealizedProfitLossPercent", "positionCreatedAt", "positionUpdatedAt", "positionClosedAt", "positionGroupId", "snapshotDate", "instrumentKey", "metadata"]

@@ -182,2 +183,7 @@ model_config = ConfigDict(

# set to None if internal_account_id (nullable) is None
# and model_fields_set contains the field
if self.internal_account_id is None and "internal_account_id" in self.model_fields_set:
_dict['internalAccountId'] = None
# set to None if side (nullable) is None

@@ -302,2 +308,3 @@ # and model_fields_set contains the field

"accountId": obj.get("accountId"),
"internalAccountId": obj.get("internalAccountId"),
"connectionId": obj.get("connectionId"),

@@ -304,0 +311,0 @@ "securityId": obj.get("securityId"),

@@ -193,2 +193,21 @@ """

def to_dict(self) -> list[T]:
"""
Return the items array as a list (for JSON serialization).
This allows clean serialization without exposing internal methods.
Use with json.dumps() default parameter for automatic serialization.
Returns:
The items array
Example:
>>> import json
>>> orders = await sdk.get_orders()
>>> print(orders) # Shows full PaginatedData with methods
>>> print(orders.to_dict()) # Shows just the items array
>>> json.dumps(orders, default=lambda o: o.to_dict() if hasattr(o, 'to_dict') else o.__dict__)
"""
return self.items
async def next_page(self) -> "PaginatedData[T]":

@@ -195,0 +214,0 @@ """

# coding: utf-8
"""
Finatic FastAPI Backend
FinaticAPI REST API
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class BrokerDataOrderStatusEnum(str, Enum):
"""
BrokerDataOrderStatusEnum
"""
"""
allowed enum values
"""
SUBMITTED = 'submitted'
NEW = 'new'
PARTIALLY_FILLED = 'partially_filled'
FILLED = 'filled'
PENDING_CANCEL = 'pending_cancel'
CANCELLED = 'cancelled'
REJECTED = 'rejected'
EXPIRED = 'expired'
CREATED = 'created'
RECEIVED = 'received'
QUEUED = 'queued'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of BrokerDataOrderStatusEnum from a JSON string"""
return cls(json.loads(json_str))

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display