Giter Site home page Giter Site logo

kthutils's Introduction

This package provides various utilities for automation at KTH. It provides the following modules:

  • kthutils.ug
    Access the UG editor through Python.

  • kthutils.participants
    Read expected course participants through Python.

  • kthutils.iprange
    Read IP ranges for computers in lab rooms.

  • kthutils.forms
    Read forms data (CSV) from KTH Forms.

We also provide a command-line interface for the modules. This means that the functionality can be accessed through both Python and the shell.

An example

We want to add the user dbosk as teacher in the group

edu.courses.DD.DD1317.20232.1.teachers.

In Python, we would do

import kthutils.credentials
import kthutils.ug

ug = kthutils.ug.UGsession(*kthutils.credentials.get_credentials())

group = ug.find_group_by_name("edu.courses.DD.DD1317.20232.1.teachers")
user = ug.find_user_by_username("dbosk")

ug.add_group_members([user["kthid"]], group["kthid"])

In the shell, we would do

kthutils ug members add edu.courses.DD.DD1317.20232.1.teachers dbosk

Installation and documentation

Install the tools using pip:

python3 -m pip install -U kthutils

You can read the documentation by running pydoc on the package:

python3 -m pydoc kthutils

kthutils's People

Contributors

dbosk avatar dependabot[bot] avatar

Watchers

 avatar  avatar

kthutils's Issues

Add `forms next` command

We want to have a forms next command that can be used to treat a form as a "generator". This way we just get new things compared to last time we ran it.

Generalize forms command

  • Add command to list what forms one has access to on KTH Forms.
  • Add command to add any form one has access to on KTH Forms.

Create a CLI for kthutils

Should be a CLI called kthutils that has every submodule as a subcommand.

Use typer to construct the CLI. That should be quite straight-forward.

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.