diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f14b480..aaf968a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.2" + ".": "0.1.0-alpha.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 967b5f8..9eadf6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.1.0-alpha.3 (2024-07-10) + +Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/clear-street/studio-sdk-python/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) + +### Features + +* **api:** update via SDK Studio ([#10](https://github.com/clear-street/studio-sdk-python/issues/10)) ([284ea5b](https://github.com/clear-street/studio-sdk-python/commit/284ea5b1cae0af30bcd78cdc0048d3ec655312f7)) +* **api:** update via SDK Studio ([#11](https://github.com/clear-street/studio-sdk-python/issues/11)) ([796f671](https://github.com/clear-street/studio-sdk-python/commit/796f671499be4027923046db555c1119a4fa1b30)) +* **api:** update via SDK Studio ([#12](https://github.com/clear-street/studio-sdk-python/issues/12)) ([4f42bdc](https://github.com/clear-street/studio-sdk-python/commit/4f42bdc10992f6158c865781a0bdc70ae79b58e4)) +* **api:** update via SDK Studio ([#13](https://github.com/clear-street/studio-sdk-python/issues/13)) ([6a92603](https://github.com/clear-street/studio-sdk-python/commit/6a926036a955e0d5ce12a3b1ee7a01ca88698a20)) +* **api:** update via SDK Studio ([#14](https://github.com/clear-street/studio-sdk-python/issues/14)) ([181db49](https://github.com/clear-street/studio-sdk-python/commit/181db499eb8ba91afbf899bd2900d9893c4a941e)) +* **api:** update via SDK Studio ([#15](https://github.com/clear-street/studio-sdk-python/issues/15)) ([db742cc](https://github.com/clear-street/studio-sdk-python/commit/db742cc51159f5c9838c4695c84ed38d8f9df665)) +* **api:** update via SDK Studio ([#16](https://github.com/clear-street/studio-sdk-python/issues/16)) ([ca129f2](https://github.com/clear-street/studio-sdk-python/commit/ca129f2406b8e307a0f9c866d3433f901252bdfd)) +* **api:** update via SDK Studio ([#7](https://github.com/clear-street/studio-sdk-python/issues/7)) ([540756e](https://github.com/clear-street/studio-sdk-python/commit/540756eb7ce95eb3404ae9873ccfc310b1f52cac)) +* **api:** update via SDK Studio ([#9](https://github.com/clear-street/studio-sdk-python/issues/9)) ([5f6f844](https://github.com/clear-street/studio-sdk-python/commit/5f6f844097eeb52a6dad6a8e22676a4f84848c02)) + ## 0.1.0-alpha.2 (2024-07-09) Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/clear-street/studio-sdk-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0c9f8e..8bc2938 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock ## Modifying/Adding code Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/studio_minus_sdk/lib/` and `examples/` directories are exceptions and will never be overridden. +`src/studio_sdk/lib/` and `examples/` directories are exceptions and will never be overridden. ## Adding and running examples diff --git a/README.md b/README.md index 3dfd501..dff535c 100644 --- a/README.md +++ b/README.md @@ -15,24 +15,21 @@ The REST API documentation can be found [on docs.clearstreet.io](https://docs.cl ## Installation ```sh -# install from the production repo -pip install git+ssh://git@github.com/clear-street/studio-sdk-python.git +# install from PyPI +pip install --pre studio-sdk ``` -> [!NOTE] -> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre studio-sdk` - ## Usage The full API of this library can be found in [api.md](api.md). ```python -from studio_minus_sdk import StudioSDK +from studio_sdk import StudioSDK client = StudioSDK() entity = client.entities.retrieve( - "REPLACE_ME", + "", ) print(entity.entity_id) ``` @@ -48,14 +45,14 @@ Simply import `AsyncStudioSDK` instead of `StudioSDK` and use `await` with each ```python import asyncio -from studio_minus_sdk import AsyncStudioSDK +from studio_sdk import AsyncStudioSDK client = AsyncStudioSDK() async def main() -> None: entity = await client.entities.retrieve( - "REPLACE_ME", + "", ) print(entity.entity_id) @@ -76,29 +73,29 @@ Typed requests and responses provide autocomplete and documentation within your ## Handling errors -When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `studio_minus_sdk.APIConnectionError` is raised. +When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `studio_sdk.APIConnectionError` is raised. When the API returns a non-success status code (that is, 4xx or 5xx -response), a subclass of `studio_minus_sdk.APIStatusError` is raised, containing `status_code` and `response` properties. +response), a subclass of `studio_sdk.APIStatusError` is raised, containing `status_code` and `response` properties. -All errors inherit from `studio_minus_sdk.APIError`. +All errors inherit from `studio_sdk.APIError`. ```python -import studio_minus_sdk -from studio_minus_sdk import StudioSDK +import studio_sdk +from studio_sdk import StudioSDK client = StudioSDK() try: client.entities.retrieve( - "REPLACE_ME", + "", ) -except studio_minus_sdk.APIConnectionError as e: +except studio_sdk.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. -except studio_minus_sdk.RateLimitError as e: +except studio_sdk.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") -except studio_minus_sdk.APIStatusError as e: +except studio_sdk.APIStatusError as e: print("Another non-200-range status code was received") print(e.status_code) print(e.response) @@ -126,7 +123,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ You can use the `max_retries` option to configure or disable retry settings: ```python -from studio_minus_sdk import StudioSDK +from studio_sdk import StudioSDK # Configure the default for all requests: client = StudioSDK( @@ -136,7 +133,7 @@ client = StudioSDK( # Or, configure per-request: client.with_options(max_retries=5).entities.retrieve( - "REPLACE_ME", + "", ) ``` @@ -146,7 +143,7 @@ By default requests time out after 1 minute. You can configure this with a `time which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: ```python -from studio_minus_sdk import StudioSDK +from studio_sdk import StudioSDK # Configure the default for all requests: client = StudioSDK( @@ -161,7 +158,7 @@ client = StudioSDK( # Override per-request: client.with_options(timeout=5.0).entities.retrieve( - "REPLACE_ME", + "", ) ``` @@ -198,11 +195,11 @@ if response.my_field is None: The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g., ```py -from studio_minus_sdk import StudioSDK +from studio_sdk import StudioSDK client = StudioSDK() response = client.entities.with_raw_response.retrieve( - "REPLACE_ME", + "", ) print(response.headers.get('X-My-Header')) @@ -210,9 +207,9 @@ entity = response.parse() # get the object that `entities.retrieve()` would hav print(entity.entity_id) ``` -These methods return an [`APIResponse`](https://github.com/clear-street/studio-sdk-python/tree/main/src/studio_minus_sdk/_response.py) object. +These methods return an [`APIResponse`](https://github.com/clear-street/studio-sdk-python/tree/main/src/studio_sdk/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/clear-street/studio-sdk-python/tree/main/src/studio_minus_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/clear-street/studio-sdk-python/tree/main/src/studio_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -222,7 +219,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi ```python with client.entities.with_streaming_response.retrieve( - "REPLACE_ME", + "", ) as response: print(response.headers.get("X-My-Header")) @@ -276,7 +273,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality ```python -from studio_minus_sdk import StudioSDK, DefaultHttpxClient +from studio_sdk import StudioSDK, DefaultHttpxClient client = StudioSDK( # Or use the `STUDIO_SDK_BASE_URL` env var diff --git a/api.md b/api.md index 62dddc9..a5ec472 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,7 @@ # Shared Types ```python -from studio_minus_sdk.types import ( +from studio_sdk.types import ( LocateOrder, Order, PnlSummaryForAccount, @@ -16,82 +16,76 @@ from studio_minus_sdk.types import ( Types: ```python -from studio_minus_sdk.types import ( - Entity, - PnlSummary, - PortfolioMargin, - RegtMargin, - EntityListResponse, -) +from studio_sdk.types import Entity, PnlSummary, PortfolioMargin, RegtMargin, EntityListResponse ``` Methods: -- client.entities.retrieve(entity_id) -> Entity -- client.entities.list() -> EntityListResponse +- client.entities.retrieve(entity_id) -> Entity +- client.entities.list() -> EntityListResponse -## PnlSummary +## PnlSummaries Methods: -- client.entities.pnl_summary.retrieve(entity_id) -> PnlSummary +- client.entities.pnl_summaries.retrieve(entity_id) -> PnlSummary -## RegtMargin +## RegtMargins Methods: -- client.entities.regt_margin.retrieve(entity_id) -> RegtMargin +- client.entities.regt_margins.retrieve(entity_id) -> RegtMargin -## PortfolioMargin +## PortfolioMargins Methods: -- client.entities.portfolio_margin.retrieve(entity_id) -> PortfolioMargin +- client.entities.portfolio_margins.retrieve(entity_id) -> PortfolioMargin ## RegtMarginSimulations Types: ```python -from studio_minus_sdk.types.entities import SimulationID, RegtMarginSimulationCreateResponse +from studio_sdk.types.entities import SimulationID, RegtMarginSimulationCreateResponse ``` Methods: -- client.entities.regt_margin_simulations.create(entity_id, \*\*params) -> RegtMarginSimulationCreateResponse -- client.entities.regt_margin_simulations.retrieve(simulation_id, \*, entity_id) -> RegtMarginSimulation +- client.entities.regt_margin_simulations.create(entity_id, \*\*params) -> RegtMarginSimulationCreateResponse +- client.entities.regt_margin_simulations.retrieve(simulation_id, \*, entity_id) -> RegtMarginSimulation # Accounts Types: ```python -from studio_minus_sdk.types import Account, AccountListResponse +from studio_sdk.types import Account, AccountListResponse ``` Methods: -- client.accounts.retrieve(account_id) -> Account -- client.accounts.list() -> AccountListResponse +- client.accounts.retrieve(account_id) -> Account +- client.accounts.list() -> AccountListResponse ## BulkOrders Types: ```python -from studio_minus_sdk.types.accounts import BulkOrderCreateResponse +from studio_sdk.types.accounts import BulkOrderCreateResponse ``` Methods: -- client.accounts.bulk_orders.create(account_id, \*\*params) -> BulkOrderCreateResponse +- client.accounts.bulk_orders.create(account_id, \*\*params) -> BulkOrderCreateResponse ## Orders Types: ```python -from studio_minus_sdk.types.accounts import ( +from studio_sdk.types.accounts import ( OrderCreateResponse, OrderRetrieveResponse, OrderListResponse, @@ -101,91 +95,91 @@ from studio_minus_sdk.types.accounts import ( Methods: -- client.accounts.orders.create(account_id, \*\*params) -> OrderCreateResponse -- client.accounts.orders.retrieve(order_id, \*, account_id) -> OrderRetrieveResponse -- client.accounts.orders.list(account_id, \*\*params) -> OrderListResponse -- client.accounts.orders.delete(account_id, \*\*params) -> OrderDeleteResponse -- client.accounts.orders.cancel(order_id, \*, account_id) -> None +- client.accounts.orders.create(account_id, \*\*params) -> OrderCreateResponse +- client.accounts.orders.retrieve(order_id, \*, account_id) -> OrderRetrieveResponse +- client.accounts.orders.list(account_id, \*\*params) -> OrderListResponse +- client.accounts.orders.delete(account_id, \*\*params) -> OrderDeleteResponse +- client.accounts.orders.cancel(order_id, \*, account_id) -> None ## Trades Types: ```python -from studio_minus_sdk.types.accounts import TradeListResponse +from studio_sdk.types.accounts import TradeListResponse ``` Methods: -- client.accounts.trades.retrieve(trade_id, \*, account_id) -> Trade -- client.accounts.trades.list(account_id, \*\*params) -> TradeListResponse +- client.accounts.trades.retrieve(trade_id, \*, account_id) -> Trade +- client.accounts.trades.list(account_id, \*\*params) -> TradeListResponse ## Positions Types: ```python -from studio_minus_sdk.types.accounts import PositionListResponse +from studio_sdk.types.accounts import PositionListResponse ``` Methods: -- client.accounts.positions.retrieve(symbol, \*, account_id) -> Position -- client.accounts.positions.list(account_id, \*\*params) -> PositionListResponse +- client.accounts.positions.retrieve(symbol, \*, account_id) -> Position +- client.accounts.positions.list(account_id, \*\*params) -> PositionListResponse ## LocateOrders Types: ```python -from studio_minus_sdk.types.accounts import LocateOrderListResponse +from studio_sdk.types.accounts import LocateOrderListResponse ``` Methods: -- client.accounts.locate_orders.create(account_id, \*\*params) -> LocateOrder -- client.accounts.locate_orders.retrieve(locate_order_id, \*, account_id) -> LocateOrder -- client.accounts.locate_orders.update(locate_order_id, \*, account_id, \*\*params) -> None -- client.accounts.locate_orders.list(account_id) -> LocateOrderListResponse +- client.accounts.locate_orders.create(account_id, \*\*params) -> LocateOrder +- client.accounts.locate_orders.retrieve(locate_order_id, \*, account_id) -> LocateOrder +- client.accounts.locate_orders.update(locate_order_id, \*, account_id, \*\*params) -> None +- client.accounts.locate_orders.list(account_id) -> LocateOrderListResponse ## EasyBorrows Types: ```python -from studio_minus_sdk.types.accounts import EasyBorrowListResponse +from studio_sdk.types.accounts import EasyBorrowListResponse ``` Methods: -- client.accounts.easy_borrows.list(account_id) -> EasyBorrowListResponse +- client.accounts.easy_borrows.list(account_id) -> EasyBorrowListResponse ## PnlSummary Methods: -- client.accounts.pnl_summary.retrieve(account_id) -> PnlSummaryForAccount +- client.accounts.pnl_summary.retrieve(account_id) -> PnlSummaryForAccount ## PnlDetails Types: ```python -from studio_minus_sdk.types.accounts import PnlDetailListResponse +from studio_sdk.types.accounts import PnlDetailListResponse ``` Methods: -- client.accounts.pnl_details.list(account_id) -> PnlDetailListResponse +- client.accounts.pnl_details.list(account_id) -> PnlDetailListResponse # Instruments Types: ```python -from studio_minus_sdk.types import Instrument +from studio_sdk.types import Instrument ``` Methods: -- client.instruments.retrieve(symbol, \*\*params) -> Instrument +- client.instruments.retrieve(symbol, \*\*params) -> Instrument diff --git a/mypy.ini b/mypy.ini index 8f8b2d6..fd76e99 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,7 +5,7 @@ show_error_codes = True # Exclude _files.py because mypy isn't smart enough to apply # the correct type narrowing and as this is an internal module # it's fine to just use Pyright. -exclude = ^(src/studio_minus_sdk/_files\.py|_dev/.*\.py)$ +exclude = ^(src/studio_sdk/_files\.py|_dev/.*\.py)$ strict_equality = True implicit_reexport = True diff --git a/pyproject.toml b/pyproject.toml index f69b085..1d4b622 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "studio-sdk" -version = "0.1.0-alpha.2" +version = "0.1.0-alpha.3" description = "The official Python library for the studio-sdk API" dynamic = ["readme"] license = "Apache-2.0" @@ -85,7 +85,7 @@ typecheck = { chain = [ "typecheck:mypy" ]} "typecheck:pyright" = "pyright" -"typecheck:verify-types" = "pyright --verifytypes studio_minus_sdk --ignoreexternal" +"typecheck:verify-types" = "pyright --verifytypes studio_sdk --ignoreexternal" "typecheck:mypy" = "mypy ." [build-system] @@ -98,7 +98,7 @@ include = [ ] [tool.hatch.build.targets.wheel] -packages = ["src/studio_minus_sdk"] +packages = ["src/studio_sdk"] [tool.hatch.build.targets.sdist] # Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc) @@ -203,7 +203,7 @@ length-sort = true length-sort-straight = true combine-as-imports = true extra-standard-library = ["typing_extensions"] -known-first-party = ["studio_minus_sdk", "tests"] +known-first-party = ["studio_sdk", "tests"] [tool.ruff.per-file-ignores] "bin/**.py" = ["T201", "T203"] diff --git a/release-please-config.json b/release-please-config.json index 2c03e11..3854df1 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -61,6 +61,6 @@ ], "release-type": "python", "extra-files": [ - "src/studio_minus_sdk/_version.py" + "src/studio_sdk/_version.py" ] } \ No newline at end of file diff --git a/requirements-dev.lock b/requirements-dev.lock index 9551b86..7ac92ff 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -49,7 +49,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.7.1 +mypy==1.10.1 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 diff --git a/scripts/lint b/scripts/lint index 5b12ac3..3c8ed17 100755 --- a/scripts/lint +++ b/scripts/lint @@ -8,5 +8,5 @@ echo "==> Running lints" rye run lint echo "==> Making sure it imports" -rye run python -c 'import studio_minus_sdk' +rye run python -c 'import studio_sdk' diff --git a/src/studio_minus_sdk/_version.py b/src/studio_minus_sdk/_version.py deleted file mode 100644 index b200b9e..0000000 --- a/src/studio_minus_sdk/_version.py +++ /dev/null @@ -1,4 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -__title__ = "studio_minus_sdk" -__version__ = "0.1.0-alpha.2" # x-release-please-version diff --git a/src/studio_minus_sdk/resources/entities/__init__.py b/src/studio_minus_sdk/resources/entities/__init__.py deleted file mode 100644 index 3ee437d..0000000 --- a/src/studio_minus_sdk/resources/entities/__init__.py +++ /dev/null @@ -1,75 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .entities import ( - EntitiesResource, - AsyncEntitiesResource, - EntitiesResourceWithRawResponse, - AsyncEntitiesResourceWithRawResponse, - EntitiesResourceWithStreamingResponse, - AsyncEntitiesResourceWithStreamingResponse, -) -from .pnl_summary import ( - PnlSummaryResource, - AsyncPnlSummaryResource, - PnlSummaryResourceWithRawResponse, - AsyncPnlSummaryResourceWithRawResponse, - PnlSummaryResourceWithStreamingResponse, - AsyncPnlSummaryResourceWithStreamingResponse, -) -from .regt_margin import ( - RegtMarginResource, - AsyncRegtMarginResource, - RegtMarginResourceWithRawResponse, - AsyncRegtMarginResourceWithRawResponse, - RegtMarginResourceWithStreamingResponse, - AsyncRegtMarginResourceWithStreamingResponse, -) -from .portfolio_margin import ( - PortfolioMarginResource, - AsyncPortfolioMarginResource, - PortfolioMarginResourceWithRawResponse, - AsyncPortfolioMarginResourceWithRawResponse, - PortfolioMarginResourceWithStreamingResponse, - AsyncPortfolioMarginResourceWithStreamingResponse, -) -from .regt_margin_simulations import ( - RegtMarginSimulationsResource, - AsyncRegtMarginSimulationsResource, - RegtMarginSimulationsResourceWithRawResponse, - AsyncRegtMarginSimulationsResourceWithRawResponse, - RegtMarginSimulationsResourceWithStreamingResponse, - AsyncRegtMarginSimulationsResourceWithStreamingResponse, -) - -__all__ = [ - "PnlSummaryResource", - "AsyncPnlSummaryResource", - "PnlSummaryResourceWithRawResponse", - "AsyncPnlSummaryResourceWithRawResponse", - "PnlSummaryResourceWithStreamingResponse", - "AsyncPnlSummaryResourceWithStreamingResponse", - "RegtMarginResource", - "AsyncRegtMarginResource", - "RegtMarginResourceWithRawResponse", - "AsyncRegtMarginResourceWithRawResponse", - "RegtMarginResourceWithStreamingResponse", - "AsyncRegtMarginResourceWithStreamingResponse", - "PortfolioMarginResource", - "AsyncPortfolioMarginResource", - "PortfolioMarginResourceWithRawResponse", - "AsyncPortfolioMarginResourceWithRawResponse", - "PortfolioMarginResourceWithStreamingResponse", - "AsyncPortfolioMarginResourceWithStreamingResponse", - "RegtMarginSimulationsResource", - "AsyncRegtMarginSimulationsResource", - "RegtMarginSimulationsResourceWithRawResponse", - "AsyncRegtMarginSimulationsResourceWithRawResponse", - "RegtMarginSimulationsResourceWithStreamingResponse", - "AsyncRegtMarginSimulationsResourceWithStreamingResponse", - "EntitiesResource", - "AsyncEntitiesResource", - "EntitiesResourceWithRawResponse", - "AsyncEntitiesResourceWithRawResponse", - "EntitiesResourceWithStreamingResponse", - "AsyncEntitiesResourceWithStreamingResponse", -] diff --git a/src/studio_minus_sdk_minus_try_minus_to_minus_fix/lib/.keep b/src/studio_minus_sdk_minus_try_minus_to_minus_fix/lib/.keep new file mode 100644 index 0000000..5e2c99f --- /dev/null +++ b/src/studio_minus_sdk_minus_try_minus_to_minus_fix/lib/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store custom files to expand the SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/src/studio_minus_sdk/__init__.py b/src/studio_sdk/__init__.py similarity index 94% rename from src/studio_minus_sdk/__init__.py rename to src/studio_sdk/__init__.py index 47135d8..12dbebb 100644 --- a/src/studio_minus_sdk/__init__.py +++ b/src/studio_sdk/__init__.py @@ -82,12 +82,12 @@ # Update the __module__ attribute for exported symbols so that # error messages point to this module instead of the module # it was originally defined in, e.g. -# studio_minus_sdk._exceptions.NotFoundError -> studio_minus_sdk.NotFoundError +# studio_sdk._exceptions.NotFoundError -> studio_sdk.NotFoundError __locals = locals() for __name in __all__: if not __name.startswith("__"): try: - __locals[__name].__module__ = "studio_minus_sdk" + __locals[__name].__module__ = "studio_sdk" except (TypeError, AttributeError): # Some of our exported symbols are builtins which we can't set attributes for. pass diff --git a/src/studio_minus_sdk/_base_client.py b/src/studio_sdk/_base_client.py similarity index 100% rename from src/studio_minus_sdk/_base_client.py rename to src/studio_sdk/_base_client.py diff --git a/src/studio_minus_sdk/_client.py b/src/studio_sdk/_client.py similarity index 100% rename from src/studio_minus_sdk/_client.py rename to src/studio_sdk/_client.py diff --git a/src/studio_minus_sdk/_compat.py b/src/studio_sdk/_compat.py similarity index 100% rename from src/studio_minus_sdk/_compat.py rename to src/studio_sdk/_compat.py diff --git a/src/studio_minus_sdk/_constants.py b/src/studio_sdk/_constants.py similarity index 100% rename from src/studio_minus_sdk/_constants.py rename to src/studio_sdk/_constants.py diff --git a/src/studio_minus_sdk/_exceptions.py b/src/studio_sdk/_exceptions.py similarity index 100% rename from src/studio_minus_sdk/_exceptions.py rename to src/studio_sdk/_exceptions.py diff --git a/src/studio_minus_sdk/_files.py b/src/studio_sdk/_files.py similarity index 100% rename from src/studio_minus_sdk/_files.py rename to src/studio_sdk/_files.py diff --git a/src/studio_minus_sdk/_models.py b/src/studio_sdk/_models.py similarity index 99% rename from src/studio_minus_sdk/_models.py rename to src/studio_sdk/_models.py index 5d95bb4..eb7ce3b 100644 --- a/src/studio_minus_sdk/_models.py +++ b/src/studio_sdk/_models.py @@ -643,6 +643,14 @@ def validate_type(*, type_: type[_T], value: object) -> _T: return cast(_T, _validate_non_model_type(type_=type_, value=value)) +def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None: + """Add a pydantic config for the given type. + + Note: this is a no-op on Pydantic v1. + """ + setattr(typ, "__pydantic_config__", config) # noqa: B010 + + # our use of subclasssing here causes weirdness for type checkers, # so we just pretend that we don't subclass if TYPE_CHECKING: diff --git a/src/studio_minus_sdk/_qs.py b/src/studio_sdk/_qs.py similarity index 100% rename from src/studio_minus_sdk/_qs.py rename to src/studio_sdk/_qs.py diff --git a/src/studio_minus_sdk/_resource.py b/src/studio_sdk/_resource.py similarity index 100% rename from src/studio_minus_sdk/_resource.py rename to src/studio_sdk/_resource.py diff --git a/src/studio_minus_sdk/_response.py b/src/studio_sdk/_response.py similarity index 99% rename from src/studio_minus_sdk/_response.py rename to src/studio_sdk/_response.py index 4a4d2da..4bde36f 100644 --- a/src/studio_minus_sdk/_response.py +++ b/src/studio_sdk/_response.py @@ -204,7 +204,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): raise TypeError( - "Pydantic models must subclass our base model type, e.g. `from studio_minus_sdk import BaseModel`" + "Pydantic models must subclass our base model type, e.g. `from studio_sdk import BaseModel`" ) if ( @@ -273,7 +273,7 @@ def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from studio_minus_sdk import BaseModel + from studio_sdk import BaseModel class MyModel(BaseModel): @@ -377,7 +377,7 @@ async def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from studio_minus_sdk import BaseModel + from studio_sdk import BaseModel class MyModel(BaseModel): @@ -548,7 +548,7 @@ async def stream_to_file( class MissingStreamClassError(TypeError): def __init__(self) -> None: super().__init__( - "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `studio_minus_sdk._streaming` for reference", + "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `studio_sdk._streaming` for reference", ) diff --git a/src/studio_minus_sdk/_streaming.py b/src/studio_sdk/_streaming.py similarity index 100% rename from src/studio_minus_sdk/_streaming.py rename to src/studio_sdk/_streaming.py diff --git a/src/studio_minus_sdk/_types.py b/src/studio_sdk/_types.py similarity index 99% rename from src/studio_minus_sdk/_types.py rename to src/studio_sdk/_types.py index af499cb..fdee20a 100644 --- a/src/studio_minus_sdk/_types.py +++ b/src/studio_sdk/_types.py @@ -81,7 +81,7 @@ # This unfortunately means that you will either have # to import this type and pass it explicitly: # -# from studio_minus_sdk import NoneType +# from studio_sdk import NoneType # client.get('/foo', cast_to=NoneType) # # or build it yourself: diff --git a/src/studio_minus_sdk/_utils/__init__.py b/src/studio_sdk/_utils/__init__.py similarity index 100% rename from src/studio_minus_sdk/_utils/__init__.py rename to src/studio_sdk/_utils/__init__.py diff --git a/src/studio_minus_sdk/_utils/_logs.py b/src/studio_sdk/_utils/_logs.py similarity index 75% rename from src/studio_minus_sdk/_utils/_logs.py rename to src/studio_sdk/_utils/_logs.py index d2ede0c..7fd4c03 100644 --- a/src/studio_minus_sdk/_utils/_logs.py +++ b/src/studio_sdk/_utils/_logs.py @@ -1,12 +1,12 @@ import os import logging -logger: logging.Logger = logging.getLogger("studio_minus_sdk") +logger: logging.Logger = logging.getLogger("studio_sdk") httpx_logger: logging.Logger = logging.getLogger("httpx") def _basic_config() -> None: - # e.g. [2023-10-05 14:12:26 - studio_minus_sdk._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" + # e.g. [2023-10-05 14:12:26 - studio_sdk._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" logging.basicConfig( format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S", diff --git a/src/studio_minus_sdk/_utils/_proxy.py b/src/studio_sdk/_utils/_proxy.py similarity index 100% rename from src/studio_minus_sdk/_utils/_proxy.py rename to src/studio_sdk/_utils/_proxy.py diff --git a/src/studio_minus_sdk/_utils/_reflection.py b/src/studio_sdk/_utils/_reflection.py similarity index 100% rename from src/studio_minus_sdk/_utils/_reflection.py rename to src/studio_sdk/_utils/_reflection.py diff --git a/src/studio_minus_sdk/_utils/_streams.py b/src/studio_sdk/_utils/_streams.py similarity index 100% rename from src/studio_minus_sdk/_utils/_streams.py rename to src/studio_sdk/_utils/_streams.py diff --git a/src/studio_minus_sdk/_utils/_sync.py b/src/studio_sdk/_utils/_sync.py similarity index 100% rename from src/studio_minus_sdk/_utils/_sync.py rename to src/studio_sdk/_utils/_sync.py diff --git a/src/studio_minus_sdk/_utils/_transform.py b/src/studio_sdk/_utils/_transform.py similarity index 100% rename from src/studio_minus_sdk/_utils/_transform.py rename to src/studio_sdk/_utils/_transform.py diff --git a/src/studio_minus_sdk/_utils/_typing.py b/src/studio_sdk/_utils/_typing.py similarity index 100% rename from src/studio_minus_sdk/_utils/_typing.py rename to src/studio_sdk/_utils/_typing.py diff --git a/src/studio_minus_sdk/_utils/_utils.py b/src/studio_sdk/_utils/_utils.py similarity index 100% rename from src/studio_minus_sdk/_utils/_utils.py rename to src/studio_sdk/_utils/_utils.py diff --git a/src/studio_sdk/_version.py b/src/studio_sdk/_version.py new file mode 100644 index 0000000..4a604ba --- /dev/null +++ b/src/studio_sdk/_version.py @@ -0,0 +1,4 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +__title__ = "studio_sdk" +__version__ = "0.1.0-alpha.3" # x-release-please-version diff --git a/src/studio_sdk/lib/.keep b/src/studio_sdk/lib/.keep new file mode 100644 index 0000000..5e2c99f --- /dev/null +++ b/src/studio_sdk/lib/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store custom files to expand the SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/src/studio_minus_sdk/py.typed b/src/studio_sdk/py.typed similarity index 100% rename from src/studio_minus_sdk/py.typed rename to src/studio_sdk/py.typed diff --git a/src/studio_minus_sdk/resources/__init__.py b/src/studio_sdk/resources/__init__.py similarity index 100% rename from src/studio_minus_sdk/resources/__init__.py rename to src/studio_sdk/resources/__init__.py diff --git a/src/studio_minus_sdk/resources/accounts/__init__.py b/src/studio_sdk/resources/accounts/__init__.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/__init__.py rename to src/studio_sdk/resources/accounts/__init__.py diff --git a/src/studio_minus_sdk/resources/accounts/accounts.py b/src/studio_sdk/resources/accounts/accounts.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/accounts.py rename to src/studio_sdk/resources/accounts/accounts.py diff --git a/src/studio_minus_sdk/resources/accounts/bulk_orders.py b/src/studio_sdk/resources/accounts/bulk_orders.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/bulk_orders.py rename to src/studio_sdk/resources/accounts/bulk_orders.py diff --git a/src/studio_minus_sdk/resources/accounts/easy_borrows.py b/src/studio_sdk/resources/accounts/easy_borrows.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/easy_borrows.py rename to src/studio_sdk/resources/accounts/easy_borrows.py diff --git a/src/studio_minus_sdk/resources/accounts/locate_orders.py b/src/studio_sdk/resources/accounts/locate_orders.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/locate_orders.py rename to src/studio_sdk/resources/accounts/locate_orders.py diff --git a/src/studio_minus_sdk/resources/accounts/orders.py b/src/studio_sdk/resources/accounts/orders.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/orders.py rename to src/studio_sdk/resources/accounts/orders.py diff --git a/src/studio_minus_sdk/resources/accounts/pnl_details.py b/src/studio_sdk/resources/accounts/pnl_details.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/pnl_details.py rename to src/studio_sdk/resources/accounts/pnl_details.py diff --git a/src/studio_minus_sdk/resources/accounts/pnl_summary.py b/src/studio_sdk/resources/accounts/pnl_summary.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/pnl_summary.py rename to src/studio_sdk/resources/accounts/pnl_summary.py diff --git a/src/studio_minus_sdk/resources/accounts/positions.py b/src/studio_sdk/resources/accounts/positions.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/positions.py rename to src/studio_sdk/resources/accounts/positions.py diff --git a/src/studio_minus_sdk/resources/accounts/trades.py b/src/studio_sdk/resources/accounts/trades.py similarity index 100% rename from src/studio_minus_sdk/resources/accounts/trades.py rename to src/studio_sdk/resources/accounts/trades.py diff --git a/src/studio_sdk/resources/entities/__init__.py b/src/studio_sdk/resources/entities/__init__.py new file mode 100644 index 0000000..4e4ef1b --- /dev/null +++ b/src/studio_sdk/resources/entities/__init__.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .entities import ( + EntitiesResource, + AsyncEntitiesResource, + EntitiesResourceWithRawResponse, + AsyncEntitiesResourceWithRawResponse, + EntitiesResourceWithStreamingResponse, + AsyncEntitiesResourceWithStreamingResponse, +) +from .regt_margins import ( + RegtMarginsResource, + AsyncRegtMarginsResource, + RegtMarginsResourceWithRawResponse, + AsyncRegtMarginsResourceWithRawResponse, + RegtMarginsResourceWithStreamingResponse, + AsyncRegtMarginsResourceWithStreamingResponse, +) +from .pnl_summaries import ( + PnlSummariesResource, + AsyncPnlSummariesResource, + PnlSummariesResourceWithRawResponse, + AsyncPnlSummariesResourceWithRawResponse, + PnlSummariesResourceWithStreamingResponse, + AsyncPnlSummariesResourceWithStreamingResponse, +) +from .portfolio_margins import ( + PortfolioMarginsResource, + AsyncPortfolioMarginsResource, + PortfolioMarginsResourceWithRawResponse, + AsyncPortfolioMarginsResourceWithRawResponse, + PortfolioMarginsResourceWithStreamingResponse, + AsyncPortfolioMarginsResourceWithStreamingResponse, +) +from .regt_margin_simulations import ( + RegtMarginSimulationsResource, + AsyncRegtMarginSimulationsResource, + RegtMarginSimulationsResourceWithRawResponse, + AsyncRegtMarginSimulationsResourceWithRawResponse, + RegtMarginSimulationsResourceWithStreamingResponse, + AsyncRegtMarginSimulationsResourceWithStreamingResponse, +) + +__all__ = [ + "PnlSummariesResource", + "AsyncPnlSummariesResource", + "PnlSummariesResourceWithRawResponse", + "AsyncPnlSummariesResourceWithRawResponse", + "PnlSummariesResourceWithStreamingResponse", + "AsyncPnlSummariesResourceWithStreamingResponse", + "RegtMarginsResource", + "AsyncRegtMarginsResource", + "RegtMarginsResourceWithRawResponse", + "AsyncRegtMarginsResourceWithRawResponse", + "RegtMarginsResourceWithStreamingResponse", + "AsyncRegtMarginsResourceWithStreamingResponse", + "PortfolioMarginsResource", + "AsyncPortfolioMarginsResource", + "PortfolioMarginsResourceWithRawResponse", + "AsyncPortfolioMarginsResourceWithRawResponse", + "PortfolioMarginsResourceWithStreamingResponse", + "AsyncPortfolioMarginsResourceWithStreamingResponse", + "RegtMarginSimulationsResource", + "AsyncRegtMarginSimulationsResource", + "RegtMarginSimulationsResourceWithRawResponse", + "AsyncRegtMarginSimulationsResourceWithRawResponse", + "RegtMarginSimulationsResourceWithStreamingResponse", + "AsyncRegtMarginSimulationsResourceWithStreamingResponse", + "EntitiesResource", + "AsyncEntitiesResource", + "EntitiesResourceWithRawResponse", + "AsyncEntitiesResourceWithRawResponse", + "EntitiesResourceWithStreamingResponse", + "AsyncEntitiesResourceWithStreamingResponse", +] diff --git a/src/studio_minus_sdk/resources/entities/entities.py b/src/studio_sdk/resources/entities/entities.py similarity index 72% rename from src/studio_minus_sdk/resources/entities/entities.py rename to src/studio_sdk/resources/entities/entities.py index 5a3e8e9..2d752d5 100644 --- a/src/studio_minus_sdk/resources/entities/entities.py +++ b/src/studio_sdk/resources/entities/entities.py @@ -13,33 +13,33 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .pnl_summary import ( - PnlSummaryResource, - AsyncPnlSummaryResource, - PnlSummaryResourceWithRawResponse, - AsyncPnlSummaryResourceWithRawResponse, - PnlSummaryResourceWithStreamingResponse, - AsyncPnlSummaryResourceWithStreamingResponse, +from .regt_margins import ( + RegtMarginsResource, + AsyncRegtMarginsResource, + RegtMarginsResourceWithRawResponse, + AsyncRegtMarginsResourceWithRawResponse, + RegtMarginsResourceWithStreamingResponse, + AsyncRegtMarginsResourceWithStreamingResponse, ) -from .regt_margin import ( - RegtMarginResource, - AsyncRegtMarginResource, - RegtMarginResourceWithRawResponse, - AsyncRegtMarginResourceWithRawResponse, - RegtMarginResourceWithStreamingResponse, - AsyncRegtMarginResourceWithStreamingResponse, +from .pnl_summaries import ( + PnlSummariesResource, + AsyncPnlSummariesResource, + PnlSummariesResourceWithRawResponse, + AsyncPnlSummariesResourceWithRawResponse, + PnlSummariesResourceWithStreamingResponse, + AsyncPnlSummariesResourceWithStreamingResponse, ) from ..._base_client import ( make_request_options, ) from ...types.entity import Entity -from .portfolio_margin import ( - PortfolioMarginResource, - AsyncPortfolioMarginResource, - PortfolioMarginResourceWithRawResponse, - AsyncPortfolioMarginResourceWithRawResponse, - PortfolioMarginResourceWithStreamingResponse, - AsyncPortfolioMarginResourceWithStreamingResponse, +from .portfolio_margins import ( + PortfolioMarginsResource, + AsyncPortfolioMarginsResource, + PortfolioMarginsResourceWithRawResponse, + AsyncPortfolioMarginsResourceWithRawResponse, + PortfolioMarginsResourceWithStreamingResponse, + AsyncPortfolioMarginsResourceWithStreamingResponse, ) from .regt_margin_simulations import ( RegtMarginSimulationsResource, @@ -56,16 +56,16 @@ class EntitiesResource(SyncAPIResource): @cached_property - def pnl_summary(self) -> PnlSummaryResource: - return PnlSummaryResource(self._client) + def pnl_summaries(self) -> PnlSummariesResource: + return PnlSummariesResource(self._client) @cached_property - def regt_margin(self) -> RegtMarginResource: - return RegtMarginResource(self._client) + def regt_margins(self) -> RegtMarginsResource: + return RegtMarginsResource(self._client) @cached_property - def portfolio_margin(self) -> PortfolioMarginResource: - return PortfolioMarginResource(self._client) + def portfolio_margins(self) -> PortfolioMarginsResource: + return PortfolioMarginsResource(self._client) @cached_property def regt_margin_simulations(self) -> RegtMarginSimulationsResource: @@ -136,16 +136,16 @@ def list( class AsyncEntitiesResource(AsyncAPIResource): @cached_property - def pnl_summary(self) -> AsyncPnlSummaryResource: - return AsyncPnlSummaryResource(self._client) + def pnl_summaries(self) -> AsyncPnlSummariesResource: + return AsyncPnlSummariesResource(self._client) @cached_property - def regt_margin(self) -> AsyncRegtMarginResource: - return AsyncRegtMarginResource(self._client) + def regt_margins(self) -> AsyncRegtMarginsResource: + return AsyncRegtMarginsResource(self._client) @cached_property - def portfolio_margin(self) -> AsyncPortfolioMarginResource: - return AsyncPortfolioMarginResource(self._client) + def portfolio_margins(self) -> AsyncPortfolioMarginsResource: + return AsyncPortfolioMarginsResource(self._client) @cached_property def regt_margin_simulations(self) -> AsyncRegtMarginSimulationsResource: @@ -226,16 +226,16 @@ def __init__(self, entities: EntitiesResource) -> None: ) @cached_property - def pnl_summary(self) -> PnlSummaryResourceWithRawResponse: - return PnlSummaryResourceWithRawResponse(self._entities.pnl_summary) + def pnl_summaries(self) -> PnlSummariesResourceWithRawResponse: + return PnlSummariesResourceWithRawResponse(self._entities.pnl_summaries) @cached_property - def regt_margin(self) -> RegtMarginResourceWithRawResponse: - return RegtMarginResourceWithRawResponse(self._entities.regt_margin) + def regt_margins(self) -> RegtMarginsResourceWithRawResponse: + return RegtMarginsResourceWithRawResponse(self._entities.regt_margins) @cached_property - def portfolio_margin(self) -> PortfolioMarginResourceWithRawResponse: - return PortfolioMarginResourceWithRawResponse(self._entities.portfolio_margin) + def portfolio_margins(self) -> PortfolioMarginsResourceWithRawResponse: + return PortfolioMarginsResourceWithRawResponse(self._entities.portfolio_margins) @cached_property def regt_margin_simulations(self) -> RegtMarginSimulationsResourceWithRawResponse: @@ -254,16 +254,16 @@ def __init__(self, entities: AsyncEntitiesResource) -> None: ) @cached_property - def pnl_summary(self) -> AsyncPnlSummaryResourceWithRawResponse: - return AsyncPnlSummaryResourceWithRawResponse(self._entities.pnl_summary) + def pnl_summaries(self) -> AsyncPnlSummariesResourceWithRawResponse: + return AsyncPnlSummariesResourceWithRawResponse(self._entities.pnl_summaries) @cached_property - def regt_margin(self) -> AsyncRegtMarginResourceWithRawResponse: - return AsyncRegtMarginResourceWithRawResponse(self._entities.regt_margin) + def regt_margins(self) -> AsyncRegtMarginsResourceWithRawResponse: + return AsyncRegtMarginsResourceWithRawResponse(self._entities.regt_margins) @cached_property - def portfolio_margin(self) -> AsyncPortfolioMarginResourceWithRawResponse: - return AsyncPortfolioMarginResourceWithRawResponse(self._entities.portfolio_margin) + def portfolio_margins(self) -> AsyncPortfolioMarginsResourceWithRawResponse: + return AsyncPortfolioMarginsResourceWithRawResponse(self._entities.portfolio_margins) @cached_property def regt_margin_simulations(self) -> AsyncRegtMarginSimulationsResourceWithRawResponse: @@ -282,16 +282,16 @@ def __init__(self, entities: EntitiesResource) -> None: ) @cached_property - def pnl_summary(self) -> PnlSummaryResourceWithStreamingResponse: - return PnlSummaryResourceWithStreamingResponse(self._entities.pnl_summary) + def pnl_summaries(self) -> PnlSummariesResourceWithStreamingResponse: + return PnlSummariesResourceWithStreamingResponse(self._entities.pnl_summaries) @cached_property - def regt_margin(self) -> RegtMarginResourceWithStreamingResponse: - return RegtMarginResourceWithStreamingResponse(self._entities.regt_margin) + def regt_margins(self) -> RegtMarginsResourceWithStreamingResponse: + return RegtMarginsResourceWithStreamingResponse(self._entities.regt_margins) @cached_property - def portfolio_margin(self) -> PortfolioMarginResourceWithStreamingResponse: - return PortfolioMarginResourceWithStreamingResponse(self._entities.portfolio_margin) + def portfolio_margins(self) -> PortfolioMarginsResourceWithStreamingResponse: + return PortfolioMarginsResourceWithStreamingResponse(self._entities.portfolio_margins) @cached_property def regt_margin_simulations(self) -> RegtMarginSimulationsResourceWithStreamingResponse: @@ -310,16 +310,16 @@ def __init__(self, entities: AsyncEntitiesResource) -> None: ) @cached_property - def pnl_summary(self) -> AsyncPnlSummaryResourceWithStreamingResponse: - return AsyncPnlSummaryResourceWithStreamingResponse(self._entities.pnl_summary) + def pnl_summaries(self) -> AsyncPnlSummariesResourceWithStreamingResponse: + return AsyncPnlSummariesResourceWithStreamingResponse(self._entities.pnl_summaries) @cached_property - def regt_margin(self) -> AsyncRegtMarginResourceWithStreamingResponse: - return AsyncRegtMarginResourceWithStreamingResponse(self._entities.regt_margin) + def regt_margins(self) -> AsyncRegtMarginsResourceWithStreamingResponse: + return AsyncRegtMarginsResourceWithStreamingResponse(self._entities.regt_margins) @cached_property - def portfolio_margin(self) -> AsyncPortfolioMarginResourceWithStreamingResponse: - return AsyncPortfolioMarginResourceWithStreamingResponse(self._entities.portfolio_margin) + def portfolio_margins(self) -> AsyncPortfolioMarginsResourceWithStreamingResponse: + return AsyncPortfolioMarginsResourceWithStreamingResponse(self._entities.portfolio_margins) @cached_property def regt_margin_simulations(self) -> AsyncRegtMarginSimulationsResourceWithStreamingResponse: diff --git a/src/studio_minus_sdk/resources/entities/pnl_summary.py b/src/studio_sdk/resources/entities/pnl_summaries.py similarity index 70% rename from src/studio_minus_sdk/resources/entities/pnl_summary.py rename to src/studio_sdk/resources/entities/pnl_summaries.py index 5f26284..16ee97d 100644 --- a/src/studio_minus_sdk/resources/entities/pnl_summary.py +++ b/src/studio_sdk/resources/entities/pnl_summaries.py @@ -18,17 +18,17 @@ ) from ...types.pnl_summary import PnlSummary -__all__ = ["PnlSummaryResource", "AsyncPnlSummaryResource"] +__all__ = ["PnlSummariesResource", "AsyncPnlSummariesResource"] -class PnlSummaryResource(SyncAPIResource): +class PnlSummariesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> PnlSummaryResourceWithRawResponse: - return PnlSummaryResourceWithRawResponse(self) + def with_raw_response(self) -> PnlSummariesResourceWithRawResponse: + return PnlSummariesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> PnlSummaryResourceWithStreamingResponse: - return PnlSummaryResourceWithStreamingResponse(self) + def with_streaming_response(self) -> PnlSummariesResourceWithStreamingResponse: + return PnlSummariesResourceWithStreamingResponse(self) def retrieve( self, @@ -66,14 +66,14 @@ def retrieve( ) -class AsyncPnlSummaryResource(AsyncAPIResource): +class AsyncPnlSummariesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncPnlSummaryResourceWithRawResponse: - return AsyncPnlSummaryResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncPnlSummariesResourceWithRawResponse: + return AsyncPnlSummariesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncPnlSummaryResourceWithStreamingResponse: - return AsyncPnlSummaryResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncPnlSummariesResourceWithStreamingResponse: + return AsyncPnlSummariesResourceWithStreamingResponse(self) async def retrieve( self, @@ -111,37 +111,37 @@ async def retrieve( ) -class PnlSummaryResourceWithRawResponse: - def __init__(self, pnl_summary: PnlSummaryResource) -> None: - self._pnl_summary = pnl_summary +class PnlSummariesResourceWithRawResponse: + def __init__(self, pnl_summaries: PnlSummariesResource) -> None: + self._pnl_summaries = pnl_summaries self.retrieve = to_raw_response_wrapper( - pnl_summary.retrieve, + pnl_summaries.retrieve, ) -class AsyncPnlSummaryResourceWithRawResponse: - def __init__(self, pnl_summary: AsyncPnlSummaryResource) -> None: - self._pnl_summary = pnl_summary +class AsyncPnlSummariesResourceWithRawResponse: + def __init__(self, pnl_summaries: AsyncPnlSummariesResource) -> None: + self._pnl_summaries = pnl_summaries self.retrieve = async_to_raw_response_wrapper( - pnl_summary.retrieve, + pnl_summaries.retrieve, ) -class PnlSummaryResourceWithStreamingResponse: - def __init__(self, pnl_summary: PnlSummaryResource) -> None: - self._pnl_summary = pnl_summary +class PnlSummariesResourceWithStreamingResponse: + def __init__(self, pnl_summaries: PnlSummariesResource) -> None: + self._pnl_summaries = pnl_summaries self.retrieve = to_streamed_response_wrapper( - pnl_summary.retrieve, + pnl_summaries.retrieve, ) -class AsyncPnlSummaryResourceWithStreamingResponse: - def __init__(self, pnl_summary: AsyncPnlSummaryResource) -> None: - self._pnl_summary = pnl_summary +class AsyncPnlSummariesResourceWithStreamingResponse: + def __init__(self, pnl_summaries: AsyncPnlSummariesResource) -> None: + self._pnl_summaries = pnl_summaries self.retrieve = async_to_streamed_response_wrapper( - pnl_summary.retrieve, + pnl_summaries.retrieve, ) diff --git a/src/studio_minus_sdk/resources/entities/portfolio_margin.py b/src/studio_sdk/resources/entities/portfolio_margins.py similarity index 69% rename from src/studio_minus_sdk/resources/entities/portfolio_margin.py rename to src/studio_sdk/resources/entities/portfolio_margins.py index e33cbf4..491d73e 100644 --- a/src/studio_minus_sdk/resources/entities/portfolio_margin.py +++ b/src/studio_sdk/resources/entities/portfolio_margins.py @@ -18,17 +18,17 @@ ) from ...types.portfolio_margin import PortfolioMargin -__all__ = ["PortfolioMarginResource", "AsyncPortfolioMarginResource"] +__all__ = ["PortfolioMarginsResource", "AsyncPortfolioMarginsResource"] -class PortfolioMarginResource(SyncAPIResource): +class PortfolioMarginsResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> PortfolioMarginResourceWithRawResponse: - return PortfolioMarginResourceWithRawResponse(self) + def with_raw_response(self) -> PortfolioMarginsResourceWithRawResponse: + return PortfolioMarginsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> PortfolioMarginResourceWithStreamingResponse: - return PortfolioMarginResourceWithStreamingResponse(self) + def with_streaming_response(self) -> PortfolioMarginsResourceWithStreamingResponse: + return PortfolioMarginsResourceWithStreamingResponse(self) def retrieve( self, @@ -66,14 +66,14 @@ def retrieve( ) -class AsyncPortfolioMarginResource(AsyncAPIResource): +class AsyncPortfolioMarginsResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncPortfolioMarginResourceWithRawResponse: - return AsyncPortfolioMarginResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncPortfolioMarginsResourceWithRawResponse: + return AsyncPortfolioMarginsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncPortfolioMarginResourceWithStreamingResponse: - return AsyncPortfolioMarginResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncPortfolioMarginsResourceWithStreamingResponse: + return AsyncPortfolioMarginsResourceWithStreamingResponse(self) async def retrieve( self, @@ -111,37 +111,37 @@ async def retrieve( ) -class PortfolioMarginResourceWithRawResponse: - def __init__(self, portfolio_margin: PortfolioMarginResource) -> None: - self._portfolio_margin = portfolio_margin +class PortfolioMarginsResourceWithRawResponse: + def __init__(self, portfolio_margins: PortfolioMarginsResource) -> None: + self._portfolio_margins = portfolio_margins self.retrieve = to_raw_response_wrapper( - portfolio_margin.retrieve, + portfolio_margins.retrieve, ) -class AsyncPortfolioMarginResourceWithRawResponse: - def __init__(self, portfolio_margin: AsyncPortfolioMarginResource) -> None: - self._portfolio_margin = portfolio_margin +class AsyncPortfolioMarginsResourceWithRawResponse: + def __init__(self, portfolio_margins: AsyncPortfolioMarginsResource) -> None: + self._portfolio_margins = portfolio_margins self.retrieve = async_to_raw_response_wrapper( - portfolio_margin.retrieve, + portfolio_margins.retrieve, ) -class PortfolioMarginResourceWithStreamingResponse: - def __init__(self, portfolio_margin: PortfolioMarginResource) -> None: - self._portfolio_margin = portfolio_margin +class PortfolioMarginsResourceWithStreamingResponse: + def __init__(self, portfolio_margins: PortfolioMarginsResource) -> None: + self._portfolio_margins = portfolio_margins self.retrieve = to_streamed_response_wrapper( - portfolio_margin.retrieve, + portfolio_margins.retrieve, ) -class AsyncPortfolioMarginResourceWithStreamingResponse: - def __init__(self, portfolio_margin: AsyncPortfolioMarginResource) -> None: - self._portfolio_margin = portfolio_margin +class AsyncPortfolioMarginsResourceWithStreamingResponse: + def __init__(self, portfolio_margins: AsyncPortfolioMarginsResource) -> None: + self._portfolio_margins = portfolio_margins self.retrieve = async_to_streamed_response_wrapper( - portfolio_margin.retrieve, + portfolio_margins.retrieve, ) diff --git a/src/studio_minus_sdk/resources/entities/regt_margin_simulations.py b/src/studio_sdk/resources/entities/regt_margin_simulations.py similarity index 100% rename from src/studio_minus_sdk/resources/entities/regt_margin_simulations.py rename to src/studio_sdk/resources/entities/regt_margin_simulations.py diff --git a/src/studio_minus_sdk/resources/entities/regt_margin.py b/src/studio_sdk/resources/entities/regt_margins.py similarity index 71% rename from src/studio_minus_sdk/resources/entities/regt_margin.py rename to src/studio_sdk/resources/entities/regt_margins.py index fd9b240..a3f4fca 100644 --- a/src/studio_minus_sdk/resources/entities/regt_margin.py +++ b/src/studio_sdk/resources/entities/regt_margins.py @@ -18,17 +18,17 @@ ) from ...types.regt_margin import RegtMargin -__all__ = ["RegtMarginResource", "AsyncRegtMarginResource"] +__all__ = ["RegtMarginsResource", "AsyncRegtMarginsResource"] -class RegtMarginResource(SyncAPIResource): +class RegtMarginsResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> RegtMarginResourceWithRawResponse: - return RegtMarginResourceWithRawResponse(self) + def with_raw_response(self) -> RegtMarginsResourceWithRawResponse: + return RegtMarginsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> RegtMarginResourceWithStreamingResponse: - return RegtMarginResourceWithStreamingResponse(self) + def with_streaming_response(self) -> RegtMarginsResourceWithStreamingResponse: + return RegtMarginsResourceWithStreamingResponse(self) def retrieve( self, @@ -66,14 +66,14 @@ def retrieve( ) -class AsyncRegtMarginResource(AsyncAPIResource): +class AsyncRegtMarginsResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncRegtMarginResourceWithRawResponse: - return AsyncRegtMarginResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncRegtMarginsResourceWithRawResponse: + return AsyncRegtMarginsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncRegtMarginResourceWithStreamingResponse: - return AsyncRegtMarginResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncRegtMarginsResourceWithStreamingResponse: + return AsyncRegtMarginsResourceWithStreamingResponse(self) async def retrieve( self, @@ -111,37 +111,37 @@ async def retrieve( ) -class RegtMarginResourceWithRawResponse: - def __init__(self, regt_margin: RegtMarginResource) -> None: - self._regt_margin = regt_margin +class RegtMarginsResourceWithRawResponse: + def __init__(self, regt_margins: RegtMarginsResource) -> None: + self._regt_margins = regt_margins self.retrieve = to_raw_response_wrapper( - regt_margin.retrieve, + regt_margins.retrieve, ) -class AsyncRegtMarginResourceWithRawResponse: - def __init__(self, regt_margin: AsyncRegtMarginResource) -> None: - self._regt_margin = regt_margin +class AsyncRegtMarginsResourceWithRawResponse: + def __init__(self, regt_margins: AsyncRegtMarginsResource) -> None: + self._regt_margins = regt_margins self.retrieve = async_to_raw_response_wrapper( - regt_margin.retrieve, + regt_margins.retrieve, ) -class RegtMarginResourceWithStreamingResponse: - def __init__(self, regt_margin: RegtMarginResource) -> None: - self._regt_margin = regt_margin +class RegtMarginsResourceWithStreamingResponse: + def __init__(self, regt_margins: RegtMarginsResource) -> None: + self._regt_margins = regt_margins self.retrieve = to_streamed_response_wrapper( - regt_margin.retrieve, + regt_margins.retrieve, ) -class AsyncRegtMarginResourceWithStreamingResponse: - def __init__(self, regt_margin: AsyncRegtMarginResource) -> None: - self._regt_margin = regt_margin +class AsyncRegtMarginsResourceWithStreamingResponse: + def __init__(self, regt_margins: AsyncRegtMarginsResource) -> None: + self._regt_margins = regt_margins self.retrieve = async_to_streamed_response_wrapper( - regt_margin.retrieve, + regt_margins.retrieve, ) diff --git a/src/studio_minus_sdk/resources/instruments.py b/src/studio_sdk/resources/instruments.py similarity index 100% rename from src/studio_minus_sdk/resources/instruments.py rename to src/studio_sdk/resources/instruments.py diff --git a/src/studio_minus_sdk/types/__init__.py b/src/studio_sdk/types/__init__.py similarity index 100% rename from src/studio_minus_sdk/types/__init__.py rename to src/studio_sdk/types/__init__.py diff --git a/src/studio_minus_sdk/types/account.py b/src/studio_sdk/types/account.py similarity index 100% rename from src/studio_minus_sdk/types/account.py rename to src/studio_sdk/types/account.py diff --git a/src/studio_minus_sdk/types/account_list_response.py b/src/studio_sdk/types/account_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/account_list_response.py rename to src/studio_sdk/types/account_list_response.py diff --git a/src/studio_minus_sdk/types/accounts/__init__.py b/src/studio_sdk/types/accounts/__init__.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/__init__.py rename to src/studio_sdk/types/accounts/__init__.py diff --git a/src/studio_minus_sdk/types/accounts/bulk_order_create_params.py b/src/studio_sdk/types/accounts/bulk_order_create_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/bulk_order_create_params.py rename to src/studio_sdk/types/accounts/bulk_order_create_params.py diff --git a/src/studio_minus_sdk/types/accounts/bulk_order_create_response.py b/src/studio_sdk/types/accounts/bulk_order_create_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/bulk_order_create_response.py rename to src/studio_sdk/types/accounts/bulk_order_create_response.py diff --git a/src/studio_minus_sdk/types/accounts/easy_borrow_list_response.py b/src/studio_sdk/types/accounts/easy_borrow_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/easy_borrow_list_response.py rename to src/studio_sdk/types/accounts/easy_borrow_list_response.py diff --git a/src/studio_minus_sdk/types/accounts/locate_order_create_params.py b/src/studio_sdk/types/accounts/locate_order_create_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/locate_order_create_params.py rename to src/studio_sdk/types/accounts/locate_order_create_params.py diff --git a/src/studio_minus_sdk/types/accounts/locate_order_list_response.py b/src/studio_sdk/types/accounts/locate_order_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/locate_order_list_response.py rename to src/studio_sdk/types/accounts/locate_order_list_response.py diff --git a/src/studio_minus_sdk/types/accounts/locate_order_update_params.py b/src/studio_sdk/types/accounts/locate_order_update_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/locate_order_update_params.py rename to src/studio_sdk/types/accounts/locate_order_update_params.py diff --git a/src/studio_minus_sdk/types/accounts/order_create_params.py b/src/studio_sdk/types/accounts/order_create_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/order_create_params.py rename to src/studio_sdk/types/accounts/order_create_params.py diff --git a/src/studio_minus_sdk/types/accounts/order_create_response.py b/src/studio_sdk/types/accounts/order_create_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/order_create_response.py rename to src/studio_sdk/types/accounts/order_create_response.py diff --git a/src/studio_minus_sdk/types/accounts/order_delete_params.py b/src/studio_sdk/types/accounts/order_delete_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/order_delete_params.py rename to src/studio_sdk/types/accounts/order_delete_params.py diff --git a/src/studio_minus_sdk/types/accounts/order_delete_response.py b/src/studio_sdk/types/accounts/order_delete_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/order_delete_response.py rename to src/studio_sdk/types/accounts/order_delete_response.py diff --git a/src/studio_minus_sdk/types/accounts/order_list_params.py b/src/studio_sdk/types/accounts/order_list_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/order_list_params.py rename to src/studio_sdk/types/accounts/order_list_params.py diff --git a/src/studio_minus_sdk/types/accounts/order_list_response.py b/src/studio_sdk/types/accounts/order_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/order_list_response.py rename to src/studio_sdk/types/accounts/order_list_response.py diff --git a/src/studio_minus_sdk/types/accounts/order_retrieve_response.py b/src/studio_sdk/types/accounts/order_retrieve_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/order_retrieve_response.py rename to src/studio_sdk/types/accounts/order_retrieve_response.py diff --git a/src/studio_minus_sdk/types/accounts/pnl_detail_list_response.py b/src/studio_sdk/types/accounts/pnl_detail_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/pnl_detail_list_response.py rename to src/studio_sdk/types/accounts/pnl_detail_list_response.py diff --git a/src/studio_minus_sdk/types/accounts/position_list_params.py b/src/studio_sdk/types/accounts/position_list_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/position_list_params.py rename to src/studio_sdk/types/accounts/position_list_params.py diff --git a/src/studio_minus_sdk/types/accounts/position_list_response.py b/src/studio_sdk/types/accounts/position_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/position_list_response.py rename to src/studio_sdk/types/accounts/position_list_response.py diff --git a/src/studio_minus_sdk/types/accounts/trade_list_params.py b/src/studio_sdk/types/accounts/trade_list_params.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/trade_list_params.py rename to src/studio_sdk/types/accounts/trade_list_params.py diff --git a/src/studio_minus_sdk/types/accounts/trade_list_response.py b/src/studio_sdk/types/accounts/trade_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/accounts/trade_list_response.py rename to src/studio_sdk/types/accounts/trade_list_response.py diff --git a/src/studio_minus_sdk/types/entities/__init__.py b/src/studio_sdk/types/entities/__init__.py similarity index 100% rename from src/studio_minus_sdk/types/entities/__init__.py rename to src/studio_sdk/types/entities/__init__.py diff --git a/src/studio_minus_sdk/types/entities/regt_margin_simulation_create_params.py b/src/studio_sdk/types/entities/regt_margin_simulation_create_params.py similarity index 100% rename from src/studio_minus_sdk/types/entities/regt_margin_simulation_create_params.py rename to src/studio_sdk/types/entities/regt_margin_simulation_create_params.py diff --git a/src/studio_minus_sdk/types/entities/regt_margin_simulation_create_response.py b/src/studio_sdk/types/entities/regt_margin_simulation_create_response.py similarity index 100% rename from src/studio_minus_sdk/types/entities/regt_margin_simulation_create_response.py rename to src/studio_sdk/types/entities/regt_margin_simulation_create_response.py diff --git a/src/studio_minus_sdk/types/entities/simulation_id.py b/src/studio_sdk/types/entities/simulation_id.py similarity index 100% rename from src/studio_minus_sdk/types/entities/simulation_id.py rename to src/studio_sdk/types/entities/simulation_id.py diff --git a/src/studio_minus_sdk/types/entity.py b/src/studio_sdk/types/entity.py similarity index 100% rename from src/studio_minus_sdk/types/entity.py rename to src/studio_sdk/types/entity.py diff --git a/src/studio_minus_sdk/types/entity_list_response.py b/src/studio_sdk/types/entity_list_response.py similarity index 100% rename from src/studio_minus_sdk/types/entity_list_response.py rename to src/studio_sdk/types/entity_list_response.py diff --git a/src/studio_minus_sdk/types/instrument.py b/src/studio_sdk/types/instrument.py similarity index 100% rename from src/studio_minus_sdk/types/instrument.py rename to src/studio_sdk/types/instrument.py diff --git a/src/studio_minus_sdk/types/instrument_retrieve_params.py b/src/studio_sdk/types/instrument_retrieve_params.py similarity index 100% rename from src/studio_minus_sdk/types/instrument_retrieve_params.py rename to src/studio_sdk/types/instrument_retrieve_params.py diff --git a/src/studio_minus_sdk/types/pnl_summary.py b/src/studio_sdk/types/pnl_summary.py similarity index 100% rename from src/studio_minus_sdk/types/pnl_summary.py rename to src/studio_sdk/types/pnl_summary.py diff --git a/src/studio_minus_sdk/types/portfolio_margin.py b/src/studio_sdk/types/portfolio_margin.py similarity index 100% rename from src/studio_minus_sdk/types/portfolio_margin.py rename to src/studio_sdk/types/portfolio_margin.py diff --git a/src/studio_minus_sdk/types/regt_margin.py b/src/studio_sdk/types/regt_margin.py similarity index 100% rename from src/studio_minus_sdk/types/regt_margin.py rename to src/studio_sdk/types/regt_margin.py diff --git a/src/studio_minus_sdk/types/shared/__init__.py b/src/studio_sdk/types/shared/__init__.py similarity index 100% rename from src/studio_minus_sdk/types/shared/__init__.py rename to src/studio_sdk/types/shared/__init__.py diff --git a/src/studio_minus_sdk/types/shared/locate_order.py b/src/studio_sdk/types/shared/locate_order.py similarity index 100% rename from src/studio_minus_sdk/types/shared/locate_order.py rename to src/studio_sdk/types/shared/locate_order.py diff --git a/src/studio_minus_sdk/types/shared/order.py b/src/studio_sdk/types/shared/order.py similarity index 100% rename from src/studio_minus_sdk/types/shared/order.py rename to src/studio_sdk/types/shared/order.py diff --git a/src/studio_minus_sdk/types/shared/pnl_summary_for_account.py b/src/studio_sdk/types/shared/pnl_summary_for_account.py similarity index 100% rename from src/studio_minus_sdk/types/shared/pnl_summary_for_account.py rename to src/studio_sdk/types/shared/pnl_summary_for_account.py diff --git a/src/studio_minus_sdk/types/shared/position.py b/src/studio_sdk/types/shared/position.py similarity index 100% rename from src/studio_minus_sdk/types/shared/position.py rename to src/studio_sdk/types/shared/position.py diff --git a/src/studio_minus_sdk/types/shared/regt_margin_simulation.py b/src/studio_sdk/types/shared/regt_margin_simulation.py similarity index 100% rename from src/studio_minus_sdk/types/shared/regt_margin_simulation.py rename to src/studio_sdk/types/shared/regt_margin_simulation.py diff --git a/src/studio_minus_sdk/types/shared/trade.py b/src/studio_sdk/types/shared/trade.py similarity index 100% rename from src/studio_minus_sdk/types/shared/trade.py rename to src/studio_sdk/types/shared/trade.py diff --git a/tests/api_resources/accounts/test_bulk_orders.py b/tests/api_resources/accounts/test_bulk_orders.py index ef7d9ce..954d1ca 100644 --- a/tests/api_resources/accounts/test_bulk_orders.py +++ b/tests/api_resources/accounts/test_bulk_orders.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.accounts import BulkOrderCreateResponse +from studio_sdk.types.accounts import BulkOrderCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/accounts/test_easy_borrows.py b/tests/api_resources/accounts/test_easy_borrows.py index 345bb6b..91e5b1b 100644 --- a/tests/api_resources/accounts/test_easy_borrows.py +++ b/tests/api_resources/accounts/test_easy_borrows.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.accounts import EasyBorrowListResponse +from studio_sdk.types.accounts import EasyBorrowListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/accounts/test_locate_orders.py b/tests/api_resources/accounts/test_locate_orders.py index e1d8b89..5365a1d 100644 --- a/tests/api_resources/accounts/test_locate_orders.py +++ b/tests/api_resources/accounts/test_locate_orders.py @@ -7,12 +7,10 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.shared import LocateOrder -from studio_minus_sdk.types.accounts import ( - LocateOrderListResponse, -) +from studio_sdk.types.shared import LocateOrder +from studio_sdk.types.accounts import LocateOrderListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/accounts/test_orders.py b/tests/api_resources/accounts/test_orders.py index 34e0e31..61286a7 100644 --- a/tests/api_resources/accounts/test_orders.py +++ b/tests/api_resources/accounts/test_orders.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.accounts import ( +from studio_sdk.types.accounts import ( OrderListResponse, OrderCreateResponse, OrderDeleteResponse, diff --git a/tests/api_resources/accounts/test_pnl_details.py b/tests/api_resources/accounts/test_pnl_details.py index 1fdc8d1..1fa5c99 100644 --- a/tests/api_resources/accounts/test_pnl_details.py +++ b/tests/api_resources/accounts/test_pnl_details.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.accounts import PnlDetailListResponse +from studio_sdk.types.accounts import PnlDetailListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/accounts/test_pnl_summary.py b/tests/api_resources/accounts/test_pnl_summary.py index 1ef5ce5..0e65fee 100644 --- a/tests/api_resources/accounts/test_pnl_summary.py +++ b/tests/api_resources/accounts/test_pnl_summary.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.shared import PnlSummaryForAccount +from studio_sdk.types.shared import PnlSummaryForAccount base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/accounts/test_positions.py b/tests/api_resources/accounts/test_positions.py index 6ec784a..9cc8344 100644 --- a/tests/api_resources/accounts/test_positions.py +++ b/tests/api_resources/accounts/test_positions.py @@ -7,10 +7,10 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.shared import Position -from studio_minus_sdk.types.accounts import PositionListResponse +from studio_sdk.types.shared import Position +from studio_sdk.types.accounts import PositionListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/accounts/test_trades.py b/tests/api_resources/accounts/test_trades.py index e488e16..aa2bb06 100644 --- a/tests/api_resources/accounts/test_trades.py +++ b/tests/api_resources/accounts/test_trades.py @@ -7,10 +7,10 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.shared import Trade -from studio_minus_sdk.types.accounts import TradeListResponse +from studio_sdk.types.shared import Trade +from studio_sdk.types.accounts import TradeListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/entities/test_pnl_summary.py b/tests/api_resources/entities/test_pnl_summaries.py similarity index 79% rename from tests/api_resources/entities/test_pnl_summary.py rename to tests/api_resources/entities/test_pnl_summaries.py index 96ea114..30e9a17 100644 --- a/tests/api_resources/entities/test_pnl_summary.py +++ b/tests/api_resources/entities/test_pnl_summaries.py @@ -7,26 +7,26 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types import PnlSummary +from studio_sdk.types import PnlSummary base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestPnlSummary: +class TestPnlSummaries: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_retrieve(self, client: StudioSDK) -> None: - pnl_summary = client.entities.pnl_summary.retrieve( + pnl_summary = client.entities.pnl_summaries.retrieve( "x", ) assert_matches_type(PnlSummary, pnl_summary, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: StudioSDK) -> None: - response = client.entities.pnl_summary.with_raw_response.retrieve( + response = client.entities.pnl_summaries.with_raw_response.retrieve( "x", ) @@ -37,7 +37,7 @@ def test_raw_response_retrieve(self, client: StudioSDK) -> None: @parametrize def test_streaming_response_retrieve(self, client: StudioSDK) -> None: - with client.entities.pnl_summary.with_streaming_response.retrieve( + with client.entities.pnl_summaries.with_streaming_response.retrieve( "x", ) as response: assert not response.is_closed @@ -51,24 +51,24 @@ def test_streaming_response_retrieve(self, client: StudioSDK) -> None: @parametrize def test_path_params_retrieve(self, client: StudioSDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - client.entities.pnl_summary.with_raw_response.retrieve( + client.entities.pnl_summaries.with_raw_response.retrieve( "", ) -class TestAsyncPnlSummary: +class TestAsyncPnlSummaries: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_retrieve(self, async_client: AsyncStudioSDK) -> None: - pnl_summary = await async_client.entities.pnl_summary.retrieve( + pnl_summary = await async_client.entities.pnl_summaries.retrieve( "x", ) assert_matches_type(PnlSummary, pnl_summary, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStudioSDK) -> None: - response = await async_client.entities.pnl_summary.with_raw_response.retrieve( + response = await async_client.entities.pnl_summaries.with_raw_response.retrieve( "x", ) @@ -79,7 +79,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStudioSDK) -> None @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStudioSDK) -> None: - async with async_client.entities.pnl_summary.with_streaming_response.retrieve( + async with async_client.entities.pnl_summaries.with_streaming_response.retrieve( "x", ) as response: assert not response.is_closed @@ -93,6 +93,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStudioSDK) - @parametrize async def test_path_params_retrieve(self, async_client: AsyncStudioSDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - await async_client.entities.pnl_summary.with_raw_response.retrieve( + await async_client.entities.pnl_summaries.with_raw_response.retrieve( "", ) diff --git a/tests/api_resources/entities/test_portfolio_margin.py b/tests/api_resources/entities/test_portfolio_margins.py similarity index 80% rename from tests/api_resources/entities/test_portfolio_margin.py rename to tests/api_resources/entities/test_portfolio_margins.py index 74e0bc5..a510b5b 100644 --- a/tests/api_resources/entities/test_portfolio_margin.py +++ b/tests/api_resources/entities/test_portfolio_margins.py @@ -7,26 +7,26 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types import PortfolioMargin +from studio_sdk.types import PortfolioMargin base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestPortfolioMargin: +class TestPortfolioMargins: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_retrieve(self, client: StudioSDK) -> None: - portfolio_margin = client.entities.portfolio_margin.retrieve( + portfolio_margin = client.entities.portfolio_margins.retrieve( "x", ) assert_matches_type(PortfolioMargin, portfolio_margin, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: StudioSDK) -> None: - response = client.entities.portfolio_margin.with_raw_response.retrieve( + response = client.entities.portfolio_margins.with_raw_response.retrieve( "x", ) @@ -37,7 +37,7 @@ def test_raw_response_retrieve(self, client: StudioSDK) -> None: @parametrize def test_streaming_response_retrieve(self, client: StudioSDK) -> None: - with client.entities.portfolio_margin.with_streaming_response.retrieve( + with client.entities.portfolio_margins.with_streaming_response.retrieve( "x", ) as response: assert not response.is_closed @@ -51,24 +51,24 @@ def test_streaming_response_retrieve(self, client: StudioSDK) -> None: @parametrize def test_path_params_retrieve(self, client: StudioSDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - client.entities.portfolio_margin.with_raw_response.retrieve( + client.entities.portfolio_margins.with_raw_response.retrieve( "", ) -class TestAsyncPortfolioMargin: +class TestAsyncPortfolioMargins: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_retrieve(self, async_client: AsyncStudioSDK) -> None: - portfolio_margin = await async_client.entities.portfolio_margin.retrieve( + portfolio_margin = await async_client.entities.portfolio_margins.retrieve( "x", ) assert_matches_type(PortfolioMargin, portfolio_margin, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStudioSDK) -> None: - response = await async_client.entities.portfolio_margin.with_raw_response.retrieve( + response = await async_client.entities.portfolio_margins.with_raw_response.retrieve( "x", ) @@ -79,7 +79,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStudioSDK) -> None @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStudioSDK) -> None: - async with async_client.entities.portfolio_margin.with_streaming_response.retrieve( + async with async_client.entities.portfolio_margins.with_streaming_response.retrieve( "x", ) as response: assert not response.is_closed @@ -93,6 +93,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStudioSDK) - @parametrize async def test_path_params_retrieve(self, async_client: AsyncStudioSDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - await async_client.entities.portfolio_margin.with_raw_response.retrieve( + await async_client.entities.portfolio_margins.with_raw_response.retrieve( "", ) diff --git a/tests/api_resources/entities/test_regt_margin_simulations.py b/tests/api_resources/entities/test_regt_margin_simulations.py index 091b03b..e977f47 100644 --- a/tests/api_resources/entities/test_regt_margin_simulations.py +++ b/tests/api_resources/entities/test_regt_margin_simulations.py @@ -7,10 +7,10 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types.shared import RegtMarginSimulation -from studio_minus_sdk.types.entities import ( +from studio_sdk.types.shared import RegtMarginSimulation +from studio_sdk.types.entities import ( RegtMarginSimulationCreateResponse, ) diff --git a/tests/api_resources/entities/test_regt_margin.py b/tests/api_resources/entities/test_regt_margins.py similarity index 79% rename from tests/api_resources/entities/test_regt_margin.py rename to tests/api_resources/entities/test_regt_margins.py index 663ee34..f5ef25d 100644 --- a/tests/api_resources/entities/test_regt_margin.py +++ b/tests/api_resources/entities/test_regt_margins.py @@ -7,26 +7,26 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types import RegtMargin +from studio_sdk.types import RegtMargin base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestRegtMargin: +class TestRegtMargins: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_retrieve(self, client: StudioSDK) -> None: - regt_margin = client.entities.regt_margin.retrieve( + regt_margin = client.entities.regt_margins.retrieve( "x", ) assert_matches_type(RegtMargin, regt_margin, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: StudioSDK) -> None: - response = client.entities.regt_margin.with_raw_response.retrieve( + response = client.entities.regt_margins.with_raw_response.retrieve( "x", ) @@ -37,7 +37,7 @@ def test_raw_response_retrieve(self, client: StudioSDK) -> None: @parametrize def test_streaming_response_retrieve(self, client: StudioSDK) -> None: - with client.entities.regt_margin.with_streaming_response.retrieve( + with client.entities.regt_margins.with_streaming_response.retrieve( "x", ) as response: assert not response.is_closed @@ -51,24 +51,24 @@ def test_streaming_response_retrieve(self, client: StudioSDK) -> None: @parametrize def test_path_params_retrieve(self, client: StudioSDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - client.entities.regt_margin.with_raw_response.retrieve( + client.entities.regt_margins.with_raw_response.retrieve( "", ) -class TestAsyncRegtMargin: +class TestAsyncRegtMargins: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_retrieve(self, async_client: AsyncStudioSDK) -> None: - regt_margin = await async_client.entities.regt_margin.retrieve( + regt_margin = await async_client.entities.regt_margins.retrieve( "x", ) assert_matches_type(RegtMargin, regt_margin, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStudioSDK) -> None: - response = await async_client.entities.regt_margin.with_raw_response.retrieve( + response = await async_client.entities.regt_margins.with_raw_response.retrieve( "x", ) @@ -79,7 +79,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStudioSDK) -> None @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStudioSDK) -> None: - async with async_client.entities.regt_margin.with_streaming_response.retrieve( + async with async_client.entities.regt_margins.with_streaming_response.retrieve( "x", ) as response: assert not response.is_closed @@ -93,6 +93,6 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStudioSDK) - @parametrize async def test_path_params_retrieve(self, async_client: AsyncStudioSDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): - await async_client.entities.regt_margin.with_raw_response.retrieve( + await async_client.entities.regt_margins.with_raw_response.retrieve( "", ) diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py index 2a83305..98973f1 100644 --- a/tests/api_resources/test_accounts.py +++ b/tests/api_resources/test_accounts.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types import Account, AccountListResponse +from studio_sdk.types import Account, AccountListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_entities.py b/tests/api_resources/test_entities.py index 739aab3..d164313 100644 --- a/tests/api_resources/test_entities.py +++ b/tests/api_resources/test_entities.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types import Entity, EntityListResponse +from studio_sdk.types import Entity, EntityListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_instruments.py b/tests/api_resources/test_instruments.py index a1a0273..aeb1509 100644 --- a/tests/api_resources/test_instruments.py +++ b/tests/api_resources/test_instruments.py @@ -7,9 +7,9 @@ import pytest +from studio_sdk import StudioSDK, AsyncStudioSDK from tests.utils import assert_matches_type -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk.types import Instrument +from studio_sdk.types import Instrument base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/conftest.py b/tests/conftest.py index e69d8e0..918845a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,14 +7,14 @@ import pytest -from studio_minus_sdk import StudioSDK, AsyncStudioSDK +from studio_sdk import StudioSDK, AsyncStudioSDK if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest pytest.register_assert_rewrite("tests.utils") -logging.getLogger("studio_minus_sdk").setLevel(logging.DEBUG) +logging.getLogger("studio_sdk").setLevel(logging.DEBUG) @pytest.fixture(scope="session") diff --git a/tests/test_client.py b/tests/test_client.py index c8e76bd..78f8563 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -16,11 +16,11 @@ from respx import MockRouter from pydantic import ValidationError -from studio_minus_sdk import StudioSDK, AsyncStudioSDK, APIResponseValidationError -from studio_minus_sdk._models import BaseModel, FinalRequestOptions -from studio_minus_sdk._constants import RAW_RESPONSE_HEADER -from studio_minus_sdk._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError -from studio_minus_sdk._base_client import ( +from studio_sdk import StudioSDK, AsyncStudioSDK, APIResponseValidationError +from studio_sdk._models import BaseModel, FinalRequestOptions +from studio_sdk._constants import RAW_RESPONSE_HEADER +from studio_sdk._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError +from studio_sdk._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, @@ -227,10 +227,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "studio_minus_sdk/_legacy_response.py", - "studio_minus_sdk/_response.py", + "studio_sdk/_legacy_response.py", + "studio_sdk/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "studio_minus_sdk/_compat.py", + "studio_sdk/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -720,7 +720,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("studio_minus_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("studio_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.get("/entities/x").mock(side_effect=httpx.TimeoutException("Test timeout error")) @@ -730,7 +730,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No assert _get_open_connections(self.client) == 0 - @mock.patch("studio_minus_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("studio_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.get("/entities/x").mock(return_value=httpx.Response(500)) @@ -919,10 +919,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "studio_minus_sdk/_legacy_response.py", - "studio_minus_sdk/_response.py", + "studio_sdk/_legacy_response.py", + "studio_sdk/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "studio_minus_sdk/_compat.py", + "studio_sdk/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -1416,7 +1416,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("studio_minus_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("studio_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.get("/entities/x").mock(side_effect=httpx.TimeoutException("Test timeout error")) @@ -1428,7 +1428,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) assert _get_open_connections(self.client) == 0 - @mock.patch("studio_minus_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("studio_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.get("/entities/x").mock(return_value=httpx.Response(500)) diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py index 592982f..5572718 100644 --- a/tests/test_deepcopy.py +++ b/tests/test_deepcopy.py @@ -1,4 +1,4 @@ -from studio_minus_sdk._utils import deepcopy_minimal +from studio_sdk._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index a4af470..31767ca 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,8 +4,8 @@ import pytest -from studio_minus_sdk._types import FileTypes -from studio_minus_sdk._utils import extract_files +from studio_sdk._types import FileTypes +from studio_sdk._utils import extract_files def test_removes_files_from_input() -> None: diff --git a/tests/test_files.py b/tests/test_files.py index d454674..7bc3b0f 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -4,7 +4,7 @@ import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple -from studio_minus_sdk._files import to_httpx_files, async_to_httpx_files +from studio_sdk._files import to_httpx_files, async_to_httpx_files readme_path = Path(__file__).parent.parent.joinpath("README.md") diff --git a/tests/test_models.py b/tests/test_models.py index b376723..c85ecf6 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -7,9 +7,9 @@ import pydantic from pydantic import Field -from studio_minus_sdk._utils import PropertyInfo -from studio_minus_sdk._compat import PYDANTIC_V2, parse_obj, model_dump, model_json -from studio_minus_sdk._models import BaseModel, construct_type +from studio_sdk._utils import PropertyInfo +from studio_sdk._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from studio_sdk._models import BaseModel, construct_type class BasicModel(BaseModel): diff --git a/tests/test_qs.py b/tests/test_qs.py index b2940e8..7863c47 100644 --- a/tests/test_qs.py +++ b/tests/test_qs.py @@ -4,7 +4,7 @@ import pytest -from studio_minus_sdk._qs import Querystring, stringify +from studio_sdk._qs import Querystring, stringify def test_empty() -> None: diff --git a/tests/test_required_args.py b/tests/test_required_args.py index a74905b..c1254f2 100644 --- a/tests/test_required_args.py +++ b/tests/test_required_args.py @@ -2,7 +2,7 @@ import pytest -from studio_minus_sdk._utils import required_args +from studio_sdk._utils import required_args def test_too_many_positional_params() -> None: diff --git a/tests/test_response.py b/tests/test_response.py index db0d91b..a22b280 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -6,8 +6,8 @@ import pytest import pydantic -from studio_minus_sdk import BaseModel, StudioSDK, AsyncStudioSDK -from studio_minus_sdk._response import ( +from studio_sdk import BaseModel, StudioSDK, AsyncStudioSDK +from studio_sdk._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, @@ -15,8 +15,8 @@ AsyncBinaryAPIResponse, extract_response_type, ) -from studio_minus_sdk._streaming import Stream -from studio_minus_sdk._base_client import FinalRequestOptions +from studio_sdk._streaming import Stream +from studio_sdk._base_client import FinalRequestOptions class ConcreteBaseAPIResponse(APIResponse[bytes]): @@ -40,7 +40,7 @@ def test_extract_response_type_direct_classes() -> None: def test_extract_response_type_direct_class_missing_type_arg() -> None: with pytest.raises( RuntimeError, - match="Expected type to have a type argument at index 0 but it did not", + match="Expected type to have a type argument at index 0 but it did not", ): extract_response_type(AsyncAPIResponse) @@ -72,7 +72,7 @@ def test_response_parse_mismatched_basemodel(client: StudioSDK) -> None: with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from studio_minus_sdk import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from studio_sdk import BaseModel`", ): response.parse(to=PydanticModel) @@ -90,7 +90,7 @@ async def test_async_response_parse_mismatched_basemodel(async_client: AsyncStud with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from studio_minus_sdk import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from studio_sdk import BaseModel`", ): await response.parse(to=PydanticModel) diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 6b19443..6d5ffd7 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -5,8 +5,8 @@ import httpx import pytest -from studio_minus_sdk import StudioSDK, AsyncStudioSDK -from studio_minus_sdk._streaming import Stream, AsyncStream, ServerSentEvent +from studio_sdk import StudioSDK, AsyncStudioSDK +from studio_sdk._streaming import Stream, AsyncStream, ServerSentEvent @pytest.mark.asyncio diff --git a/tests/test_transform.py b/tests/test_transform.py index 3d05ec4..b73010a 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,15 +8,15 @@ import pytest -from studio_minus_sdk._types import Base64FileInput -from studio_minus_sdk._utils import ( +from studio_sdk._types import Base64FileInput +from studio_sdk._utils import ( PropertyInfo, transform as _transform, parse_datetime, async_transform as _async_transform, ) -from studio_minus_sdk._compat import PYDANTIC_V2 -from studio_minus_sdk._models import BaseModel +from studio_sdk._compat import PYDANTIC_V2 +from studio_sdk._models import BaseModel _T = TypeVar("_T") diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index 2161c8b..e962ca1 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -2,7 +2,7 @@ from typing import Any from typing_extensions import override -from studio_minus_sdk._utils import LazyProxy +from studio_sdk._utils import LazyProxy class RecursiveLazyProxy(LazyProxy[Any]): diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py index 9687565..6f3cd52 100644 --- a/tests/test_utils/test_typing.py +++ b/tests/test_utils/test_typing.py @@ -2,7 +2,7 @@ from typing import Generic, TypeVar, cast -from studio_minus_sdk._utils import extract_type_var_from_base +from studio_sdk._utils import extract_type_var_from_base _T = TypeVar("_T") _T2 = TypeVar("_T2") diff --git a/tests/utils.py b/tests/utils.py index e218219..639eaf6 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,8 +8,8 @@ from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type -from studio_minus_sdk._types import NoneType -from studio_minus_sdk._utils import ( +from studio_sdk._types import NoneType +from studio_sdk._utils import ( is_dict, is_list, is_list_type, @@ -17,8 +17,8 @@ extract_type_arg, is_annotated_type, ) -from studio_minus_sdk._compat import PYDANTIC_V2, field_outer_type, get_model_fields -from studio_minus_sdk._models import BaseModel +from studio_sdk._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from studio_sdk._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel)