A python wrapper for the Kattis API.
Project description
Kattis API
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file kattis-1.0.0.tar.gz
.
File metadata
- Download URL: kattis-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8e1ecb60fd62af49ca92478c913ce90ac66ee682e1bf0ff8867c352ff8624f9 |
|
MD5 | 407627e739ce2d6489234f5fe8060fb1 |
|
BLAKE2b-256 | a584b30bd7c807c2ab7202286066e3f9c71ff62005a99175a8b445f479f57c16 |