RG

class rankguru.core.RG(header: dict)

The main API interface for the module

Creates new RG object, raises AuthError if header is invalid

Parameters

header (dict) – Auth header obtained from rankguru

Methods

get_tests(TEXT_BOOK_ID: str, latest_first=True)

This function return a sorted dictionary of tests for the given Textbook

Parameters
  • TEXT_BOOK_ID (str) – The Textbook Id of the exam

  • latest_first (bool, optional) – Toggle it to get earlier tests first, defaults to True

Raises
Returns

Returns a dictionary of test name - QPid pairs

Return type

dict

get_ans(QUESTION_PAPER_ID: str)

This function return a sorted dictionary of answers for the given Question Paper

Parameters

QUESTION_PAPER_ID (str) – The Question Paper Id of the exam

Raises
Returns

Returns a sorted dictionary of question number - answer pairs

Return type

dict

get_ans_raw(QUESTION_PAPER_ID: str)

Returns raw json output from API retrieval

Parameters

QUESTION_PAPER_ID (str) – The Question Paper Id of the exam

Raises

AuthError – If the header is invalid

Returns

Raw json as python dict

Return type

dict

get_tests_raw(TEXT_BOOK_ID: str)

Returns raw json output from API retrieval

Parameters

TEXT_BOOK_ID (str) – The Textbook Id of the category

Raises

AuthError – If the header is invalid

Returns

Raw json as python dict

Return type

dict