Kontr Portal REST Api Client
Project description
Kontr Portal REST API Client
Kontr Portal REST API Client is the Portal REST API wrapper over the resources in the portal. It supports CRUD operations and simple management over entities.
Kontr 2 is the project created on FI MUNI to test and execute students solutions for programming assignments.
Setup
Install and update using the pip:
$ pip install kontr-api
Simple examples
Simple examples how to configure and user the API Client.
Example how to manage the users.
from kontr_api import KontrClient
portal_url='https://localhost'
username='admin'
password='123456'
kontr_client = KontrClient(url=portal_url, username=username, password=password)
# List all users
kontr_client.users.list()
# Create new user
kontr_client.users.create(username='xlogin', name='Test user', uco='123456')
# Get user
user = kontr_client.users.get('xlogin')
# Update user's name
user['name'] = 'new name'
user.update() # or use the kontr_client.users.update({ 'name': 'new name' }, 'xlogin')
# Set user's password
user.set_password('Password.123')
# Delete the user
user.delete() # or use the kontr_client.users.delete('xlogin')
Contributing
Take a look at the contribution guide.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kontr-api-0.1.2.tar.gz
(15.5 kB
view hashes)
Built Distribution
kontr_api-0.1.2-py3-none-any.whl
(27.1 kB
view hashes)
Close
Hashes for kontr_api-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f75cac371d3d7af20facb2dd043b2dce16128a7f75cceaff05418818694f9b5 |
|
MD5 | 1ad3604162d15c992679897d29dafe46 |
|
BLAKE2b-256 | c3811759def10ebcf48a25e52b85a2ae5dfe243faaca843ccb2cfc07cb9f4430 |