├── VERSION
├── tests
├── __init__.py
├── client
│ ├── __init__.py
│ └── test_auth.py
├── test_exceptions.py
├── test_assignments.py
└── test_modules.py
├── canvas_sdk
├── methods
│ ├── __init__.py
│ ├── progress.py
│ ├── quiz_ip_filters.py
│ ├── collaborations.py
│ ├── services.py
│ ├── account_domain_lookups.py
│ ├── submission_comments.py
│ ├── quiz_statistics.py
│ ├── enrollment_terms.py
│ ├── course_audit_log.py
│ ├── quiz_submission_files.py
│ ├── comm_messages.py
│ ├── quiz_assignment_overrides.py
│ ├── poll_submissions.py
│ ├── quiz_extensions.py
│ ├── account_notifications.py
│ ├── conferences.py
│ ├── authentications_log.py
│ ├── favorites.py
│ ├── tabs.py
│ ├── live_assessments.py
│ ├── outcomes.py
│ ├── content_exports.py
│ ├── polls.py
│ ├── outcome_results.py
│ ├── grading_standards.py
│ ├── admins.py
│ ├── account_reports.py
│ ├── quiz_reports.py
│ ├── communication_channels.py
│ ├── user_observees.py
│ ├── logins.py
│ ├── poll_choices.py
│ ├── grade_change_log.py
│ ├── search.py
│ ├── quiz_question_groups.py
│ ├── gradebook_history.py
│ ├── announcement_external_feeds.py
│ ├── assignment_groups.py
│ ├── sis_imports.py
│ ├── roles.py
│ ├── quiz_submission_questions.py
│ ├── custom_gradebook_columns.py
│ └── poll_sessions.py
├── __init__.py
├── client
│ ├── __init__.py
│ ├── auth.py
│ ├── request_context.py
│ └── base.py
├── exceptions.py
└── utils.py
├── setup.cfg
├── MANIFEST.in
├── README.md
├── canvas_python_sdk.sublime-project
├── .gitignore
├── LICENSE
├── setup.py
├── static_methods
├── sections.py
├── account_reports.py
├── users.py
├── accounts.py
└── modules.py
└── scripts
└── README.md
/VERSION:
--------------------------------------------------------------------------------
1 | 1.2.1
2 |
--------------------------------------------------------------------------------
/tests/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/client/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/canvas_sdk/methods/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/setup.cfg:
--------------------------------------------------------------------------------
1 | [bdist_wheel]
2 | python-tag = py3
3 |
--------------------------------------------------------------------------------
/canvas_sdk/__init__.py:
--------------------------------------------------------------------------------
1 | from .client import RequestContext
2 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include README.md
2 | include LICENSE
3 | include VERSION
4 | graft tests
5 |
--------------------------------------------------------------------------------
/canvas_sdk/client/__init__.py:
--------------------------------------------------------------------------------
1 | from .request_context import RequestContext
2 | from .auth import OAuth2Bearer
3 | from .base import get, put, post, delete
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | canvas_python_sdk
2 | =================
3 |
4 | Installation
5 | -------------
6 |
7 | Detailed instructions for installation and configuration of Canvas are provided
8 | on our wiki.
9 |
10 | * [Quick Start](https://github.com/penzance/canvas_python_sdk/wiki)
11 |
12 |
--------------------------------------------------------------------------------
/canvas_python_sdk.sublime-project:
--------------------------------------------------------------------------------
1 | {
2 | "build_systems":
3 | [
4 | {
5 | "name": "Anaconda Python Builder",
6 | "selector": "source.python",
7 | "shell_cmd": "python -u \"$file\""
8 | }
9 | ],
10 | "folders":
11 | [
12 | {
13 | "follow_symlinks": true,
14 | "path": "./"
15 | }
16 | ],
17 | "settings":
18 | {
19 | "tab_size": 4,
20 | "test_command": "python -m unittest discover",
21 | "test_delimiter": ".",
22 | "test_virtualenv": "~/.virtualenvs/canvas_python_sdk",
23 | "translate_tabs_to_spaces": true
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/canvas_sdk/client/auth.py:
--------------------------------------------------------------------------------
1 | from requests.auth import AuthBase
2 |
3 |
4 | class OAuth2Bearer(AuthBase):
5 |
6 | """ Attached Oauth2 HTTP Bearer Authentication to the given Request object """
7 |
8 | def __init__(self, oauth2_token):
9 | if not oauth2_token:
10 | raise AttributeError("OAuth2 token must be a non-empty string value.")
11 | self.oauth2_token = oauth2_token
12 |
13 | def __call__(self, r):
14 | # Modify and return the request
15 | r.headers['Authorization'] = 'Bearer ' + self.oauth2_token
16 | return r
17 |
--------------------------------------------------------------------------------
/canvas_sdk/methods/progress.py:
--------------------------------------------------------------------------------
1 | from canvas_sdk import client, utils
2 |
3 | def query_progress(request_ctx, id, **request_kwargs):
4 | """
5 | Return completion and status information about an asynchronous job
6 |
7 | :param request_ctx: The request context
8 | :type request_ctx: :class:RequestContext
9 | :param id: (required) ID
10 | :type id: string
11 | :return: Query progress
12 | :rtype: requests.Response (with Progress data)
13 |
14 | """
15 |
16 | path = '/v1/progress/{id}'
17 | url = request_ctx.base_api_url + path.format(id=id)
18 | response = client.get(request_ctx, url, **request_kwargs)
19 |
20 | return response
21 |
22 |
23 |
--------------------------------------------------------------------------------
/canvas_sdk/methods/quiz_ip_filters.py:
--------------------------------------------------------------------------------
1 | from canvas_sdk import client, utils
2 |
3 | def get_available_quiz_ip_filters(request_ctx, course_id, quiz_id, **request_kwargs):
4 | """
5 | Get a list of available IP filters for this Quiz.
6 |
7 | 200 OK response code is returned if the request was successful.
8 |
9 | :param request_ctx: The request context
10 | :type request_ctx: :class:RequestContext
11 | :param course_id: (required) ID
12 | :type course_id: string
13 | :param quiz_id: (required) ID
14 | :type quiz_id: string
15 | :return: Get available quiz IP filters.
16 | :rtype: requests.Response (with void data)
17 |
18 | """
19 |
20 | path = '/v1/courses/{course_id}/quizzes/{quiz_id}/ip_filters'
21 | url = request_ctx.base_api_url + path.format(course_id=course_id, quiz_id=quiz_id)
22 | response = client.get(request_ctx, url, **request_kwargs)
23 |
24 | return response
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 |
5 | # log files
6 | *.log
7 |
8 | # secure file
9 | secure.py
10 |
11 | # C extensions
12 | *.so
13 |
14 | # Distribution / packaging
15 | .Python
16 | env/
17 | bin/
18 | build/
19 | develop-eggs/
20 | dist/
21 | eggs/
22 | lib/
23 | lib64/# Backup files
24 | *.~
25 |
26 | # Byte-compiled / optimized / DLL files
27 | __pycache__/
28 | *.py[cod]
29 |
30 | # C extensions
31 | *.so
32 |
33 | # Distribution / packaging
34 | bin/
35 | build/
36 | develop-eggs/
37 | dist/
38 | eggs/
39 | lib/
40 | lib64/
41 | parts/
42 | sdist/
43 | var/
44 | *.egg-info/
45 | .installed.cfg
46 | *.egg
47 | MANIFEST
48 |
49 | # Installer logs
50 | pip-log.txt
51 | pip-delete-this-directory.txt
52 |
53 | # Unit test / coverage reports
54 | .tox/
55 | .coverage
56 | .cache
57 | nosetests.xml
58 | coverage.xml
59 |
60 | # Translations
61 | *.mo
62 |
63 | # Sphinx documentation
64 | docs/_build/
65 |
66 | # Submlime
67 | *.sublime-workspace
68 |
69 | # PyCharm IDE metadata
70 | .idea/
71 |
72 |
73 |
--------------------------------------------------------------------------------
/canvas_sdk/methods/collaborations.py:
--------------------------------------------------------------------------------
1 | from canvas_sdk import client, utils
2 |
3 | def list_members_of_collaboration(request_ctx, id, per_page=None, **request_kwargs):
4 | """
5 | Examples
6 |
7 | curl https://