Skip to content

Latest commit

 

History

History
104 lines (89 loc) · 4.67 KB

README.md

File metadata and controls

104 lines (89 loc) · 4.67 KB

koishi.py

pypi version API endpoint coverage CodeFactor

 

Wrapper library for the unofficial scraped API of the satori testing system.

 

 

Example usage

>>> from koishi import Koishi
>>> foo = Koishi("login", "password")

>>> foo[4]
<Contest 6460771 approved "Liga Informatyczna V LO, 2020/21">

>>> foo[4].problems
[<Problem 6629872 X1 Promocja>, <Problem 6629900 X2 Magazyn Prezentow>,
...
<Problem 6473321 PIZ Pizza>, <Problem 6473327 TRA Tramwaje>]

>>> foo[4][6]
<Problem 6501411 A01 Meteory>

>>> foo[4][6].submit("print(\"hehe\")", "py")
6851966

>>> foo[4].result
<Result 6851966 A01 2021-04-03 22:45:10 QUE>

>>> foo[4][6].submit("print(\"trolling\")",
...     lang="py",
...     callback=lambda x: print(x.src x.details.tests, sep="\n")
... )
print("trolling")
[ResultTest(name='0', status=<RStatus.ANS: 1>, time='0.004')]

installation

$ pip install koishi

Credits

Contributing

  1. Fork this repo
  2. Create your feature branch ( git checkout -b feature/foobar )
  3. Commit your changes         ( git commit -am 'Add some foobar' )
  4. Push to the branch              ( git push origin feature/foobar )
  5. Create a new Pull Request  

License

koishi is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms and conditions of the MIT license.