Skip to main content

Python bindings for the codePost API

Project description

codePost API Python SDK

Gitter chat Build Status Coverage Status

This package provides a Python library to conveniently access the codePost API from any application or script written in the Python language.

You can learn more about codePost, the best tool for educational code feedback, or check out the documentation for powerful, best-in-class REST API that this Python SDK allows you to control.

You can also dive in directly with the codePost API Python SDK cheatsheet.

Quickstart

This section provides a quick overview of how to install the library and getting started, for more complete information, you can reference our First Steps with the codePost API Python SDK.

  1. This codePost API Python SDK is available on the Python package manager PyPi, and can be installed from all usual sources, such as with pip:
    sudo pipenv install codepost
    
    You can also install the package just for your account (pip install --user codepost) or using a tool such as pipenv which will install the library in a virtual environment (pipenv install codepost).
  2. Once you've import the codepost package, you need to configure it with the API key you've obtained from your Settings page (for other means of setting the API key, read here):
    import codepost
    codepost.configure_api_key("ddafde24389de98434f8df3ee482389de98432afde24482f3428923491344f8df3eef34892349134")
    
  3. You can then directly access the codePost objects:
    course = codepost.course.list_available(name="CS101", period="Spring 2020")[0]
    assignment = course.assignments.by_name("Hello World")
    submissions = assignment.list_submissions()
    for submission in submissions:
        print("{student},{grade}", student="+".join(submission.students), grade=submission.grade)
    
    to print the grades of all submissions of the assignment "Hello World" of the course CS101 in Spring 2020.

Development

The codePost API Python SDK is under active development. At this time, we are welcoming all issues, suggestions and feature requests. Please either post a GitHub issue on this repository, or join our Gitter channel to ask a question.

Running tests

To start developing, install pipenv, then install all dependencies (including development dependencies, with the flag --dev) for this project:

git clone https://github.com/codepost-io/codepost-python
cd codepost-python
pipenv install --dev

Run all tests on all supported versions of Python which you have locally installed:

make test

Run all tests for a specific Python version (modify -e according to your Python target):

pipenv run tox -e py37

Run all tests in a single file for a specific Python version:

pipenv run tox -e py37 -- tests/util/test_misc.py

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

codepost-0.2.29.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

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

codepost-0.2.29-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

Details for the file codepost-0.2.29.tar.gz.

File metadata

  • Download URL: codepost-0.2.29.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.4

File hashes

Hashes for codepost-0.2.29.tar.gz
Algorithm Hash digest
SHA256 9045f7a696dbac8b798e53bdb5b570c639deb89c0b2a840784c06b91a1c0e605
MD5 9466742f26244ae9a8511399e7fca5e2
BLAKE2b-256 3b0cf9eed163b742aa0480c818058ff0db67130f655bc1c08543c6b30867d951

See more details on using hashes here.

File details

Details for the file codepost-0.2.29-py3-none-any.whl.

File metadata

  • Download URL: codepost-0.2.29-py3-none-any.whl
  • Upload date:
  • Size: 50.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.4

File hashes

Hashes for codepost-0.2.29-py3-none-any.whl
Algorithm Hash digest
SHA256 d2c357f91e49584c87238069e8a60ec061d62c33cbaa1f4b47212760b64cf65e
MD5 ee317cfaee5c284241289e2aab473570
BLAKE2b-256 667d634bf7f4033c64063653160aa30fdb0e4040fac3f2fee7afecd3c30b7f7b

See more details on using hashes here.

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