Skip to main content

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.

Metadata

Release files for codegrade 18.0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codegrade 18.0.21
File Size Uploaded Provenance Actions
codegrade-18.0.21.tar.gz 362.5 kB With provenance Details for codegrade-18.0.21.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codegrade 18.0.21
File Interpreter ABI Platform Actions
codegrade-18.0.21-py3-none-any.whl Python 3 none any Details for codegrade-18.0.21-py3-none-any.whl

Total release size: 1.2 MB

Release files / codegrade-18.0.21.tar.gz

Download URL codegrade-18.0.21.tar.gz
Size 362.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4810290a6afd352bbe13ce507e5b050e8fe548ad1db41eb9f6c4b60fb6a4a74e
BLAKE2b-256 checksum
How to use checksums
62fdd9e10cde70886efbf9765799855155e39d1111b0f95caedce7f6dbf0d4dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / codegrade-18.0.21-py3-none-any.whl

Download URL codegrade-18.0.21-py3-none-any.whl
Size 880.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36da79598477f132b5da95deeab0fd67bc918b96144e8bc2097c87f3f48fead5
BLAKE2b-256 checksum
How to use checksums
6581caf552c6955d2e515a2fdafe3bd289aa2b0042254ef21e682a7829d8f0b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for codegrade 18.0.21

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for codegrade-18.0.21.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

18.0.21 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page