Modules§
Structs§
- DeeplAPI
Message - Error message from DeepL API for some reason.
- DpTran
- DeepL translation library. Create a new instance of DpTran with the API key. Use the translate() method to translate the text. Use the get_usage() method to get the number of characters remaining to be translated. Use the get_language_codes() method to get the language code list. Use the check_language_code() method to check the validity of the language code. Use the correct_source_language_code() method to convert the source language code to the correct language code. Use the correct_target_language_code() method to convert the target language code to the correct language code.
- DpTran
Usage - DeepL API usage information
character_count: Number of characters translated this month
character_limit: Maximum number of characters that can be translated this month
If the API key is pro, the character_limit is None. - Endpoint
Urls - DeepL API URLs
- Glossaries
ApiPost Data - Glossary post data structure.
Used to create a glossary via the DeepL API.
You need to create an instance of this struct to send a glossary creation request. - Glossary
- Glossary struct
- Translate
Request - Request translation structure See also https://developers.deepl.com/api-reference/translate/request-translation
- Translate
Result - Translation response structure
Enums§
- ApiKey
Type - DeepL API key type.
DeepL API servers Free and Pro plans, but the endpoints are different.
So we need to distinguish between the two types of API keys.
Free: Free API key, which has a character limit of 500,000 characters per month.Pro: Pro API key, which has no character limit. - Connection
Error - ConnectionErrors.
It is an error that occurs when communicating with the DeepL API.
BadRequest: 400 Bad Request
Forbidden: 403 Forbidden
NotFound: 404 Not Found
RequestEntityTooLarge: 413 Request Entity Too Large
TooManyRequests: 429 Too Many Requests
UnprocessableEntity: 456 Unprocessable Entity
ServiceUnavailable: 503 Service Unavailable
CurlError: Curl Error
UnknownError: Unknown Error - DeeplAPI
Error - DeepL API error.
ConnectionError: Connection error occurred in the process of sending and receiving data.
JsonError: Error occurred while parsing json.
LimitError: The translation limit of your account has been reached. Consider upgrading your subscription.
GetLanguageCodesError: Could not get language codes. - DpTran
Error - Errors that can occur in this library.
DeeplApiError: DeepL API error
InvalidLanguageCode: Invalid language code
ApiKeyIsNotSet: API key is not set
NoTargetLanguageSpecified: No target language specified
CouldNotGetInputText: Could not get input text - Glossaries
ApiFormat - Glossary file format
TSV: Tab-Separated Values
CSV: Comma-Separated Values - Lang
Type - Target / Source language types
used in get_language_codes()
Constants§
- DEEPL_
API_ GLOSSARIES - DEEPL_
API_ GLOSSARIES_ PRO - DEEPL_
API_ LANGUAGES - API endpoints for getting language codes
- DEEPL_
API_ LANGUAGES_ PRO - DEEPL_
API_ TRANSLATE - DEEPL_
API_ TRANSLATE_ PRO - DEEPL_
API_ USAGE - DEEPL_
API_ USAGE_ PRO - UNLIMITED_
CHARACTERS_ NUMBER
Type Aliases§
- GlossaryID
- Glossary ID
- Lang
Code - string as language code
- Lang
Code Name - Language code and language name