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

Uploaded Source

Built Distribution

kontr_api-0.1.4-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kontr-api-0.1.4.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

Hashes for kontr-api-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f6d3b8fc0aacbca091fd621997432422d5f9706eec45ed993f7165dd7eb08cb5
MD5 d3d82230f2d89b6b9aeef5a672e0da96
BLAKE2b-256 969b652a7efd5b1c82b75e6c6fc0cbed13a04cad6ec0acdd3f24f5f9d48d7355

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kontr_api-0.1.4-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

Hashes for kontr_api-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cc9f8da57ff7caa6f9091314fd2ad5dd4fe56ad28b4276a11cc2a8dd86d9de09
MD5 6400603ca9a5872d5280b5ceb622e272
BLAKE2b-256 3de708c3b737708920609a667065557c517bec184081d4b8b96e54ad2ae74073

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