# autokattis
Updated Kattis API wrapper as of May 2023 after the major UI/UX change.
## Setup
Simply install it as a Python package.
```sh
$ pip install autokattis
```
## Use Cases
### Login
Construct a `Kattis` object that takes in the username and the password.
```py
from autokattis import Kattis
kt = Kattis('username', 'password')
kt = Kattis('username') # which will then prompts you for the password
```
where `'username'` is your Kattis username/email and `'password'` is your Kattis account password. **Both should be provided as Python strings.**
Similarly if you want to login to the NUS version of Kattis.
```py
from autokattis import NUSKattis
kt = NUSKattis('username', 'password')
kt = NUSKattis('username')
```
### Problem-specific
```py
kt.problems() # problems you have solved so far
kt.problems(show_partial=False) # exclude partial submissions
kt.problems(*[True]*4) # literally all problems on Kattis
kt.problems_v2() # problems you have solved so far
kt.problems_v2(show_non_ac=False) # literally all problems on Kattis
kt.list_unsolved() # let's grind!
kt.plot_problems() # plot the points distribution
kt.plot_problems(filepath='plot.png') # save to a filepath
kt.plot_problems(show_partial=False) # plot fully solved submissions
kt.problem('2048') # fetch info about a problem
kt.problem('2048', 'abinitio', 'dasort') # fetch multiple in one
kt.problem_authors() # list down all problem authors
kt.problem_sources() # list down all problem sources
```
### User-specific
```py
kt.stats() # your best submission for each problem
kt.stats('Java') # all your Java submissions
kt.stats('Python3', 'Cpp') # multiple languages
kt.achievements() # do I have any?
kt.suggest() # what's the next problem for me?
```
### Ranklist
```py
kt.ranklist() # people around you
kt.ranklist(top_100=True) # show top 100
kt.ranklist(country='Singapore') # country leaderboard
kt.ranklist(country='SGP') # use alpha-3 code instead
kt.ranklist(university='National University of Singapore') # university leaderboard
kt.ranklist(university='nus.edu.sg') # use university domain instead
```
### NUS-specific
```py
kt.courses() # current and recently ended courses
kt.offerings('CS3233') # course offerings
kt.assignments('CS3233_S2_AY2223') # course assignments but course ID not provided
kt.assignments('CS3233_S2_AY2223', 'CS3233') # course assignments
```
### Convert to DataFrame
As simple as this!
```py
kt.problems().to_df()
kt.ranklist().to_df()
```
## Useful References
- Old UI Kattis API wrapper: https://github.com/terror/kattis-api
> Most of the work in `autokattis` is heavily inspired and motivated by this repository.
- Kattis official CLI tool: https://github.com/Kattis/kattis-cli
> Since Kattis has provided an official tool to automate submissions, there won't be such feature in `autokattis`.
## Contributing
asdf
Raw data
{
"_id": null,
"home_page": "https://github.com/RussellDash332/autokattis",
"name": "autokattis",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Kattis",
"author": "Russell Saerang",
"author_email": "russellsaerang@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3d/c3/f44989b724f62954b5225da0b0d5f70f46b5d0f6d8ac81708e555c2bee1b/autokattis-1.6.4.tar.gz",
"platform": null,
"description": "# autokattis\n\nUpdated Kattis API wrapper as of May 2023 after the major UI/UX change.\n\n## Setup\n\nSimply install it as a Python package.\n\n```sh\n$ pip install autokattis\n```\n\n## Use Cases\n\n### Login\n\nConstruct a `Kattis` object that takes in the username and the password.\n\n```py\nfrom autokattis import Kattis\nkt = Kattis('username', 'password')\nkt = Kattis('username') # which will then prompts you for the password\n```\n\nwhere `'username'` is your Kattis username/email and `'password'` is your Kattis account password. **Both should be provided as Python strings.**\n\nSimilarly if you want to login to the NUS version of Kattis.\n\n```py\nfrom autokattis import NUSKattis\nkt = NUSKattis('username', 'password')\nkt = NUSKattis('username')\n```\n\n### Problem-specific\n\n```py\nkt.problems() # problems you have solved so far\nkt.problems(show_partial=False) # exclude partial submissions\nkt.problems(*[True]*4) # literally all problems on Kattis\n\nkt.problems_v2() # problems you have solved so far\nkt.problems_v2(show_non_ac=False) # literally all problems on Kattis\n\nkt.list_unsolved() # let's grind!\n\nkt.plot_problems() # plot the points distribution\nkt.plot_problems(filepath='plot.png') # save to a filepath\nkt.plot_problems(show_partial=False) # plot fully solved submissions\n\nkt.problem('2048') # fetch info about a problem\nkt.problem('2048', 'abinitio', 'dasort') # fetch multiple in one\n\nkt.problem_authors() # list down all problem authors\nkt.problem_sources() # list down all problem sources\n```\n\n### User-specific\n\n```py\nkt.stats() # your best submission for each problem\nkt.stats('Java') # all your Java submissions\nkt.stats('Python3', 'Cpp') # multiple languages\n\nkt.achievements() # do I have any?\nkt.suggest() # what's the next problem for me?\n```\n\n### Ranklist\n\n```py\nkt.ranklist() # people around you\nkt.ranklist(top_100=True) # show top 100\nkt.ranklist(country='Singapore') # country leaderboard\nkt.ranklist(country='SGP') # use alpha-3 code instead\nkt.ranklist(university='National University of Singapore') # university leaderboard\nkt.ranklist(university='nus.edu.sg') # use university domain instead\n```\n\n### NUS-specific\n\n```py\nkt.courses() # current and recently ended courses\nkt.offerings('CS3233') # course offerings\nkt.assignments('CS3233_S2_AY2223') # course assignments but course ID not provided\nkt.assignments('CS3233_S2_AY2223', 'CS3233') # course assignments\n```\n\n### Convert to DataFrame\n\nAs simple as this!\n\n```py\nkt.problems().to_df()\nkt.ranklist().to_df()\n```\n\n## Useful References\n\n- Old UI Kattis API wrapper: https://github.com/terror/kattis-api\n\n > Most of the work in `autokattis` is heavily inspired and motivated by this repository.\n\n- Kattis official CLI tool: https://github.com/Kattis/kattis-cli\n\n > Since Kattis has provided an official tool to automate submissions, there won't be such feature in `autokattis`.\n\n## Contributing\n\nasdf\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Updated Kattis API wrapper",
"version": "1.6.4",
"project_urls": {
"Download": "https://pypi.org/project/autokattis/",
"Homepage": "https://github.com/RussellDash332/autokattis"
},
"split_keywords": [
"kattis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1f767fabb032e3fc0ab6e0ea1f748c0a7fd4bd895368a71bd799d7089f3d8e29",
"md5": "b14c4fdb1a7708d0f2ed51861e29ecb3",
"sha256": "ff64e2597c2ef7a214f8b4b7673e2a673fb7445764bb2daaab7dbdad1b787315"
},
"downloads": -1,
"filename": "autokattis-1.6.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b14c4fdb1a7708d0f2ed51861e29ecb3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 60963,
"upload_time": "2024-02-12T22:45:50",
"upload_time_iso_8601": "2024-02-12T22:45:50.809742Z",
"url": "https://files.pythonhosted.org/packages/1f/76/7fabb032e3fc0ab6e0ea1f748c0a7fd4bd895368a71bd799d7089f3d8e29/autokattis-1.6.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3dc3f44989b724f62954b5225da0b0d5f70f46b5d0f6d8ac81708e555c2bee1b",
"md5": "ec47cbde762328c3ab809f6b98804f8b",
"sha256": "0777b955cd79143fce884dd6d15c88f7672b72fcc5694dfa7e8c9619c376c09b"
},
"downloads": -1,
"filename": "autokattis-1.6.4.tar.gz",
"has_sig": false,
"md5_digest": "ec47cbde762328c3ab809f6b98804f8b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 61310,
"upload_time": "2024-02-12T22:45:54",
"upload_time_iso_8601": "2024-02-12T22:45:54.498837Z",
"url": "https://files.pythonhosted.org/packages/3d/c3/f44989b724f62954b5225da0b0d5f70f46b5d0f6d8ac81708e555c2bee1b/autokattis-1.6.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-12 22:45:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RussellDash332",
"github_project": "autokattis",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "autokattis"
}