Skip to main content

A python library for interacting with the petlja.org API

Project description

petlja_api

A python library for interacting with the petlja.org API.

Installation

pip install petlja-api

Basic usage

import petlja_api as petlja

session = petlja.login()

# Create problem
prob_id = petlja.create_problem(session, name="My Problem", alias="my-prob")
petlja.upload_testcases(session, prob_id, "my-prob/testcases.zip")
petlja.upload_statement(session, prob_id, "my-prob/statement.md")

# Create competition
comp_id = petlja.create_competition(session, name="My Competition", alias="my-comp")
petlja.add_problem(session, comp_id, prob_id)

# Upload solution
score = petlja.submit(session, prob_id, "my-prob/sol.cpp", comp_id)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

petlja_api-0.3.0.tar.gz (14.1 kB view hashes)

Uploaded Source

Built Distribution

petlja_api-0.3.0-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page