Skip to main content

A python wrapper for the Kattis API.

None

Project description

Kattis API

build code style: black

A python wrapper for the non-existent Kattis API.

Usage

You can simply install the package using pip

$ pip install kattis

Getting Started

import the kattis module

import kattis

Examples

Some examples to get started.

Authentication

You can authenticate a Kattis user by calling kattis.auth, this will return a KattisUser object with a few callable methods.

user = kattis.auth('username', 'password')

User Methods

Methods that are callable on a KattisUser object.

user.problems(pages) -> dict: Fetches solved user problems

user.stats() -> dict: Fetches relevant user statistics

user.data() -> dict: Combines problems and statistics

user = kattis.auth('username', 'password')

problems = user.problems(1)
stats = user.stats()
info = user.data()

Problems

You can fetch kattis problems by ID or by full pages

kattis.problem(id) -> dict: Fetches problem information for a single problem

kattis.problems(pages) -> list[dict] Fetches problem information across specified pages

problem = kattis.problem('2048') # Fetches information for problem with ID '2048'
problems = kattis.problems(2) # Fetches all problems on first 2 pages

Project details

None

Download files

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

Source Distribution

kattis-1.0.0.tar.gz (4.9 kB view hashes)

Uploaded Source

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