Obtain Remaining Quota
July 12, 2024Less than 1 minute
Warning
After version 0.3.1 the output has been updated to logging
, which by default only outputs Warning and above. If you want to see the processing, set the logging
level to INFO:
import logging
httpx_logger = logging.getLogger("httpx")
httpx_logger.setLevel(logging.WARNING)
logging.basicConfig(level=logging.INFO)
For demonstration purposes, the following code examples all set the logging
level to INFO.
Client.get_limit
Obtain the remaining quota of the API key.
Return Value
Type | Description |
---|---|
int | The remaining quota of the API key |
Example
Warning
Please make sure you have configured the key in the environment variables as per the Initialization section.
from pdfdeal import Doc2X
Client = Doc2X()
print(f"Pages remaining: {Client.get_limit()}")
Expected return:
Pages remaining: 999