GithubHelp home page GithubHelp logo

bakalari.js's Introduction

bakalari.js

A simple JavaScript Bakaláři API wrapper.

Installation

You need Node and NPM (Node Package Manager)

npm install @godlessssss/bakalari.js

Usage

// Requiring the library from npm
const Bakalari = require('@godlessssss/bakalari.js')

// Instancing a user with url, username and password
let client = new Bakalari.User('URL', 'USERNAME', 'PASSWORD')

// Logging in to the Bakalari API
client.login()

// Waiting for client to be ready
client.on('ready', async () => {
    // Getting marks info from the API
    let marks = await client.get(Bakalari.Modules.Marks)
    // logging it to the console
    console.log(marks)
});

Available Modules

Main function

await client.get(Module, ...Arguments)

Bakalari.Modules.Marks

await client.get(Bakalari.Modules.Marks)
  • returns Array of Subjects, that contain Marks Array

Bakalari.Modules.Subjects

await client.get(Bakalari.Modules.Subjects)
  • returns Array of Subjects

Bakalari.Modules.Absence

await client.get(Bakalari.Modules.Absence)
  • returns Absence Array and Absence by Subject Array

Bakalari.Modules.Events

await client.get(Bakalari.Modules.Events)
  • returns Array of Events

Bakalri.Modules.Homeworks

await client.get(Bakalari.Modules.Homeworks)
  • returns Array of Homeworks

Bakalari.Modules.UserInfo

await client.get(Bakalari.Modules.UserInfo)
  • returns User Object

Bakalari.Modules.Timetable

  • Permanent Timetable
await client.get(Bakalari.Modules.Timetable)
  • Actual Timetable
await client.get(Bakalari.Modules.Timetable, 'actual')

Bakalari.Modules.Substitutions

await client.get(Bakalari.Modules.Substitutions)
  • returns Array of Substitutions

Bakalari.Modules.FinalMarks

await client.get(Bakalari.Modules.FinalMarks)
  • returns Array of school certificates and Final Marks for your term

Bakalari.Modules.Whatif

await client.get(Bakalari.Modules.Whatif, array_of_marks)
  • Example
await client.get(Bakalari.Modules.Whatif, [
    {
        MarkText: '1',
        Weight: 4,
        SubjectId: ' 2',
        Id: null,
        MaxPoints: 0
    }
])

MarkText: The mark number you want to add to the prediction - must be string

Weight: The weight of the mark

SubjectId: The ID of the subject you want to predict - use Subjects module to get the ID

Id: The ID of mark - prediction marks are always null

MaxPoints: Maximum number of points to get - this is only used when you use points system

  • returns Array of Marks with presumed subject average

bakalari.js's People

Contributors

godlessssss avatar liberatos278 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

liberatos278

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.