Skip to main content

A client library for accessing CodeGrade

Project description

CodeGrade API

This library makes it easier to use the CodeGrade API. Its API allows you to automate your usage of CodeGrade. We are currently still busy documenting the entire API, but everything that is possible in the UI of CodeGrade is also possible through the API.

Installation

You can install the library through pypi, simply run python3 -m pip install codegrade. If you want to get a dev version with support for the latest features, simply email support@codegrade.com and we'll provide you with a dev version.

Usage

First, create a client:

import codegrade

# Don't store your password in your code!
with codegrade.login(
    username='my-username',
    password=os.getenv('CG_PASSWORD'),
    tenant='My University',
) as client:
    pass

# Or supply information interactively.
with codegrade.login_from_cli() as client:
    pass

Now call your endpoint and use your models:

from codegrade.models import PatchCourseData

courses = client.course.get_all()
for course in courses:
    client.course.patch(
        PatchCourseData(name=course.name + ' (NEW)'),
        course_id=course.id,
    )

# Or, simply use dictionaries.
for course in courses:
    client.course.patch(
        {"name": course.name + ' (NEW)'},
        course_id=course.id,
    )

For the complete documentation go to https://python.api.codegrade.com.

Backwards compatibility

CodeGrade is constantly upgrading its API, but we try to minimize backwards incompatible changes. We'll announce every backwards incompatible change in the changelog. A new version of the API client is released with every release of CodeGrade, which is approximately every month. To upgrade simply run pip install --upgrade codegrade.

Supported python versions

We support python 3.6 and above, pypy is currently not tested but should work just fine.

License

The library is licensed under AGPL-3.0-only or BSD-3-Clause-Clear.

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

codegrade-16.1.72.tar.gz (254.7 kB view details)

Uploaded Source

Built Distribution

codegrade-16.1.72-py3-none-any.whl (651.9 kB view details)

Uploaded Python 3

File details

Details for the file codegrade-16.1.72.tar.gz.

File metadata

  • Download URL: codegrade-16.1.72.tar.gz
  • Upload date:
  • Size: 254.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for codegrade-16.1.72.tar.gz
Algorithm Hash digest
SHA256 12ebf990ef885a61c6540908a5ad2548bc1a3f0fd47eac2cfd1ab4c9f4effe5a
MD5 d1123fdca6397e12afbac79c3ea8303a
BLAKE2b-256 3ab14d466265f761189811d373aa598eff33a4b7ccb3f460a3831f6f4f639d08

See more details on using hashes here.

Provenance

The following attestation bundles were made for codegrade-16.1.72.tar.gz:

Publisher: production_build.yml on CodeGra-de/CodeGra.de

Attestations:

File details

Details for the file codegrade-16.1.72-py3-none-any.whl.

File metadata

  • Download URL: codegrade-16.1.72-py3-none-any.whl
  • Upload date:
  • Size: 651.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for codegrade-16.1.72-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb8b923ca701ed01c39dfb0e2164e5cb23e99d89abd5a8e96a1438df8813307
MD5 1fd84ef424cb55a808363f2270a6bb2c
BLAKE2b-256 6870fa3ad70aa9e51e878d517042ca68b706ee9847dcee1850f4415677847f04

See more details on using hashes here.

Provenance

The following attestation bundles were made for codegrade-16.1.72-py3-none-any.whl:

Publisher: production_build.yml on CodeGra-de/CodeGra.de

Attestations:

Supported by

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