A canvas langchain integration
Project description
Canvas langchain document loader
Features:
Indexes Canvas Modules, Pages, Announcements, Assignments and Files
The following file types are supported:
md
htm
html
docx
xls
xlsx
pptx
pdf
rtf
txt
(doc
support would require libreoffice)
Running locally (development)
You can build/run the provided Dockerfile, or install dependencies as described below
Docker
Edit canvas-test.py, fill in the correct api_url, api_key, and course_id.
Run (this also builds docker):
docker run -it $(docker build -q .)
Install Dependencies
pip install -r requirements.txt
Usage example:
from canvas_langchain.canvas import CanvasLoader
loader = CanvasLoader(
api_url = "https://canvas.instructure.com",
api_key = "API_KEY_GOES_HERE",
course_id = 123456789
)
documents = loader.load()
print("\nDocuments:\n")
print(documents)
print("\nInvalid files:\n")
print(loader.invalid_files)
print("")
print("\nErrors:\n")
print(loader.errors)
print("")
print("\nIndexed:\n")
print(loader.indexed_items)
print("")
If errors are present, loader.errors
will contain one list element per error. It will consist of an error message (key named message
) and if the error pertains to a specific item within canvas, it will list the entity_type
and the id
of the resource where the exception occurred.
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
Hashes for canvas_langchain-0.1-1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da90053859cf88b05fe63b5a87d13cec048fa374962edc86acd21953c313a3e9 |
|
MD5 | 5928991c773b5a5e3566d6986680f6a7 |
|
BLAKE2b-256 | 4c51653e80591eceb38bdcd7a86b696f4351331795c9f6a61559216dd218d74b |