Skip to content

CSE-25/amrita_pyq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static Badge Go Badge GitHub last updated (main)

Amrita PYQ CLI Tool

Amrita PYQ Documentation

amritalogo

Overview

The Amrita PYQ CLI Tool is a command-line interface application that simplifies accessing previous year question papers (PYQs) by directly fetching and displaying them in your default browser.


Prerequisites

Ensure the following requirements are met before using the application:

  • Network: You must be connected to the Amrita WiFi or use a VPN to access the network.
  • Development Environment:
    • Golang must be installed on your system.
    • Ensure a working Go Compiler is set up.
    • golangci must be installed for testing (optional) using the command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

Usage Instructions

Step 1: Connect to Amrita WiFi or VPN

Before using the tool, ensure that you are connected to Amrita WiFi or using a VPN to access the network. This is mandatory for fetching the previous year question papers.

Step 2: Clone the Repository

git clone https://github.com/CSE-25/amrita_pyq

Step 3: Run the Application

  1. Open the main.go file in your preferred code editor (eg:VS Code).
  2. Execute the application:
    go run main.go
  3. A menu will appear with options to choose from.

Output

main


Step 4: Select an Option

  1. Use the menu to choose an option.
  2. The tool will process your request and fetch the desired question paper.

Output

image

image


Step 5: View the Question Paper

  1. Filter: Use the / key to apply a filter and narrow down the list of PDFs.
  2. The question paper will automatically open as a PDF in your default web browser.

Output

image

image

image

The File is opened in PDF format in your default browser(in this case, Microsoft Edge)


Step 6: Continue or Exit

After the PDF is displayed, you will have the following options:

  • Go Back to Main Menu: Select Back to Main Menu to return to the main menu.
  • Exit: Use the Quit option in the menu to close the application.

Output

image


Local Development Environment Setup

golang

Installing Golang

  1. Download Golang Visit the official Golang Downloads Page and select the installer appropriate for your operating system:

    • Windows: .msi installer
    • macOS: .pkg installer
    • Linux: .tar.gz archive
  2. Install Golang

    • Windows/macOS:
      Run the installer and follow the on-screen instructions. This will automatically configure Golang and set environment variables.
    • Linux:
      Extract the archive and move the files to /usr/local:
      sudo tar -C /usr/local -xzf go<version>.linux-amd64.tar.gz
      Add Golang to your PATH by appending this line to your shell's configuration file (~/.bashrc, ~/.zshrc, etc.):
      export PATH=$PATH:/usr/local/go/bin
      Save the changes and reload your shell:
      source ~/.bashrc
  3. Verify Installation Open a terminal and run:

    go version

    If Golang is installed correctly, the installed version will be displayed.

Note
If you encounter any issues related to GOPATH, please refer to the GOPATH Troubleshooting Guide for detailed instructions.


Run Unit Tests

To run all the unit tests for this project use the following command:

go test ./... -v

You will be able to see the output and status for each unit test available.

To run a unit test specific to a package, go to the package location and run:

go test -run "PACKAGE_NAME"

Run Lint check

golangci-lint run

Note: This command will return an output only when it finds an error. Otherwise, no visible change occurs.


Developers


Documentation