Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christianp/canvaslms_sync
A command-line tool to synchronise a local folder with one in a Canvas LMS course
https://github.com/christianp/canvaslms_sync
canvas canvas-lms canvas-lms-api sync
Last synced: 10 days ago
JSON representation
A command-line tool to synchronise a local folder with one in a Canvas LMS course
- Host: GitHub
- URL: https://github.com/christianp/canvaslms_sync
- Owner: christianp
- License: mit
- Created: 2022-01-13T12:49:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-13T13:13:25.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T16:09:43.436Z (about 1 month ago)
- Topics: canvas, canvas-lms, canvas-lms-api, sync
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Canvas LMS folder sync
This is a command-line tool and Python package to synchronise a local folder with one in a Canvas LMS course.
In order to use this, you need a Canvas API token linked to an account which has permission to create files in your target course's Files section.
See [the Canvas API documentation](https://canvas.instructure.com/doc/api/file.oauth.html#manual-token-generation) for instructions on how to get a token.## Installation
Python 3.8 or newer is required.
To install the package, run:
```
pip install canvaslms_sync
```This provides a shell command `canvas_sync`.
## Usage
```
canvas_sync local_folder remote_url -t CANVAS_API_TOKEN
```You can store your Canvas API token in a file like this:
```
[Canvas]
canvas_api_token = TOKEN
```By default, the script looks for this file in `credentials.ini` in the current working directory, but you can specify a different path with the `-c` option.
Hidden files and folders (those whose names start with `.`) are ignored by default. You can include them with the `--include-hidden` option.
## Development
I followed the [Python packaging tutorial](https://packaging.python.org/en/latest/tutorials/packaging-projects/) to make this package.
To build this package, you need `twine` and `build`:
```
python3 -m pip install twine build
```First, build the distributable files:
```
python3 -m build
```That produces `.tar.gz` and `.whl` files in `./dist`.
You can try installing the package in a different virtualenv with `pip install dist/canvaslms_sync-$VERSION-py3-none-any.whl`.To upload to PyPI:
```
python3 -m twine upload --repository pypi dist/*
```