Clients Module
- class judge0.clients.Client(endpoint, auth_headers, *, retry_strategy=None)
Base class for all clients.
- Parameters:
endpoint (str) – Client’s default endpoint.
auth_headers (dict) – Request authentication headers.
- API_KEY_ENV
Environment variable where judge0-python should look for API key for the client. Set to default values for ATD, RapidAPI, and Sulu clients.
- Type:
str
- create_submission(submission)
Send submission for execution to a client.
Directly send a submission to create_submission route for execution.
- Parameters:
submission (Submission) – A submission to create.
- Returns:
A submission with updated token attribute.
- Return type:
- create_submissions(submissions)
Send submissions for execution to a client.
Directly send submissions to create_submissions route for execution. Cannot handle more submissions than the client supports.
- Parameters:
submissions (Submissions) – A sequence of submissions to create.
- Returns:
A sequence of submissions with updated token attribute.
- Return type:
Submissions
- get_about()
Get general information about judge0.
- Returns:
General information about judge0.
- Return type:
dict
- get_config_info()
Get information about client’s configuration.
- Returns:
Client’s configuration.
- Return type:
- get_language(language_id)
Get language corresponding to the id.
- Parameters:
language_id (int) – Language id.
- Returns:
Language corresponding to the passed id.
- Return type:
- get_language_id(language)
Get language id corresponding to the language alias for the client.
- Parameters:
language (LanguageAlias or int) – Language alias or language id.
- Return type:
int
- Returns:
Language id corresponding to the language alias.
- get_languages()
Get a list of supported languages.
- Returns:
A list of supported languages.
- Return type:
list of language
- get_statuses()
Get a list of possible submission statuses.
- Returns:
A list of possible submission statues.
- Return type:
list of dict
- get_submission(submission, *, fields=None)
Get submissions status.
Directly send submission’s token to get_submission route for status check. By default, all submissions attributes (fields) are requested.
- Parameters:
submission (Submission) – Submission to update.
- Returns:
A Submission with updated attributes.
- Return type:
- get_submissions(submissions, *, fields=None)
Get submissions status.
Directly send submissions’ tokens to get_submissions route for status check. By default, all submissions attributes (fields) are requested. Cannot handle more submissions than the client supports.
- Parameters:
submissions (Submissions) – Submissions to update.
- Returns:
A sequence of submissions with updated attributes.
- Return type:
Submissions
- is_language_supported(language)
Check if language is supported by the client.
- Parameters:
language (LanguageAlias or int) – Language alias or language id.
- Returns:
Return True if language is supported by the client, otherwise returns False.
- Return type:
bool
- class judge0.clients.ATD(endpoint, host_header_value, api_key, **kwargs)
Bases:
Client
Base class for all AllThingsDev clients.
- class judge0.clients.ATDJudge0CE(api_key, **kwargs)
Bases:
ATD
AllThingsDev client for CE flavor.
- class judge0.clients.ATDJudge0ExtraCE(api_key, **kwargs)
Bases:
ATD
AllThingsDev client for Extra CE flavor.
- class judge0.clients.Rapid(endpoint, host_header_value, api_key, **kwargs)
Bases:
Client
Base class for all RapidAPI clients.
- class judge0.clients.RapidJudge0CE(api_key, **kwargs)
Bases:
Rapid
RapidAPI client for CE flavor.
- class judge0.clients.RapidJudge0ExtraCE(api_key, **kwargs)
Bases:
Rapid
RapidAPI client for Extra CE flavor.
- class judge0.clients.Sulu(endpoint, api_key=None, **kwargs)
Bases:
Client
Base class for all Sulu clients.
- Parameters:
endpoint (str) – Default request endpoint.
api_key (str, optional) – Sulu API key.
- class judge0.clients.SuluJudge0CE(api_key=None, **kwargs)
Bases:
Sulu
Sulu client for CE flavor.
- Parameters:
api_key (str, optional) – Sulu API key.
- class judge0.clients.SuluJudge0ExtraCE(api_key=None, **kwargs)
Bases:
Sulu
Sulu client for Extra CE flavor.
- Parameters:
api_key (str) – Sulu API key.