Skip to main content

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

Metadata

Release files for kattis 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kattis 1.0.0
File Size Uploaded
kattis-1.0.0.tar.gz 4.9 kB Details

Release files / kattis-1.0.0.tar.gz

Download URL kattis-1.0.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c8e1ecb60fd62af49ca92478c913ce90ac66ee682e1bf0ff8867c352ff8624f9
BLAKE2b-256 checksum
How to use checksums
a584b30bd7c807c2ab7202286066e3f9c71ff62005a99175a8b445f479f57c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page