Metadata-Version: 2.4
Name: petlja_api
Version: 0.4.0
Summary: A python library for interacting with the petlja.org API
Project-URL: Homepage, https://github.com/PavleSekesan/petlja_api
Author-email: Pavle Sekešan <pavlesekesan@gmail.com>
License-File: LICENSE
Requires-Python: >=3.8
Requires-Dist: beautifulsoup4~=4.0
Requires-Dist: requests~=2.0
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-timeout; extra == 'dev'
Requires-Dist: python-dotenv; extra == 'dev'
Description-Content-Type: text/markdown

# petlja_api

A python library for interacting with the [petlja.org](https://petlja.org/) API.

## Installation

```
pip install petlja-api
```

## Basic usage

```py
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)
```
