Codeforces Notebook Generator A Streamlit application to generate IPython Notebooks (.ipynb) for evaluating Codeforces problem solutions. The app creates notebooks with a predefined structure, including metadata, test cases, model code, test harness, evaluation scripts, and ground truth code, tailored for Codeforces problem evaluation. Features
User-friendly Streamlit interface for inputting problem metadata, model code, and ground truth code. Syntax highlighting for C++ code using streamlit_ace. Input validation to ensure correct problem ID format and required fields. Preview of the generated notebook content before downloading. Generates notebooks matching the exact format required for Codeforces evaluations.
Installation
Clone the repository:git clone https://github.com/your-username/codeforces-notebook-generator.git cd codeforces-notebook-generator
Create a virtual environment (optional but recommended):python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:pip install -r requirements.txt
Run the Streamlit app:streamlit run app/main.py
Usage
Open the app in your browser (typically at http://localhost:8501). Fill in the form with: Metadata: Problem title, Codeforces URL, SFT task ID, eval task ID. Model Name: Name of the model (e.g., "Falcon Model B"). Problem ID: Codeforces problem ID (e.g., "513F1"). Zip File Link: Google Drive link to the test cases zip file. Timeout and Memory Limit: Evaluation parameters in seconds and MB. Model and Ground Truth Code: C++ code for the model and ground truth solutions.
Click "Generate Notebook" to preview and download the .ipynb file. The notebook will be saved as Test_Cases_Eval_<problem_id>_<model_name>.ipynb.
Project Structure
app/ main.py: Streamlit app for the user interface. notebook_generator.py: Logic for generating the IPython Notebook. utils.py: Utility functions for input validation and formatting.
requirements.txt: Lists project dependencies. .gitignore: Specifies files to ignore in Git. LICENSE: MIT License for the project.
Dependencies
Python 3.8+ Streamlit streamlit_ace See requirements.txt for the full list.
License This project is licensed under the MIT License. See the LICENSE file for details. Contributing Contributions are welcome! Please open an issue or submit a pull request on GitHub. Contact For questions or issues, please open an issue on the GitHub repository.