Python CodeforcesAPI Wrapper

Revision en4, by hsuan1117, 2021-06-14 11:38:12

Recently, I am using CMS (Contest Management System) with Codeforces API, however, calling the API wasn't that convenient for me.
So I just developed a python Codeforces API wrapper for python developers. The module implemented all the API endpoint in the API documents here, also, the library provided multiple ways to get data.
Take a look at this example.

from CodeforcesAPI import Codeforces

cf = Codeforces(api_key='hi',secret='secret')
print(cf.contest().users()[0].blogs())

You can simply get users in contest, and get other information by using chaining methods.
Moreover, the library uses the "dot-env loader", you can just place your secret information inside .env file instead of writing a lot in the codes.

To install the module, just use the pip tool

pip install CodeforcesAPI

Here is the Github Project: Github
And here is the document of the library: Document
The module is released under MIT license, I think it'll be useful for someone needing it.
I'm glad to any suggestions, any issues, requests are welcomed.

Tags #api, #python3, #python, #codeforces, #cf_api

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English hsuan1117 2021-06-14 11:38:12 9
en3 English hsuan1117 2021-06-14 11:37:02 34
en2 English hsuan1117 2021-06-14 11:36:13 8
en1 English hsuan1117 2021-06-14 11:35:41 1243 Initial revision (published)