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.2.0.tar.gz
(14.6 kB
view details)
Built Distribution
kontr_api-0.2.0-py3-none-any.whl
(19.9 kB
view details)
File details
Details for the file kontr-api-0.2.0.tar.gz
.
File metadata
- Download URL: kontr-api-0.2.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.14.15-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15d8bbd083a52f27cf4a490a0e59707339cadadf18458154ba500c37b9671a08 |
|
MD5 | b256286d1d2f5bdf8871a0edb72d8a57 |
|
BLAKE2b-256 | b88a83bfaaec0e44c693a0bb0f38cd4dbba956f8dc90a73a967be2f25fbd5e62 |
File details
Details for the file kontr_api-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: kontr_api-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.14.15-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a99806316f1cbd40c16b322c249ca287a69b458b5840a1c07da614ebfd8ede94 |
|
MD5 | 0b55aafed6e120e6b190b869c42e4f9c |
|
BLAKE2b-256 | 460d6d4c188f03cb074be487fbfc76ed7247a64b66918132cfbf66c810e585bc |