Skip to content

Awakno/CycladesNotifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exam Results Checker 🎯

An automated tool to check French exam results including DNB (Diplôme National du Brevet), BAC General & Technologique, and BAC Professionnel. This application periodically checks the official government website for exam results and notifies you when they become available.

Features ✨

  • Multiple Exam Support: Configure to check DNB, BAC General & Technologique, or BAC Professionnel results
  • Automated Checking: Continuously monitors the official results website
  • Cookie Management: Automatically handles session cookies and refreshes them when needed
  • Configurable: Easy configuration through JSON file - just change the exam_type
  • Headless Browser: Runs Chrome in headless mode for efficient operation
  • Error Handling: Robust error handling with automatic recovery
  • Real-time Updates: Live status updates with timestamps

Supported Exams 📚

  • DNB: Diplôme National du Brevet
  • BGT: BAC General & Technologique
  • BPR: BAC Professionnel

Prerequisites 📋

  • Python 3.7 or higher
  • Google Chrome browser
  • ChromeDriver (automatically managed by Selenium 4.x)

Installation 🚀

  1. Clone the repository:

    git clone https://github.com/yourusername/CycladesNotifier.git
    cd CycladesNotifier
  2. Install dependencies:

    pip install -r requirements.txt
  3. Configure the application:

    cp config.example.json config.json

    Edit config.json with your personal information.

Configuration ⚙️

Edit the config.json file with your details:

{
  "personal_info": {
    "last_name": "YourLastName"
  },
  "exam_settings": {
    "academy_code": "A25",
    "year": "2025",
    "exams_to_check": ["DNB", "BGT"]
  },
  "exam_types": {
    "DNB": {
      "name": "Diplôme National du Brevet",
      "api_path": "DNB",
      "contexte_format": "DNB,{academy_code},{year}:C:DNB-1.0,1,,,,"
    },
    "BGT": {
      "name": "BAC General & Technologique",
      "api_path": "BGT",
      "contexte_format": "BGT,{academy_code},{year}:A:BGT-2.3,1,,,,"
    }
  },
  "checker_settings": {
    "check_interval": 15,
    "max_consecutive_failures": 3
  },
  "browser_settings": {
    "headless": true
  }
}

Configuration Options

  • personal_info.last_name: Your last name for result lookup
  • exam_settings.academy_code: Your academy code (e.g., "A25" for Besançon)
  • exam_settings.year: Exam year
  • exam_settings.exam_type: The exam type to check (e.g., "DNB", "BGT", "BPR")
  • exam_types: Configuration for each exam type (API paths and context formats)
  • checker_settings.check_interval: Time between checks in seconds
  • checker_settings.max_consecutive_failures: Max failures before refreshing cookies
  • browser_settings.headless: Run browser in headless mode (true/false)

Usage 🖥️

Run the application:

python main.py

The application will:

  1. Load configuration from config.json
  2. Automatically open a browser to get session cookies
  3. Start checking for results at the specified interval
  4. Display results when found
  5. Automatically refresh cookies if they expire

Sample Output

🎯 Exam Results Checker with Automatic Cookie Management
======================================================================
Checking for: YourLastName
Academy: A25
Year: 2025
Exam type: Diplôme National du Brevet
======================================================================

🌐 Opening browser to get cookies...
📖 Navigating to https://resultats.examens-concours.gouv.fr/DNB/A25/admis
✅ Retrieved 3 cookies
💾 Cookies saved to cookies.json
🔁 Starting Diplôme National du Brevet result checker with automatic cookie management...

⏰ 2025-07-09 14:30:00 - Checking results...
⏳ No Diplôme National du Brevet results yet for YourLastName.
😴 Waiting 15 seconds before next check...

Files 📁

  • main.py: Main application file
  • config.json: Configuration file (create from config.example.json)
  • config.example.json: Example configuration file
  • requirements.txt: Python dependencies
  • cookies.json: Automatically generated cookie storage (git-ignored)

How It Works 🔧

  1. Cookie Acquisition: Opens Chrome browser to visit the official results page and collect session cookies
  2. API Requests: Uses the acquired cookies to make API requests to the configured exam result endpoint
  3. Result Parsing: Parses the JSON response to extract exam results for the configured exam type
  4. Continuous Monitoring: Repeats the process at configured intervals
  5. Error Recovery: Automatically refreshes cookies when they expire

Switching Exam Types 🔄

To check a different exam type, simply change the exam_type in your config file:

  • For DNB: "exam_type": "DNB"
  • For BAC General & Technologique: "exam_type": "BGT"
  • For BAC Professionnel: "exam_type": "BPR"

Adding New Exam Types 🆕

To add support for a new exam type:

  1. Find the API endpoint: Use browser developer tools to find the exam's API endpoint
  2. Determine the context format: Analyze the request to understand the context parameter format
  3. Add to config: Add the new exam type to the exam_types section in your config file:
"NEW_EXAM": {
  "name": "New Exam Name",
  "api_path": "NEW",
  "contexte_format": "NEW,{academy_code},{year}:X:NEW-1.0,1,,,,"
}
  1. Update exam_type: Set "exam_type": "NEW_EXAM" in your exam_settings

Troubleshooting 🔧

Common Issues

  1. Chrome/ChromeDriver not found:

    • Ensure Google Chrome is installed
    • Selenium 4.x automatically manages ChromeDriver
  2. Config file not found:

    • Copy config.example.json to config.json
    • Fill in your personal information
  3. No results found:

    • Verify your last name spelling
    • Check the academy code
    • Ensure the exam year is correct
  4. Cookie errors:

    • The application automatically refreshes cookies
    • If persistent, delete cookies.json and restart

Contributing 🤝

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Legal Notice ⚖️

This tool is for educational purposes only. Please ensure you comply with the terms of service of the official examination results website. Use responsibly and respect the server resources.

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer ⚠️

This application is not affiliated with the French Ministry of Education or any official examination board. Results should always be verified through official channels. Use responsibly and respect the server resources.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages