Code Monkey home page Code Monkey logo

sis-cli's Introduction

sis-cli

sis-cli offers command line functionality to access osiris.ru.nl for Radboud students. It is shipped with a Python class that serves as an API and that can easily be adapted to other projects and a wrapper around it that serves as the command line interface.

Dependencies

Install requests to use the API, and additionally click and tabulate to use the client.

Usage

First sign in using

python sis.py sign-in

the client will then ask for your credentials and will store an access token at ~/.osiris_token so you don't need to sign in every time. Then, you can use any of the commands like this:

python sis.py <command_name>

Some commands have optional parameters. To read more about a command, use

python sis.py <command_name> --help

Finally, for maximum convenience add

alias sis="python REPO_PATH/sis.py"

to your .bashrc. If you have any further questions, feel free to contact me or add an issue.

sis-cli's People

Contributors

gigadoc2 avatar robert-30 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gigadoc2

sis-cli's Issues

Grades error

Logging in using the instruction provided and then running python sis.py grades results in the error shown below.

Traceback (most recent call last):
  File "/home/borroot/builds/sis-cli/src/sis.py", line 239, in <module>
    osiris()
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/borroot/builds/sis-cli/src/sis.py", line 26, in grades
    grades = api.grades(100)
  File "/home/borroot/builds/sis-cli/src/sisAPI.py", line 159, in grades
    return self._getData('resultaten?limit=' + str(limit)).json()['items']
KeyError: 'items'

I am using the following packages.

certifi==2020.12.5
chardet==4.0.0
click==7.1.2
idna==2.10
requests==2.25.1
tabulate==0.8.7
urllib3==1.26.2

And python version 3.9.1 on Arch Linux.

Grades display error

Logging in using the instruction provided and then running python sis.py grades results in the error shown below.

Traceback (most recent call last):
  File "/home/borroot/builds/sis-cli/src/sis.py", line 239, in <module>
    osiris()
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/borroot/builds/sis-cli/src/venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/borroot/builds/sis-cli/src/sis.py", line 26, in grades
    grades = api.grades(100)
  File "/home/borroot/builds/sis-cli/src/sisAPI.py", line 159, in grades
    return self._getData('resultaten?limit=' + str(limit)).json()['items']
KeyError: 'items'

I am using the following packages.

certifi==2020.12.5
chardet==4.0.0
click==7.1.2
idna==2.10
requests==2.25.1
tabulate==0.8.7
urllib3==1.26.2

And python version 3.9.1 on Arch Linux.

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.