A command-line http client and other utilities for writing applications that use the autograder.io API.
Project description
Autograder.io Contrib
Contains utilities for writing applications that use the autograder.io API.
We recommend Amir Kamil's autograder-tools for a larger collection of applications.
Obtaining a Token
Log in to autograder.io in Chrome and open up the developer tools from the Chrome menu (View->Developer->Developer Tools on a Mac). Click on a course link. In the developer console, click on a request (e.g. my_roles/ or projects/). Under Request Headers, there is an Authorization entry that looks like "Token ". Copy the hex string and save it to the file .agtoken in your home directory.
The Command Line Interface
This library provides a simple command line interface for sending requests:
$ agcli get /api/users/current/
This interface notably does not support delete requests for safety reasons. If you wish to delete something, please do so through the autograder.io website or (at your own risk) you may use the HTTPClient class described in the next section.
The HTTPClient
The HTTPClient
class is a starting point for sending custom requests in Python applications.
import json
from ag_contrib.http_client import HTTPClient, check_response_status
client = HTTPClient.make_default()
response = client.get('/api/users/current/')
check_response_status(response)
print(json.dumps(response.json(), indent=4))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file autograder-contrib-1.0.0.tar.gz
.
File metadata
- Download URL: autograder-contrib-1.0.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f14d7eca4de7d1e46171e0d9cc507635b7f8361fc3d1aca0dce4e978d11f7461 |
|
MD5 | 8efb294b193d5002eb9aa21879cabe4e |
|
BLAKE2b-256 | 3c1d0bb40ce11e8f7bbb0059e75a99316f7e329df6fce2229610b88089f5a45a |
File details
Details for the file autograder_contrib-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: autograder_contrib-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db54f4ac01c4f8a324384831ba3abc9810d528d2a38cd3c5293ebc1420c72343 |
|
MD5 | 286b99a495872ec45790ad17b1ad2024 |
|
BLAKE2b-256 | 567eab711bae8f428b5cd939ed4f92da1a556892e9e95f2b3ff631a56cb9b6e5 |