Skip to main content

Implementation of codeforces.com API

Reason this release was yanked:

Found bug in BlogEntry to_dict function

Project description

Codeforces API License Stars Forks Issues Publish to PyPI and TestPyPI Generate wiki Downloads Codestyle

Installing

With pip:

pip install CodeforcesApiPy

From the repository:

git clone https://github.com/VadVergasov/CodeforcesApiPy.git
cd codeforcesapipy
python3 setup.py install

Using

import codeforces_api

cf_api = codeforces_api.CodeforcesApi(api_key, secret) # Authorized access to api.
anonim_cf_api = codeforces_api.CodeforcesApi() # Unauthorized access to api.

parser = codeforces_api.CodeforcesParser() # Create parser.

Types

All types are defined in types.py. They are all completely in line with the Codeforces API's definition of the types

Methods

All API methods are located in the CodeforcesAPI class. They are renamed to follow common Python naming conventions. E.g. contest.hacks is renamed to contest_hacks and user.actions to user_actions.

Transferring to 2 version

In the second version, all objects are represented as a class, so if you want to get a handle of the user you need to do like this: user.handle. You can read about all fields on Codeforces API objects.

Wiki

Here is link to the wiki for more details.

Examples

Here are some examples of using this library:

  • A2OJ by subodhk01 - allows you to look at your ladder progress.
  • cf_utils by xennygrimmato - allows you to find common solved problems.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CodeforcesApiPy-2.0.1.tar.gz (11.2 kB view details)

Uploaded Source

File details

Details for the file CodeforcesApiPy-2.0.1.tar.gz.

File metadata

  • Download URL: CodeforcesApiPy-2.0.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for CodeforcesApiPy-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0a127a4fa5c1ed0d811446ed15ae15b2fafd41f2531a0029984dfdab247b1430
MD5 36a28bb874ac79139678bcd44eff1ce1
BLAKE2b-256 69a3b90479f732986dd4d453ae8b9efb89813424d0a3bdade76e729e66536086

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page