Skip to content

mdgspace/CodeforcesAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeforces API

This is my attempt at some python web scraping. I will scrape the data from the Codeforces website and this can be accessed by making an API call to a REST endpoint I created using flask.

The motive of this project is to aid a CP specific editor. I've been making some prototypes of it using PyQt6 on the orange/editor branch. Take a look at that if it interests you.

Setup

  • Clone the repository and access the project directory
      git clone https://github.com/Abhijna-Raghavendra/CodeforcesAPI.git
      cd CodeforcesAPI
  • Create and activate your virtual environment

    Make sure you have python installed in your computer before proceeding

      python3 -m venv virtenv
      # In Windows cmd
      virtenv\Scripts\activate.bat
      # In Windows PowerShell
      virtenv\Scripts\Activate.ps1
      # In Linux or MacOS
      source virtenv/Scripts/activate
  • Install required dependencies
    (virtenv)
      pip install -r requirements.txt
  • Run the flask server
    (virtenv)
      python api.py

Usage

Once the flask server is up and running on localhost:5000, open a browser window and visit http://127.0.0.1:5000/scrape/{question}

The {question} must be valid and of the form "1729-A", where a "-" seperates the letter from the number.

Enjoy!! ❤️

About

This is my attempt at some python web scraping.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages