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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codegrade-17.0.55-py3-none-any.whl (741.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codegrade-17.0.55.tar.gz
  • Upload date:
  • Size: 315.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for codegrade-17.0.55.tar.gz
Algorithm Hash digest
SHA256 dfa767af8581e78301d9410be9894ce0ecc253c2dc5c5b046d6f1728d8883006
MD5 b1dc5afa3a0cc097a7c4464684806877
BLAKE2b-256 e850498e8f13617648c0a5f297932da348c738c228c454e0e89f7548a0f74f79

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: codegrade-17.0.55-py3-none-any.whl
  • Upload date:
  • Size: 741.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for codegrade-17.0.55-py3-none-any.whl
Algorithm Hash digest
SHA256 70d5ba6c80038afe665a644f87828fc3f95879d6219a01f57cffe4a9ad4907e7
MD5 5c0438cc9616d9462f0ecec55162ee5d
BLAKE2b-256 d937d7017d20a5c19d2a7b04b9d134e29ff905e3e239f2232a1d63c7767a2edf

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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