architect-py 3.2.1__py3-none-any.whl → 3.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- architect_py/__init__.py,sha256=1S5KH1FNPb4rx92ez4CpJ-tqA4N6BnsBTl7-6NcBIu8,98
2
- architect_py/async_client.py,sha256=Btn5gOfQ2f02o5G7wLN_UtM_pfcWfDDTrT7HveziZk8,41720
3
- architect_py/client.py,sha256=8pANKT0tFDh7Ii2DsEQNkTNK_fA7erOctOtc_fVetS0,5545
4
- architect_py/client_protocol.py,sha256=j3YiGfAHWAdI2FFdPnYtS-jAx6248COAbZdaWG7fYWc,4809
1
+ architect_py/__init__.py,sha256=CGBtXmnPoqtLM61z3z8lsS6Lw1khL2xwgyf2BeNo9J8,98
2
+ architect_py/async_client.py,sha256=coQJ12Y_mvphqnQ6yxNynLS7YYl4FjfBiH66Q8OMX18,41944
3
+ architect_py/client.py,sha256=re5TBQnjniEUnXMrpO9-Hj8V6cP4KpczTOqXdZGxFOg,5663
4
+ architect_py/client_protocol.py,sha256=iII5v9pSm4mG6rikgOYQpDeN6WcH5oENDjGlWmHql90,4904
5
5
  architect_py/graphql_client/__init__.py,sha256=HscnI0xDeyLY2SveYrtDPJyA4Qir1sfoHC1JxuHWQZE,8955
6
6
  architect_py/graphql_client/base_model.py,sha256=o2d-DixASFCGztr3rTiGX0AwgFu7Awr7EgD70FI8a-I,620
7
7
  architect_py/graphql_client/cancel_all_orders_mutation.py,sha256=h8S_lUy7rdSu1UgcUloiX2CCnuPIDaPCmfL2X2MOq8Y,352
@@ -46,8 +46,12 @@ architect_py/grpc_client/Algo/AlgoOrderForTwapAlgo.py,sha256=0wy8x1SdmtakFwLccFx
46
46
  architect_py/grpc_client/Algo/CreateAlgoOrderRequestForTwapAlgo.py,sha256=Xl0yzCYMRITPb13HUFSpGJL_DwUSNxE0LTF8lPTHcS4,1809
47
47
  architect_py/grpc_client/Algo/ModifyAlgoOrderRequestForTwapAlgo.py,sha256=qZ_osRuqnbrWprDmjA7I6hw7r1dmuMvDdAhYZ6bthyM,1205
48
48
  architect_py/grpc_client/Algo/__init__.py,sha256=PdhPxuRZD3EWWUOG4cnz3WqTKn7jOOBeUZ_BzeELbNc,67
49
- architect_py/grpc_client/Cpty/CptyRequest.py,sha256=zUqwvkwHs-4lWughh8gc-Ivm87vDc53zNiqACyshEws,1653
50
- architect_py/grpc_client/Cpty/CptyResponse.py,sha256=sg8yWjebOgvJD33OdSjz9YA3cwFjA-GMacAt1HH8YXk,2895
49
+ architect_py/grpc_client/Cpty/CptyRequest.py,sha256=2ZaPHL0MsnN28Oo5dwBboG-pY-rJWm5HaSTRR2XeK_0,1722
50
+ architect_py/grpc_client/Cpty/CptyResponse.py,sha256=ro0pyU3J8G4pMx9SxAkJIzYj3L5l4Q273fflCi7OiYM,2898
51
+ architect_py/grpc_client/Cpty/CptyStatus.py,sha256=ZsuFuj761n82HCIX1x5ptA9J13u-FtaQwYKdsmgurC8,1434
52
+ architect_py/grpc_client/Cpty/CptyStatusRequest.py,sha256=PvDplhmzZPNcuy2OBH2BfHG109xsCrCpW_kLq5j-THg,1038
53
+ architect_py/grpc_client/Cpty/CptysRequest.py,sha256=Yo1vebJZkv52B-w2ABkxmwXCT_d-PplDktHzdBvxlwM,812
54
+ architect_py/grpc_client/Cpty/CptysResponse.py,sha256=x6xRw14sfDY3vsBMQbOy9xQiAS-JcHrtYWHeIRG34bU,579
51
55
  architect_py/grpc_client/Cpty/__init__.py,sha256=PdhPxuRZD3EWWUOG4cnz3WqTKn7jOOBeUZ_BzeELbNc,67
