Skip to content

Similar to what CodeForces Readme stats does. Showcase you achievement on CodeChef using the badge generated

Notifications You must be signed in to change notification settings

JoydeepMallick/codechef-readme-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeChef Readme Stats

Similar to what Codeforces Readme stats does.

Requirements

  • requests
  • beautifulsoup4
  • drawsvg
  • Flask

Main folders and files structure :-

codechef_readme_stats/
│
├── codechef_data_extractor.py
├── image_gen.py
├── app.py
├── static/
│   ├── One_chef's_hat.png
│   ├── codechef_logo.png
│   └── Chef_not_found.png
├── requirements.txt
└── README.md

Main files :-

  1. codechef_data_extractor.py : uses BeautifulSoup to extract data from CodeChef profile static HTML page

  2. image_gen.py : Uses drawsvg to generate an svg image and make it self containing and not referencing any other image using base64.

  3. app.py : runs a server to generate svg image from imported modules and then convert it to png before serving the user.

How it will look on your system

If valid user exists

![CodeChef Stats](https://codechef-readme-stats.onrender.com/{your_codechef_username}?v=1)

NOTE

Please do not forget to type the section ....?v=1 since its essential force cache refresh in github to display images else sometimes images are not loaded as intended😐 Learnt it the hard way debugging!!!

Assume user is joy2022 so I will type the following :-

For Markdown

![CodeChef Stats](https://codechef-readme-stats.onrender.com/joy2022?v=1)

and for HTML it will be

<img src="https://codechef-readme-stats.onrender.com/joy2022?v=1" alt="something you like to put in here"/>

and output will be :-

CodeChef Stats

Assume if user is maroonrk then output will be

![CodeChef Stats](https://codechef-readme-stats.onrender.com/maroonrk?v=1)

CodeChef Stats

If username does not exists

then it will look something like this as shown below:-

CodeChef Stats

Want to make your badge redirect people to your profile?

Try this:

Markdown Format

[![CodeChef Stats](https://codechef-readme-stats.onrender.com/{your_codechef_username}?v=1)](https://www.codechef.com/users/{your_codechef_username})

or the HTML format

<a href="https://www.codechef.com/users/{your_codechef_username}">
    <img src="https://codechef-readme-stats.onrender.com/{your_codechef_username}?v=1">
</a>

⚠️THE ABOVE HAVE BEEN TESTED IN Python 3.12.4 and 3.11.3 in Conda Environment and all dependencies listed in requirements.txt have been installed via pip.

About

Similar to what CodeForces Readme stats does. Showcase you achievement on CodeChef using the badge generated

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages