Skip to main content

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.3.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

kontr_api-0.1.3-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file kontr-api-0.1.3.tar.gz.

File metadata

  • Download URL: kontr-api-0.1.3.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.2

File hashes

Hashes for kontr-api-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1dc9f7417f690ee66ff939630debe316dc80ec620ad6372e7f51bd4c36206496
MD5 9eee99108a0ea54fe0a54aa7f3f853e3
BLAKE2b-256 4a17289f8ef3e35b4c6349872c39e1c1a6f70f0ff02efa9319947eef7b01f02f

See more details on using hashes here.

File details

Details for the file kontr_api-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: kontr_api-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.2

File hashes

Hashes for kontr_api-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c925b2854621cf8921e6787819f450faae437da8103f6f5dad3b702830cc074c
MD5 6d4125ac02697a55ffd2662c743865c0
BLAKE2b-256 8c3357a6901423ce72a01e5e621e39a0d52c8de4779ab9e25565854d0cdf478a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page