A command-line tool for interacting with Canvas LMS
Project description
๐ Canvas CLI
Automate your Canvas LMS submissions with a git like command-line interface!
Are you tired of navigating through the Canvas web interface to submit assignments? Canvas CLI puts the power of Canvas in your terminal, making it easy to submit assignments and manage your Canvas interactions with simple commands.
โจ Features
- ๐ค Submit assignments directly from your terminal
- ๐ Initialize projects with course and assignment information for quick submissions
- โ๏ธ Configure once, use anywhere with global and project-specific settings
- ๐ Fast and efficient workflow for developers and students who live in the terminal
๐จ Pre-Release Notice
This project is currently in pre-release status. Most features are working, but you might encounter some rough edges or features marked as "Not Implemented" (NI).
๐ ๏ธ Installation
# Clone this repository
git clone https://github.com/yourusername/canvas-cli.git
cd canvas-cli
# Install in development mode
pip install -e .
After installation, the canvas command will be available in your terminal!
๐ง Configuration
Before using the tool, configure it with your Canvas API token:
canvas config set --global token YOUR_CANVAS_API_TOKEN
canvas config set --global host your-institution.instructure.com
๐ Getting Your Canvas API Token
- Log in to your Canvas account
- Go to Account > Settings
- Scroll down to "Approved Integrations"
- Click "New Access Token"
- Generate a token with appropriate permissions
- Copy the token for use with Canvas CLI
๐ Commands
โก Initialize a Project
canvas init
This interactive command helps you set up a project configuration for faster assignment submissions.
๐ค Submit an Assignment
# Full command (works anywhere)
canvas push -cid COURSE_ID -aid ASSIGNMENT_ID -f path/to/submission.py
# In an initialized project directory:
canvas push # Uses saved course ID, assignment ID, and file
canvas push -f different.py # Override the default file
# Get info on the course and assignment
canvas status --course_details
โ๏ธ View Configuration
canvas config --global list
canvas config --local list
๐ Finding Course and Assignment IDs
Course and Assignment IDs can be found in the URLs of your Canvas pages:
-
Course ID: The number in the URL after "courses/" (e.g.,
https://canvas.instructure.com/courses/123456โ Course ID is123456) -
Assignment ID: The number in the URL after "assignments/" (e.g.,
https://canvas.instructure.com/courses/123456/assignments/789012โ Assignment ID is789012)
๐ Example Workflow
# Create a new project directory
mkdir python_assignment
cd python_assignment
# Create your solution file
echo "print('Hello, Canvas!')" > solution.py
# Submit your solution when ready
canvas push -cid 123456 -aid 789012 -f solution.py
๐ Troubleshooting
- Authentication Error: Make sure your API token is valid and has the required permissions
- File Not Found: Double-check the path to your submission file
- Course/Assignment Not Found: Verify the course and assignment IDs
๐ Requirements
- Python 3.6+
- Requests library
๐ License
This project is open source and available under the GPL v3 License.
๐ Roadmap & TODOs
Future improvements and features planned for Canvas CLI:
- ๐ Consider git remote paradigm over npm package.json for
canvas init - โฌ๏ธ Add
canvas pullto download current submissions and assignment descriptions - โ๏ธ Implement cascading config scope like git
- ๐
Build a TUI for getting course ID and assignment ID from name - ๐ Add ability to retrieve versioning of submissions
- ๐
Implementgit status-like command to get due dates, grading status, and comments- ๐ Get grades via submissions
- ๐๏ธ Show completed vs open assignments
- ๐ฌ Add commands for commenting on submissions
- ๐จ Improve CLI interface and error handling
- ๐ Add more detailed documentation and examples
- ๐ฌ Add a github actions integration to automatically submit on push to main
- ๐ฆ Package the tool for easy installation via pip or conda
- ๐ค Add support for zipping up multiple folders for submission
- ๐ฆ Add support for submitting multiple files at once
- ๐ Add support for pagination
- ๐ Add file select support to TUIs
๐ค Contributing
Contributions are welcome! Feel free to submit pull requests or open issues to improve the tool.
๐ Related Projects
Tired of clicking into a file module to download it? Try canvas-file-downloader for a simple extension to download files from Canvas.
Made with โค๏ธ by a student who was tired of clicking through Canvas
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file canvas_cmd-0.1.2.tar.gz.
File metadata
- Download URL: canvas_cmd-0.1.2.tar.gz
- Upload date:
- Size: 45.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d175bec70fd6572ed59e0ee02ec1757b2280f80537a432a72abac10eaaecb720
|
|
| MD5 |
e7a034d9c5f72e8ab0293ee2871ec127
|
|
| BLAKE2b-256 |
f238e92e3d22ad5a13d9ce5b62837f7d66c613fbda559e440a008e6aed5f8b5c
|
Provenance
The following attestation bundles were made for canvas_cmd-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on PhantomOffKanagawa/canvas-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
canvas_cmd-0.1.2.tar.gz -
Subject digest:
d175bec70fd6572ed59e0ee02ec1757b2280f80537a432a72abac10eaaecb720 - Sigstore transparency entry: 199985444
- Sigstore integration time:
-
Permalink:
PhantomOffKanagawa/canvas-cli@c2a5233ea8865ed1c5787b54df579648ddb89ce3 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/PhantomOffKanagawa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c2a5233ea8865ed1c5787b54df579648ddb89ce3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file canvas_cmd-0.1.2-py3-none-any.whl.
File metadata
- Download URL: canvas_cmd-0.1.2-py3-none-any.whl
- Upload date:
- Size: 36.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d268f8f1fef689e558a651078ccb0e73d20cb2d05b22b76a1b5ce9f3661a870
|
|
| MD5 |
b40d84b625d5e052e47bc11bdef13485
|
|
| BLAKE2b-256 |
9eee788eff85633340ceba9f3bb4b0109e7064442d4273da10a6e59e9ef4ed03
|
Provenance
The following attestation bundles were made for canvas_cmd-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on PhantomOffKanagawa/canvas-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
canvas_cmd-0.1.2-py3-none-any.whl -
Subject digest:
5d268f8f1fef689e558a651078ccb0e73d20cb2d05b22b76a1b5ce9f3661a870 - Sigstore transparency entry: 199985445
- Sigstore integration time:
-
Permalink:
PhantomOffKanagawa/canvas-cli@c2a5233ea8865ed1c5787b54df579648ddb89ce3 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/PhantomOffKanagawa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c2a5233ea8865ed1c5787b54df579648ddb89ce3 -
Trigger Event:
release
-
Statement type: