onlinejudge.service.toph module

the module for Toph (https://toph.co/)

class onlinejudge.service.toph.TophProblem(*, problem_id, contest_id=None)[source]

Bases: onlinejudge.type.Problem

Variables
  • problem_idstr

  • contest_idOptional [ str ]

download_sample_cases(*, session=None)[source]
Raises

SampleParseError

Return type

List[TestCase]

classmethod from_url(s)[source]
Return type

Optional[TophProblem]

get_available_languages(*, session=None)[source]
Raises

NotImplementedError

Return type

List[Language]

get_service()[source]
Return type

TophService

get_url()[source]
Return type

str

submit_code(code, language_id, *, filename=None, session=None)[source]
Raises
Return type

Submission

class onlinejudge.service.toph.TophService[source]

Bases: onlinejudge.type.Service

classmethod from_url(s)[source]
Return type

Optional[TophService]

get_name()[source]

example:

  • AtCoder

  • Codeforces

  • PKU JudgeOnline

Note

If you want something like identifier (e.g. atcoder, codeforces or poj), you can use a domain obtained from get_url().

Return type

str

get_url()[source]
Return type

str

get_url_of_login_page()[source]
Return type

str

is_logged_in(*, session=None)[source]
Return type

bool