checkbox_sdk.client package¶
Subpackages¶
- checkbox_sdk.client.api package
- Submodules
- checkbox_sdk.client.api.base module
- checkbox_sdk.client.api.branches module
- checkbox_sdk.client.api.cash_registers module
AsyncCashRegistersAsyncCashRegisters.ask_offline_codes()AsyncCashRegisters.get_cash_register()AsyncCashRegisters.get_cash_register_shifts()AsyncCashRegisters.get_cash_registers()AsyncCashRegisters.get_offline_codes()AsyncCashRegisters.get_offline_time()AsyncCashRegisters.go_offline()AsyncCashRegisters.go_online()AsyncCashRegisters.ping_tax_service()
CashRegisters
- checkbox_sdk.client.api.cashier module
- checkbox_sdk.client.api.currency module
- checkbox_sdk.client.api.extended_reports module
AsyncExtendedReportsAsyncExtendedReports.actual_revenue_report()AsyncExtendedReports.bookkeeper_z_report()AsyncExtendedReports.create_receipt_report()AsyncExtendedReports.create_z_report()AsyncExtendedReports.daily_cash_flow_report()AsyncExtendedReports.get_report_task_by_id()AsyncExtendedReports.goods_report()AsyncExtendedReports.net_turnover_report()AsyncExtendedReports.report_json_task_by_id()AsyncExtendedReports.report_xlsx_task_by_id()
ExtendedReportsExtendedReports.actual_revenue_report()ExtendedReports.bookkeeper_z_report()ExtendedReports.create_receipt_report()ExtendedReports.create_z_report()ExtendedReports.daily_cash_flow_report()ExtendedReports.get_report_task_by_id()ExtendedReports.goods_report()ExtendedReports.net_turnover_report()ExtendedReports.report_json_task_by_id()ExtendedReports.report_xlsx_task_by_id()
- checkbox_sdk.client.api.goods module
- checkbox_sdk.client.api.invoices module
- checkbox_sdk.client.api.nova_post module
- checkbox_sdk.client.api.orders module
- checkbox_sdk.client.api.organization module
- checkbox_sdk.client.api.prepayment_receipts module
- checkbox_sdk.client.api.receipts module
- checkbox_sdk.client.api.reports module
- checkbox_sdk.client.api.shifts module
- checkbox_sdk.client.api.tax module
- checkbox_sdk.client.api.transactions module
- checkbox_sdk.client.api.webhook module
- Module contents
Submodules¶
checkbox_sdk.client.asynchronous module¶
checkbox_sdk.client.base module¶
checkbox_sdk.client.rate_limit module¶
- class checkbox_sdk.client.rate_limit.AsyncRateLimitTransport(transport: AsyncBaseTransport, requests_per_10s: int | None = None)¶
Bases:
AsyncBaseTransportTransport wrapper to enforce rate limiting using requests per 10 seconds.
This class wraps an asynchronous HTTP transport to implement rate limiting, ensuring that no more than a specified number of requests are made within a 10-second window.
- transport¶
The underlying asynchronous HTTP transport to handle requests.
- Type:
httpx.AsyncBaseTransport
- lock¶
A lock to ensure thread-safe request handling.
- Type:
Lock
- min_interval¶
The minimum time interval between requests, calculated from the rate limit.
- Type:
float
- last_request_time¶
The timestamp of the last request, used to track elapsed time.
- Type:
float
- async handle_async_request(request)¶
Handles the asynchronous request, enforcing the rate limit by ensuring the time between requests does not exceed the specified interval.
The method calculates the elapsed time since the last request and waits if necessary to maintain the rate limit before forwarding the request to the underlying transport.
- Параметри:
request – The asynchronous HTTP request to be handled.
- Повертає:
The response returned by the underlying transport after handling the request.
- class checkbox_sdk.client.rate_limit.RateLimitTransport(transport: BaseTransport, requests_per_10s: int | None = None)¶
Bases:
BaseTransportTransport wrapper to enforce rate limiting using requests per 10 seconds.
This class wraps a synchronous HTTP transport to implement rate limiting, ensuring that no more than a specified number of requests are made within a 10-second window.
- transport¶
The underlying HTTP transport to handle requests.
- Type:
httpx.BaseTransport
- lock¶
A lock to ensure thread-safe request handling.
- Type:
Lock
- min_interval¶
The minimum time interval between requests, calculated from the rate limit.
- Type:
float
- last_request_time¶
The timestamp of the last request, used to track elapsed time.
- Type:
float
- handle_request(request)¶
Handles the request, enforcing the rate limit by ensuring the time between requests does not exceed the specified interval.
The method calculates the elapsed time since the last request and waits if necessary to maintain the rate limit before forwarding the request to the underlying transport.
- Параметри:
request – The HTTP request to be handled.
- Повертає:
The response returned by the underlying transport after handling the request.
checkbox_sdk.client.synchronous module¶
checkbox_sdk.client.utils module¶
- class checkbox_sdk.client.utils.MLStripper¶
Bases:
HTMLParser- get_data()¶
- handle_data(data)¶
- handle_endtag(tag)¶
- handle_starttag(tag, attrs)¶
- checkbox_sdk.client.utils.strip_tags(value)¶
Remove HTML tags and certain unwanted content from the given HTML string, returning clean, plain text with normalized whitespace.
This function uses a custom HTML parser that strips out all HTML tags, and also ignores the content inside <title>, <style>, and <script> tags, which often contain CSS, JavaScript, or metadata not useful for log messages.
Whitespace, including newlines, is collapsed to single spaces for readability.
Intended use: Clean and simplify HTML error responses from Checkbox (e.g., 503 Service Temporarily Unavailable pages) to produce more readable and concise log messages.
- Параметри:
value (str) – The raw HTML string to clean.
- Повертає:
- Plain text extracted from the HTML input, without tags or ignored content,
with normalized whitespace.
- Тип повернення:
str