52
56
  architect_py/grpc_client/Folio/AccountHistoryRequest.py,sha256=kvzs3IewDe5XKnntqrNEx1dm1NCehdgE-wOoDFtvq0Q,1418
53
57
  architect_py/grpc_client/Folio/AccountHistoryResponse.py,sha256=YXjoM4yoJSVV9sC514hfNscVnSk46yWV39bAAvkV_Wg,633
@@ -55,8 +59,6 @@ architect_py/grpc_client/Folio/AccountSummariesRequest.py,sha256=ZSOxFC9yErHj-iC
55
59
  architect_py/grpc_client/Folio/AccountSummariesResponse.py,sha256=bdkgXndmG06q94bkJRVsmJSqBTODMcOUqf6fcniufWA,689
56
60
  architect_py/grpc_client/Folio/AccountSummary.py,sha256=6-vpF_rTCDQyo5yRcrecIS6Lpdr6Fw8L3fUyI4joapU,3644
57
61
  architect_py/grpc_client/Folio/AccountSummaryRequest.py,sha256=an_dgK-vupkKJvDtm8bNtPJP-7eETXn9H03gAHkj590,1013
58
- architect_py/grpc_client/Folio/AggregatedAccountSummariesRequest.py,sha256=FsyKDVM5lTJuoju_2mfJBHFlkiUMjtgL9sXaWvsynxU,1686
59
- architect_py/grpc_client/Folio/AggregatedAccountSummariesResponse.py,sha256=DKzB7Hfz4EaqbNzYNc3lyoPJ5QZG9dyOeOfKZ5jG77c,747
60
62
  architect_py/grpc_client/Folio/HistoricalFillsRequest.py,sha256=cKkipWnPYcK9d_YZa3Z5A0ymOV00--qzC9ryOvzZKmU,2146
61
63
  architect_py/grpc_client/Folio/HistoricalFillsResponse.py,sha256=Wtds3tCbX_7XnkLgH_77Qns0PXKptMww1wop1VUZVJY,786
62
64
  architect_py/grpc_client/Folio/HistoricalOrdersRequest.py,sha256=_4KhbT5D_C-f6_oIs0q_AmRMkNog_kSedGcQyT867b0,2575
@@ -86,7 +88,7 @@ architect_py/grpc_client/Marketdata/SubscribeLiquidationsRequest.py,sha256=RDRkS
86
88
  architect_py/grpc_client/Marketdata/SubscribeManyCandlesRequest.py,sha256=6YF3eVPH64iHWO5FcfezR7PZP3mDCn8OhnsJGkQUPgU,1523
87
89
  architect_py/grpc_client/Marketdata/SubscribeTickersRequest.py,sha256=2bxGr4jXwMrCcR2nzJtOfO5kJTHckVN4YLEJofYC4iA,1448
88
90
  architect_py/grpc_client/Marketdata/SubscribeTradesRequest.py,sha256=GPKWAgZBAGHx1StLZABZhS5akSAuzt-iGo1v_qqVBTM,1310
89
- architect_py/grpc_client/Marketdata/Ticker.py,sha256=l4tlb9Cay2ACWrEj_1x5ZAOWapWSXKg2ysoVERLHTHI,10674
91
+ architect_py/grpc_client/Marketdata/Ticker.py,sha256=vtmJI1FXzDFoIjQNTy02eMmcC7XQTwfc38ksWBpPsV8,11102
90
92
  architect_py/grpc_client/Marketdata/TickerRequest.py,sha256=8tBrA3Qf-iaVcidZYzXM4Y3EYr3loOeJy-Fz7gXICAk,1019
91
93
  architect_py/grpc_client/Marketdata/TickerUpdate.py,sha256=sJ4wvCeGckMV30HwAcAsEMQbCzjN31OxF19q70jdxok,437
92
94
  architect_py/grpc_client/Marketdata/TickersRequest.py,sha256=2AXUtlpHoFEFL2-3tSIWxl6XW03-5k_4mmaz4twUa7s,1449
@@ -107,7 +109,7 @@ architect_py/grpc_client/Oms/__init__.py,sha256=PdhPxuRZD3EWWUOG4cnz3WqTKn7jOOBe
107
109
  architect_py/grpc_client/Orderflow/Dropcopy.py,sha256=hjcGXX1V-pWJNjirLW2a2-oLbb9WUw_h1nhFh-hPthM,621
108
110
  architect_py/grpc_client/Orderflow/DropcopyRequest.py,sha256=vPrmiXke5VZsWTy7qFz8eLe89sFUdrtXdz7uffPCN-o,1842
109
111
  architect_py/grpc_client/Orderflow/Orderflow.py,sha256=5y8d33GvVspOg5Nn_kXrV3VYKCts-MXiiFevrpRTORA,1894
110
- architect_py/grpc_client/Orderflow/OrderflowRequest.py,sha256=fghe41IVxNaybx1kYhruUg874bPzLiesuyCGGF1uF0A,1573
112
+ architect_py/grpc_client/Orderflow/OrderflowRequest.py,sha256=RePxrbg3_PP3DQOTQvEztG5zd9RcukQ8yutaGXQt334,1646
111
113
  architect_py/grpc_client/Orderflow/SubscribeOrderflowRequest.py,sha256=kqQMIB75k9MzqlrAu0ScQKw2huOWePlScQRN02HkoqQ,2100
112
114
  architect_py/grpc_client/Orderflow/__init__.py,sha256=PdhPxuRZD3EWWUOG4cnz3WqTKn7jOOBeUZ_BzeELbNc,67
113
115
  architect_py/grpc_client/Symbology/PruneExpiredSymbolsRequest.py,sha256=AUEDzBLmUKVfedG5c-U62EH4fJase1BfUlX5rvLt_0k,1442
@@ -122,25 +124,25 @@ architect_py/grpc_client/Symbology/UploadSymbologyRequest.py,sha256=gbx9MpQvjCen
122
124
  architect_py/grpc_client/Symbology/UploadSymbologyResponse.py,sha256=icEsRoE4g9hANqQjzsQm3SG8mMYAFTx9GgIvP-ST9qw,455
123
125
  architect_py/grpc_client/Symbology/__init__.py,sha256=PdhPxuRZD3EWWUOG4cnz3WqTKn7jOOBeUZ_BzeELbNc,67
124
126
  architect_py/grpc_client/__init__.py,sha256=LhTJC_UL_Ke_5CB_QtXwenh9z5ZMMrL_BKqi_bRkWls,117
125
- architect_py/grpc_client/definitions.py,sha256=JvF9bz1AAKw7l1he14mH7Pm4-TPmkVXes1roVQFOG60,83099
126
- architect_py/grpc_client/grpc_client.py,sha256=Q_vwn1UwmmhSA9429rKPwH_K1y6buo07MDMKNYN-eOI,14301
127
- architect_py/grpc_client/grpc_server.py,sha256=7djvUu2AfYXKKcukqAAlN9Z50xG-kz_XUXUuOCgZzzs,2017
127
+ architect_py/grpc_client/definitions.py,sha256=2ygMVs_4hSH_nIllqhXZRQhHuebiRnYMMTDi9XFlcQU,79661
128
+ architect_py/grpc_client/grpc_client.py,sha256=wMike5O8_Bej5glbpEVQpMy3vEfUy9QKZwr8J-r6TB0,14544
129
+ architect_py/grpc_client/grpc_server.py,sha256=j8WmtwLqEOixp9PRL03z3biWy7kaFQgd50SKI6vhI3k,1842
128
130
  architect_py/scalars.py,sha256=fPGkAC9MWUaTyCj7N7jXBPoPJk5yWPkcC7a-XUMN-u4,4948
129
131
  architect_py/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
130
- architect_py/tests/conftest.py,sha256=AwjV0Tn-KxMepR6GYya_bgyd8bSaIMCm7dez7DG4vJg,3410
132
+ architect_py/tests/conftest.py,sha256=DkDfPkw1XxIgSuIrqZcOpYVctUwP6ASAy3WbCq-sV8s,3490
131
133
  architect_py/tests/test_accounts.py,sha256=DyYZBcxc9x5aRNOLwUjEHGZQcdKRcQEMv7-zG4ddn-c,849
132
134
  architect_py/tests/test_book_building.py,sha256=eb1DcTuwo8dEQDkxpboh9zl7ApjB901Q7IbqH3jSbqo,1139
133
135
  architect_py/tests/test_client.py,sha256=_EfRGRLGR5mIqbUM7ez32JBzFMd16htIf0523E-tu-0,916
134
136
  architect_py/tests/test_grpc_client.py,sha256=4W_3dsbO2HawizT_6uItToGnhFn5ZwVoO-TSiRNzdSE,914
135
- architect_py/tests/test_order_sending.py,sha256=1uRMOBsONxLSPhXTUyWkZC4E3tGPCEVHcriFlCmu_-0,1908
137
+ architect_py/tests/test_order_sending.py,sha256=NblWQOeH8-vBqDRtNz82ItNTQQWRGjaT14wA3TTWdsM,2044
136
138
  architect_py/tests/test_rounding.py,sha256=OU4-vbr5UWx8d8V5OSNKPsCrfOXuePCupCn4sKkYyAc,1361
137
139
  architect_py/tests/test_snapshots.py,sha256=quSEdeG6nTXfqVauGrSYs82YSX7kTVHjc4HPLzb24Yg,1470
138
- architect_py/tests/test_subscriptions.py,sha256=9DZyaQIF8sjoiH9jMIQEBrMKjHNIoRn9BSQwm9Sajow,3789
140
+ architect_py/tests/test_subscriptions.py,sha256=zjTnwnrgMHC74Q3gU9Y5HtqbViIflvqZVcXKQjRiGUg,3717
139
141
  architect_py/tests/test_symbology.py,sha256=tLRFyUkcKWQka0RGZIvy71oJ1vxzL412ws1hyw2eFA4,2536
140
142
  architect_py/utils/nearest_tick.py,sha256=RUww8pv0WioPJ5ilP9un68JIpqN_3HdEUskk2H6ePTI,4813
141
143
  architect_py/utils/nearest_tick_2.py,sha256=CpcR3OnAsiBYrUlw--fRdkSRY4q_ADrmfWXB4uJixHo,3642
142
144
  architect_py/utils/price_bands.py,sha256=AKln6uZlLy4AVOaBBnn-ZvhxuTpWFjtyTbfJJ4NpSHQ,21951
143
- architect_py-3.2.1.dist-info/LICENSE,sha256=6P0_5gYN8iPWPZeqA9nxiO3tRQmcSA1ijAVR7C8j1SI,11362
144
- architect_py-3.2.1.dist-info/METADATA,sha256=O1lI22nfLxnL3i8vGD-EK-N8d_cyHslouxte1BdCyKw,8637
145
- architect_py-3.2.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
146
- architect_py-3.2.1.dist-info/RECORD,,
145
+ architect_py-3.2.2.dist-info/LICENSE,sha256=6P0_5gYN8iPWPZeqA9nxiO3tRQmcSA1ijAVR7C8j1SI,11362
146
+ architect_py-3.2.2.dist-info/METADATA,sha256=tu4EfbwdC4X8Kn-2BkSuApYYvN7ack_gZwiow--5iw4,7571
147
+ architect_py-3.2.2.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
148
+ architect_py-3.2.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,59 +0,0 @@
1
- # generated by datamodel-codegen:
2
- # filename: Folio/AggregatedAccountSummariesRequest.json
3
-
4
- from __future__ import annotations
5
- from architect_py.grpc_client.Folio.AggregatedAccountSummariesResponse import (
6
- AggregatedAccountSummariesResponse,
7
- )
8
-
9
- from typing import Annotated, List, Optional
10
-
11
- from msgspec import Meta, Struct
12
-
13
- from .. import definitions
14
-
15
-
16
- class AggregatedAccountSummariesRequest(Struct, omit_defaults=True):
17
- accounts: Optional[
18
- Annotated[
19
- List[definitions.AccountIdOrName],
20
- Meta(
21
- description="If trader and accounts are both None, return all accounts for the user"
22
- ),
23
- ]
24
- ] = None
25
- """
26
- If trader and accounts are both None, return all accounts for the user
27
- """
28
- trader: Optional[definitions.TraderIdOrEmail] = None
29
-
30
- # below is a constructor that takes all field titles as arguments for convenience
31
- @classmethod
32
- def new(
33
- cls,
34
- accounts: Optional[List[definitions.AccountIdOrName]] = None,
35
- trader: Optional[definitions.TraderIdOrEmail] = None,
36
- ):
37
- return cls(
38
- accounts,
39
- trader,
40
- )
41
-
42
- def __str__(self) -> str:
43
- return f"AggregatedAccountSummariesRequest(accounts={self.accounts},trader={self.trader})"
44
-
45
- @staticmethod
46
- def get_response_type():
47
- return AggregatedAccountSummariesResponse
48
-
49
- @staticmethod
50
- def get_unannotated_response_type():
51
- return AggregatedAccountSummariesResponse
52
-
53
- @staticmethod
54
- def get_route() -> str:
55
- return "/json.architect.Folio/AggregatedAccountSummaries"
56
-
57
- @staticmethod
58
- def get_rpc_method():
59
- return "unary"
@@ -1,27 +0,0 @@
1
- # generated by datamodel-codegen:
2
- # filename: Folio/AggregatedAccountSummariesResponse.json
3
-
4
- from __future__ import annotations
5
-
6
- from typing import List
7
-
8
- from msgspec import Struct
9
-
10
- from .. import definitions
11
-
12
-
13
- class AggregatedAccountSummariesResponse(Struct, omit_defaults=True):
14
- account_summaries: List[definitions.AggregatedAccountSummary]
15
-
16
- # below is a constructor that takes all field titles as arguments for convenience
17
- @classmethod
18
- def new(
19
- cls,
20
- account_summaries: List[definitions.AggregatedAccountSummary],
21
- ):
22
- return cls(
23
- account_summaries,
24
- )
25
-
26
- def __str__(self) -> str:
27
- return f"AggregatedAccountSummariesResponse(account_summaries={self.account_summaries})"
@@ -1,212 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: architect-py
3
- Version: 3.2.1
4
- Summary: Client library for the Architect trading platform.
5
- Author: Architect Financial Technologies, Inc.
6
- Author-email: hello@architect.xyz
7
- Requires-Python: >=3.10,<4
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: License :: OSI Approved :: Apache Software License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
- Requires-Dist: asyncio (>=3)
17
- Requires-Dist: dnspython (>=2.0)
18
- Requires-Dist: gql[httpx] (>=3.5.0,<4.0.0)
19
- Requires-Dist: grpcio (>=1.66.1)
20
- Requires-Dist: msgspec (>=0.19,<0.20)
21
- Requires-Dist: pydantic (>=2.10,<3.0)
22
- Requires-Dist: websockets (>=11)
23
- Description-Content-Type: text/markdown
24
-
25
- # architect_py
26
- [![PyPI version](https://img.shields.io/pypi/v/architect-py.svg)](https://pypi.org/project/architect-py/)
27
-
28
- A Python API for [Architect](https://architect.co).
29
-
30
- Just some of the features of this API:
31
- symbology, market snapshots, past trades, account queries, order management (including sending advanced algos!), and market feed subscriptions.
32
-
33
- This repo heavily uses type hinting, so using a type checker such as Pylance or mypy is suggestible to reduce potential for error.
34
-
35
-
36
- ## Example usage
37
-
38
- `AsyncClient` and `Client` are the entryways into making calls to the Architect backend.
39
- Note that the sync `Client` does not have access to any subscription functions, because they are async by nature.
40
-
41
-
42
- ```python
43
- import asyncio
44
-
45
- from architect_py.async_client import AsyncClient
46
- from architect_py.scalars import TradableProduct
47
-
48
- async def main():
49
- c = await AsyncClient.connect(
50
- host="<your installation domain>", # e.g. app.architect.co for the brokerage
51
- api_key="<api key>",
52
- api_secret="<api secret>"
53
- paper_trading=True,
54
- )
55
- print(await c.who_am_i())
56
-
57
- series = await async_client.get_cme_futures_series("ES CME Futures")
58
- front_ES_future = series[0][1]
59
-
60
- s = c.subscribe_trades_stream(front_ES_future)
61
- async for trade in s:
62
- print(trade)
63
-
64
- asyncio.run(main())
65
- ```
66
-
67
- ```python
68
- from architect_py.client import Client
69
-
70
- def main():
71
- c = Client(
72
- host="<your installation domain>",
73
- api_key="<api key>",
74
- api_secret="<api secret>"
75
- paper_trading=True,
76
- )
77
- print(c.who_am_i())
78
-
79
- print(client.get_account_summaries())
80
-
81
- print(client.search_symbols("ES"))
82
- ```
83
-
84
- While the AsyncClient is the recommended way to use the Architect API, the Client instead without any familiarity with `async/await`.
85
- The sync clients and async clients usage is identical, except one removes the `await` before the call. The only exception to this is that the sync client does not support any subscriptions, because they are inherently asynchronous.
86
-
87
- Check the `examples` folder or the `architect_py/tests` folders for example usages.
88
-
89
-
90
- ## Function Breakdown
91
-
92
-
93
- The `async` client has the following functions
94
- ```
95
- # Initialization
96
-
97
- connect: The main way to create an AsyncClient object.
98
- __init__: Users should not be using this constructor directly, unless they do not want to use any subscription methods.
99
-
100
- # Symbology
101
-
102
- search_symbols: Search for symbols in the Architect database.
103
- get_product_info: Get the product information (product_type, underlying, multiplier, etc.) for a symbol.
104
- get_product_infos: Get the product information (product_type, underlying, multiplier, etc.) for a list of symbols.
105
- get_execution_info: Get the execution information (tick_size, step_size, margin, etc.) for a symbol.
106
- get_execution_infos: Get the execution information (tick_size, step_size, etc.) for a list of symbols.
107
- get_cme_first_notice_date: Get the first notice date for a CME future.
108
- get_future_series: Get the series of futures for a given series symbol.
109
- get_expiration_from_CME_name: Get the expiration date from a CME future name.
110
- get_cme_futures_series: Get the futures in a series from the CME.
111
- get_cme_future_from_root_month_year: Get the symbol for a CME future from the root, month, and year.
112
-
113
- # Account Management
114
-
115
- who_am_i: Gets the user_id and user_email for the user that the API key belongs to.
116
- list_accounts: List accounts for the user that the API key belongs to.
117
- get_account_summary: Gets the account summary for the given account.
118
- get_account_summaries: Gets the account summaries for the given accounts and trader.
119
- get_account_history: Gets the account history for the given account and dates.
120
-
121
- # Order Management
122
-
123
- get_open_orders: Returns a list of open orders for the user that match the filters.
124
- get_all_open_orders: Returns a list of all open orders for the user.
125
- get_historical_orders: Gets the historical orders that match the filters.
126
- get_order: Returns the OrderFields object for the specified order.
127
- get_orders: Returns a list of OrderFields objects for the specified orders.
128
- get_fills: Returns a list of fills for the given filters.
129
-
130
- # Market Data
131
-
132
- get_market_status: Returns market status for symbol (ie if it is quoting and trading).
133
- get_market_snapshot: This is an alias for l1_book_snapshot.
134
- get_market_snapshots: This is an alias for l1_book_snapshot.
135
- get_historical_candles: Gets the historical candles for a symbol.
136
- get_l1_book_snapshot: Gets the L1 book snapshot for a symbol.
137
- get_l1_book_snapshots: Gets the L1 book snapshots for a list of symbols.
138
- get_l2_book_snapshot: Gets the L2 book snapshot for a symbol.
139
- subscribe_l1_book_stream: Subscribe to the stream of L1BookSnapshots for a symbol.
140
- subscribe_l2_book_stream: Subscribe to the stream of L2BookUpdates for a symbol.
141
- subscribe_l1_book: Returns a L1BookSnapshot object that is constantly updating in the background.
142
- subscribe_l2_book: Returns a L2BookSnapshot object that is constantly updating in the background.
143
- subscribe_trades_stream: Subscribe to a stream of trades for a symbol
144
- subscribe_candles_stream: Subscribe to a stream of candles for a symbol
145
-
146
- # Order Entry and Cancellation
147
-
148
- send_limit_order: Sends a regular limit order.
149
- send_market_pro_order: Sends a market-order like limit price based on the BBO.
150
- cancel_order: Cancels an order by order id.
151
- cancel_all_orders: Cancels all open orders.
152
- ```
153
-
154
-
155
- ### Running examples from this package
156
-
157
- Clone this repository to run examples in the `examples` directory. This package
158
- uses poetry for dependency management. To enter a poetry virtual environment, make
159
- sure you have [poetry](https://python-poetry.org/docs/) installed and run the
160
- following from the repository root.
161
-
162
- ```bash
163
- poetry shell
164
- poetry install --sync
165
-
166
- export ARCHITECT_HOST="<your installation domain>"
167
- export ARCHITECT_API_KEY="<api key>"
168
- export ARCHITECT_API_SECRET="<api secret>"
169
-
170
- python -m examples.trades
171
- ```
172
-
173
- You can exit the poetry shell by running `exit`. Environment variables set
174
- within the shell are not persisted.
175
-
176
-
177
- ## API keys for the brokerage
178
-
179
- API keys/secrets for the brokerage can be generated on the [user account page](https://app.architect.co/user/account).
180
-
181
-
182
- ## Maintainers
183
-
184
- Python type conversions for scalars should be added to the codegen toml files, if needed.
185
-
186
- Important files:
187
- - `schema.graphql`: autogenerated from `architect-gql schema`
188
- - `queries.graphql`: add any new queries/mutations
189
- - `generate_protocol.py`: autogenerates the `architect_py/protocol/client_protocol.py`
190
- - `architect_py/protocol/client_protocol.py`: autogenerated from `generate_protocol.py`, contains the class that the sync client inherits from
191
- - `architect_py/async_client.py`: inherits from the ariadne generated base client
192
- - `architect_py/client.py`: contains the sync client, delegates functions calls to a composed AsyncClient in the innards, inherits from the client_protocol to give the correct type hinting from Pylance
193
- - `tests` and `examples`: self-explanatory
194
-
195
- The purpose of the client_protocol.py is so that the sync client can inherit from it and users can get good code completion and get the correct typing on their function calls, because
196
- the type-checker would otherwise not play nice with the way the sync_client is using the getattr magic function.
197
-
198
- On any update, please run `update.sh` and update the version in the `version` file on the top level.
199
- To publish a version, run `poetry build` then `poetry publish`.
200
-
201
-
202
- In addition, any new function should have a test included in test.py
203
-
204
- To run tests:
205
- `export $(cat pytest.env | xargs)`
206
- `pytest tests/*`
207
-
208
- ### What does `update.sh` do?
209
-
210
- 1. Uses ariadne-codegen to generate the async client
211
- 2. Autogenerates the protocol that the sync client inherits from
212
-