graph LR
SDK_Clients["SDK Clients"]
Core_Communication_Utilities["Core Communication & Utilities"]
API_Service_Modules["API Service Modules"]
SDK_Configuration["SDK Configuration"]
SDK_Clients -- "initializes and uses" --> Core_Communication_Utilities
SDK_Clients -- "aggregates" --> API_Service_Modules
API_Service_Modules -- "sends requests via" --> Core_Communication_Utilities
API_Service_Modules -- "processes data with" --> Core_Communication_Utilities
SDK_Configuration -- "configures" --> SDK_Clients
SDK_Configuration -- "configures" --> Core_Communication_Utilities
click SDK_Clients href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/square-python-sdk/SDK Clients.md" "Details"
click Core_Communication_Utilities href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/square-python-sdk/Core Communication & Utilities.md" "Details"
click API_Service_Modules href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/square-python-sdk/API Service Modules.md" "Details"
click SDK_Configuration href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/square-python-sdk/SDK Configuration.md" "Details"
The square-python-sdk architecture is designed around a clear separation of concerns, primarily distinguishing between legacy and modern SDK clients. The modern SDK offers both synchronous and asynchronous interfaces, all of which rely on a robust Core Communication & Utilities layer for HTTP requests, data handling, error management, and pagination. Specific Square API functionalities are encapsulated within API Service Modules, which interact with the core communication layer. Global settings and authentication are managed by the SDK Configuration component, which influences the behavior of both the SDK clients and the underlying communication mechanisms.
The primary entry points for interacting with the Square API, providing both synchronous and asynchronous interfaces for the modern SDK, and a single client for the legacy SDK. These clients aggregate various API-specific modules.
Related Classes/Methods:
square_legacy.client.Client(55:269)square.client.Square(79:175)square.client.AsyncSquare(178:274)
Provides the foundational services for the SDK, including executing HTTP requests, handling data serialization/deserialization, managing API-specific errors, and facilitating pagination for API responses.
Related Classes/Methods:
square.core.http_client.HttpClient(148:321)square.core.http_client.AsyncHttpClient(324:497)square.core.client_wrapper.BaseClientWrapper(9:46)square.core.client_wrapper.SyncClientWrapper(49:65)square.core.client_wrapper.AsyncClientWrapper(68:84)square.core.query_encoder(full file reference)square.core.file(full file reference)square.core.remove_none_from_dict(6:11)square.core.unchecked_base_model.UncheckedBaseModel(36:124)square.core.jsonable_encoder(31:100)square.core.serialization(full file reference)square.core.pydantic_utilities(full file reference)square.core.datetime_utils(full file reference)square.core.api_error.ApiError(14:123)square.core.pagination.SyncPager(37:62)square.core.pagination.AsyncPager(65:87)
A collection of specialized client modules, each dedicated to a specific Square API category (e.g., Payments, Bookings, Customers). These modules encapsulate the business logic for interacting with their respective API endpoints.
Related Classes/Methods:
square.o_auth.client.OAuthClient(17:312)square.payments.client.PaymentsClient(full file reference)square.bookings.client.BookingsClient(full file reference)square.catalog.client.CatalogClient(full file reference)square.customers.client.CustomersClient(full file reference)square.subscriptions.client.SubscriptionsClient(full file reference)square.locations.client.LocationsClient(29:429)square.terminal.client.TerminalClient(20:139)square.webhooks.client.WebhooksClient(13:29)square.inventory.client.InventoryClient(full file reference)square.team_members.client.TeamMembersClient(26:419)square.orders.client.OrdersClient(full file reference)
Manages the SDK's global settings, including authentication credentials, environment selection, and HTTP client configurations for both legacy and modern clients.
Related Classes/Methods: