Code Monkey home page Code Monkey logo

twerp's Introduction

twerp

Tethering Wiki to ERP

It uses the hercules API to update the 'Metakgp' wiki pages every semester for all the relevant pages with all the possible details. It is aimed at being the one bot that needs to run once a semester for updating all the relevant info, including calling blackjack (bot for grades update) and performing the duties of kakashi bots

Inspiration

Rajat is a twerp. He complains about the wiki not being updated frequently and is not willing to edit the pages by himself..... Presenting to you twerp - The complete remedy for twerp. Let the bot handle it.

Abilities

As of now it can

  • Add the timetable for the courses being offered by IITKGP in a semester to the corresponding page on metakgp wiki. Example

  • Update the time-table of existing prof pages.

  • Updates the course pages with the data obtained from the google form.

To-Dos

  • Update the pages on professors with the following features (The script written will be running on per semester basis ):

    • Time Table of non-existing prof pages by creating the page first and adding to it.
    • Append to his profile, the list of courses that he taught in a semester.
  • Call (a modified) Blackjack script to update the grades.

Using twerp

  • Running using pipenv:
        Clone and change your directory to this repo and run pipenv install:
            This will install the requirements and will create a virtual environment

        Run pipenv shell:
            This will activate the virtualenv

  • Running using pip:
        Clone and change your directory to this repo and run pip install -r requirements.txt

  • Run the setup.py file if you have downloaded first time or want to add a new wiki or modify an old wiki configurations:
        python3 setup.py

  • It will first clone pywikibot repo in folder named wiki_files in your current directory

  • It will ask for the link of the wiki and with which you want to save it:     For metakgp write:
            link = https://wiki.metakgp.org/w/Main_Page
            name = metakgp         family = 5 (it'll be mediawiki)

  • It will then generate user files (set username as Twerp) and don't set any bot password yet, it will ask during runtime

  • Run the bot :
        python3 twerp.py

For updating data from form under Course Archiving Drive

We are collecting information from masses to update courses on metakgp wiki in this form. Below is the process on how to update from the sheet to the wiki using twerp.

  • First enable the Google Sheets API, check here for its doc.
  • Obtain the credentials.json file from the Google API Console.
  • Create a new sheet which is a copy of the response sheet and delete the entries till we have already updated (mentioned below).
  • See about the sheetID of the new Google Spreadsheet and basic usage of Google Sheet API here
  • It will ask for the sheetID during runtime, make sure you should have the credentials.json file in the same folder as twerp.py
  • If the script stops in between, please remove entries till the row that have been updated during this runtime otherwise duplicate entries will be created.

Once the update is done, manually verify if the update was successful and make edits if any necessary.

NOTE: Updated till row number 29

Contribution

Join the slack channel : metakgp.slack.com

twerp's People

Contributors

aditimaurya avatar ayushk4 avatar berserker1 avatar dependabot[bot] avatar thealphadollar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twerp's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.