Skip to content

Udhay-Adithya/vit_ap_vtop_api

Repository files navigation




License: MIT License: MIT Version 0.1.5 License: MIT


This API, built with FastAPI, serves as a wrapper for the vitap-vtop-client library. It allows students of VIT-AP to programmatically access their academic information such as profile, attendance, timetable, exam schedules, marks, and more from the VIT-AP VTOP Portal.

Table of Contents

  1. Overview
  2. Features
  3. Installation
  4. Running the Application
  5. Endpoints
  6. Example Usage
  7. Contributing
  8. License
  9. Future Updates
  10. Companion App

Overview

The VIT-AP VTOP API is designed to help students access their academic information programmatically. It is built using Python with FastAPI and relies on the vitap-vtop-client library to scrape data from the V-TOP Portal using the user’s credentials.

Features

  • User Profile Info: Retrieve detailed student profile information.
  • Attendance: Get attendance records for a specified semester.
  • Biometric Log: Access daily biometric (in/out) logs.
  • Time Table: Fetch the class timetable for a given semester.
  • Grade History: Retrieve academic grade history, including CGPA and credit details.
  • Mentor Details: Get information about the assigned faculty mentor.
  • Exam Schedule: Access the schedule for upcoming examinations for a semester.
  • Marks Details: Fetch marks obtained in various assessments for a semester.
  • Outing Requests Status: Retrieve the status of submitted general and weekend outing requests.

Installation

This project uses Poetry for dependency management.

  1. Clone the repository:

    git clone https://github.com/Udhay-Adithya/vit_ap_vtop_api.git
    cd vit_ap_vtop_api
  2. Install dependencies using Poetry:

    poetry install

For a detailed development setup, see CONTRIBUTING.md.

Running the Application

To run the FastAPI application locally for development:

  1. Ensure you have an .env file configured with necessary environment variables (e.g., API_KEY).
  2. From the project root directory, run:
    poetry run uvicorn src.main:app --reload
    The application will typically be available at http://127.0.0.1:8000.

Endpoints

All API endpoints are documented in detail in the DOCS.md file. This includes information on request parameters, response formats, and authentication.

Example Usage

Fetch All Student Data

Here's an example of how to fetch comprehensive data for a student using Python's requests library. Remember to replace placeholders with actual values and include your API-KEY in the headers.

import requests
import json

api_url = 'http://127.0.0.1:8000/student/all_data'
api_key = 'YOUR_API_KEY' # Replace with your actual API key

payload = {
    "registration_number": "YOUR_REGISTRATION_NUMBER", # e.g., "21BCE0001"
    "password": "YOUR_VTOP_PASSWORD",
    "sem_sub_id": "YOUR_SEMESTER_ID" # e.g., "VL20232405" for Fall Semester 2023-24
}

headers = {
    'X-API-KEY': api_key,
    'Content-Type': 'application/json'
}

try:
    response = requests.post(api_url, headers=headers, data=json.dumps(payload))
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    data = response.json()
    print(json.dumps(data, indent=2))
except requests.exceptions.HTTPError as errh:
    print(f"Http Error: {errh}")
    print(f"Response content: {response.text}")
except requests.exceptions.ConnectionError as errc:
    print(f"Error Connecting: {errc}")
except requests.exceptions.Timeout as errt:
    print(f"Timeout Error: {errt}")
except requests.exceptions.RequestException as err:
    print(f"Oops: Something Else: {err}")
    if response:
        print(f"Response content: {response.text}")

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

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

Future Updates

We are committed to improving this API and the companion app. Future updates will include new features, bug fixes, and performance improvements.

Companion App

I have also developed a companion app for this API. The VITAP Student App provides a user-friendly interface for accessing your academic information on your mobile device. You can find the app repository here.

We encourage users to try out the app and provide feedback. Future updates will enhance both the API and the app to better serve the needs of VIT-AP students.


Thank you for using the VIT-AP VTOP API! If you have any questions or need further assistance, feel free to open an issue on GitHub.

About

A light-weight FastAPI wrapper to the vtop-api-client

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published