Welcome to Eolymp

Everything Eolymp does is available over its API: problems and their test data, contests, courses, submissions, scoreboards, members. The Eolymp console and website are built on that same API, so any action available through the interface is also available from a script — importing a few hundred problems, judging solutions from a separate front end, pulling results into a spreadsheet the moment a contest ends. Requests are ordinary HTTPS with JSON bodies, and SDKs are available as an alternative to writing them by hand.

Quick start

The example below sends a solution to a problem, then waits for the verdict. It requires an API key with the atlas:submission:read and atlas:submission:write scopes, which can be created at accounts.eolymp.com/developer.

pip install eolymp
import os
import time

import eolymp.atlas
import eolymp.core

# Your API key from https://accounts.eolymp.com/developer, kept out of the source.
transport = eolymp.core.HttpClient(token=os.environ["EOLYMP_TOKEN"])

# Calls are relative to whatever they act on. Submissions belong to a space,
# so the space is the base URL.
space_url = "https://api.eolymp.com/spaces/your-space-id"
submissions = eolymp.atlas.SubmissionServiceClient(transport, url=space_url)

source = """
#include <iostream>

int main() {
    int a, b;
    std::cin >> a >> b;
    std::cout << a + b << std::endl;
}
"""

# lang takes a runtime id. GET {space_url}/runtime lists the ones your space allows.
out = submissions.CreateSubmission(request=eolymp.atlas.CreateSubmissionInput(
    problem_id="your-problem-id",
    lang="cpp:20-gnu14",
    source=source,
))

print("submitted:", out.submission_id)

# Judging happens in the background, so the call above returns before there's a
# verdict. Poll until the submission reaches a final status.
while True:
    submission = submissions.DescribeSubmission(request=eolymp.atlas.DescribeSubmissionInput(
        submission_id=out.submission_id,
    )).submission

    if submission.status in (eolymp.atlas.Submission.COMPLETE, eolymp.atlas.Submission.ERROR):
        break

    time.sleep(1)

# status says how far judging got; verdict is the outcome, and is only set once
# judging finished.
print("status:", eolymp.atlas.Submission.Status.Name(submission.status))
print("verdict:", eolymp.atlas.Submission.Verdict.Name(submission.verdict))
print("score:", submission.score)

Authentication covers credentials in full, Assets explains how to send files such as test data and statement images, and the API Reference lists everything else.


Did this page help you?