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

Uploaded Source

Built Distribution

kontr_api-0.1.6-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kontr-api-0.1.6.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for kontr-api-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b7f423a1c4e03a954f0071fee40d7f250234b2b5b4306bcbf50ad4c26786f869
MD5 d3b0e1be0b42f712895ff86c8ed7d8c7
BLAKE2b-256 bc81e34be11e9e7cb8a650955f2aad70162ff8c6fd2fd4529e10b9fa643cb20e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kontr_api-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for kontr_api-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9b64ae2adbd2ae317ad80714c735ea234a8ce52bb35a71861a8c47e8130842e4
MD5 e4d2e1f40d244be54a710b3b3b5a2dab
BLAKE2b-256 6bf45da05ca57fe6314d0c85e740f7cc9f800b0e1d4b6ea60ae8ae940d521b3c

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