Models Reference¶
AudioFormat
¶
Bases:
List of audio formats accepted by Flowery.
FloweryAPIConfig
¶
Bases:
Configuration used when making requests to the Flowery API.
Example
from pyflowery import FloweryAPI, FloweryAPIConfig
config = FloweryAPIConfig(
user_agent = "PyFloweryDocumentation/1.0.0",
token = "hello world",
)
api = FloweryAPI(config=config)
base_url = 'https://api.flowery.pw/v2'
class-attribute
instance-attribute
¶
The base url for the Flowery API.
interval = 5
class-attribute
instance-attribute
¶
Seconds to wait between each retried request, multiplied by how many attempted requests have been made.
logger = Field(default_factory=_create_logger)
class-attribute
instance-attribute
¶
Logger to use for logging messages. One will be automatically created if not provided here.
prepended_user_agent
property
¶
Return the user_agent with the PyFlowery module version prepended.
retry_limit = 3
class-attribute
instance-attribute
¶
Number of times to retry a request before giving up.
token = None
class-attribute
instance-attribute
¶
Authorization token to use in HTTP requests. Authorization is only required if you want increased ratelimits. See the Flowery API documentation for more details.
user_agent
instance-attribute
¶
User-Agent string to use in HTTP requests. Required as of 2.1.0.
Language
¶
Result
¶
Bases:
Result returned from low-level RestAdapter.
cache_expires = None
class-attribute
instance-attribute
¶
The timestamp at which the data in this result will expire, if it was cached by the external API.
Will be None in cases where the external API does not tell us if the result was cached.
cache_hit = None
class-attribute
instance-attribute
¶
Whether or not the data in this result was returned via a cache from the external API.
Will be None in cases where the external API does not tell us if the result was cached.
data = {}
class-attribute
instance-attribute
¶
The data returned by the request.
message = ''
class-attribute
instance-attribute
¶
Human readable result message from the request.
raw_response = None
class-attribute
instance-attribute
¶
The raw response object from the request.
status_code
instance-attribute
¶
The HTTP status code returned by the request.
success
instance-attribute
¶
Whether or not the request was successful.
TTSResponse
¶
Bases:
Object containing data from a TTS query.
audio_format
instance-attribute
¶
What format the data is in.
data
instance-attribute
¶
The synthesized TTS data in bytes.
result
instance-attribute
¶
The internal result object for use in debugging.
text
instance-attribute
¶
The SSML text used to generate the TTS data.
voice = None
class-attribute
instance-attribute
¶
Whether the text was translated into the voice's set language before being synthesized.
Voice
¶
Bases:
Voice object returned from the Flowery API.