Package: edfi-schoology-extractor
Schoology ExtractorThis tool retrieves and writes out to CSV students, active sections†,
assignments, and submissions by querying the Schoology API († sections that are
in an active grading period). For more information on the this tool and its
output files, please see the main repositoryreadme.Special Notes About Working With SchoologyAssignments: the Schoology API appears to have a bug, not returning an assignment's
full text description. The field is in the data model, but will never be populated by
the Schoology Extractor unless and until Schoology fixes the bug.Attendance Events: the Schoology API handlesnegative
attendanceevents: if a student is marked as present, or is not marked at all,
then the system will not return a record for that day.System activities: System usage data in Schoology are only available by downloading
a file through the Schoology website. If you wish to track system student use of the
system, then please readSchoology's instructions on usage
analytics.
Each downloaded file needs to be stored in an input directory, and that
directory must be provided to the extractor configuration.Getting StartedDownload the latest code fromthe project homepageby clicking on the green "CODE" button and choosing an appropriate option. If choosing
the Zip option, extract the file contents using your favorite zip tool.Open a command prompt* and change to this file's directory (* e.g. cmd.exe, PowerShell, bash).Ensure you havePython 3.9+ and Poetry.At a command prompt, install all required dependencies:poetryinstallOptional: make a copy of the.env.examplefile, named simply.env, and
customize the settings as described in the Configuration section below.Openhttps://app.schoology.com/apiand
sign-in with an administrative account to acquire an API key and secret; if
using a.envfile, insert those values into the file.Run the extractor one of two ways:Execute the extractor with minimum command line arguments:poetryrunpythonedfi_schoology_extractor-k[schoologyclientkey]-s[schoologyclientsecret]-fassignmentsAlternately, run with environment variables or.envfile:poetryrunpythonedfi_schoology_extractorFor detailed help, executepoetry run python canvas_extractor -h.ConfigurationApplication configuration is provided through environment variables or command
line interface (CLI) arguments. CLI arguments take precedence over environment
variables. Environment variables can be set the normal way, or by using a
dedicated.envfile. For.envsupport, we provided a.env.examplewhich you can copy, rename
to.env, and adjust to your desired parameters. Supported parameters:DescriptionRequiredCommand Line ArgumentEnvironment VariableSchoology API Keyyes-kor--client-keySCHOOLOGY_KEYSchoology API Secretyes-sor--client-secretSCHOOLOGY_SECRETUsage analytics input directoryno-ior--input-directorySCHOOLOGY_INPUT_DIRECTORYOutput Directoryno (default: [working directory]/data)-oor--output-directoryOUTPUT_DIRECTORYSync database directoryno (default: [working directory]/data)-dor--sync-database-directorySYNC_DATABASE_DIRECTORYLog level**no (default: INFO)-lor--log-levelLOG_LEVELPage sizeno (default: 20)-por--page-sizePAGE_SIZENumber of retry attempts for failed API callsno (default: 4)noneREQUEST_RETRY_COUNTTimeout window for retry attempts, in secondsno (default: 60 seconds)noneREQUEST_RETRY_TIMEOUT_SECONDSFeature***no (default: core, not removable)-for--featureFEATURE** Valid values for the optionallog level:DEBUGINFO(default)WARNINGERRORCRITICAL*** When there's no specified feature, the extractor will always process Users,
Sections, and Section Associations, which are considered the core feature. Other
features (can combine two or more):assignments (Enables the extraction of assignments and submissions)attendance (Enables the extraction of attendance events)activities (Enables the extraction of section activities and system
activities) -EXPERIMENTAL, subject to breaking changesgrades (Enables the extraction of grades) -COMING SOONWhen setting features via.envfile or through environment variable, combine
features by using a bracketed comma-separate list, e.g.FEATURE=[activities, attendance, assignments, grades]. To combine features at the command line,
simply list them together:--feature activities, attendance, assignments, grades.Logging and Exit CodesLog statements are written to the standard output. If you wish to capture log
details, then be sure to redirect the output to a file. For example:poetryrunpythonedfi_schoology_extractor>2020-12-07-15-43.logIf any errors occurred during the script run, then there will be a final print
message to the standard error handler as an additional mechanism for calling
attention to the error:"A fatal error occurred, please review the log output for more information."The application will exit with status code1if there were any log messages at
the ERROR or CRITICAL level, otherwise it will exit with status code0.Developer OperationsStyle check:poetry run flake8Static typing check:poetry run mypy .Run unit tests:poetry run pytestRun unit tests with code coverage:poetry run coverage run -m pytestView code coverage:poetry run coverage reportAlso seebuild.pyfor
use of the build script.Visual Studio Code (Optional)To work in Visual Studio Code install the Python Extension.
Then typeCtrl-Shift-P, then choosePython:Select Interpreter,
then choose the environment that includes.venvin the name.Legal InformationCopyright (c) 2022 Ed-Fi Alliance, LLC and contributors.Licensed under theApache License, Version 2.0(the "License").Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.SeeNOTICESfor
additional copyright and license notifications.