SenecaLearning API
A small, unofficial python API for SenecaLearning. This in a beta stage so please be prepared for bugs and issues. If anyone from SenecaLearning is reading this, a way to drastically improve this project is to introduce a way to create API keys. I am a student so updates may be erractic, but I hope to keep it as up to date as I can. If you can help improve this project in any way - create a pull request! I'm sure there's things I should be doing better and/or differently.
Installation
pip install senecalearning
Usage
import senecalearning
seneca = senecalearning.Login("<Your Login Token")
seneca.<method>
How to get your login token
Unfortunately, Seneca doesn't provide an easy way to get a login token yet, so the only programmatic way I could find to do it was to use Puppeteer and scrape the response data. An example is in the examples folder. Please note, it uses NodeJS, not Python. Apparently there is a Python port of Puppeteer but I couldn't get it to work - perhaps someone smarter might be able to.
Methods
senecalearning.login()
seneca = senecalearning.Login("<Your Login Token>")
Returns None. Required for authentication - SenecaLearning cannot be queried without it.
senecalearning.getCoursesInfo(search="")
seneca.getCoursesInfo(search="<search query>") #i.e. AQA Biology
# Can also be ran with no parameter
seneca.getCoursesInfo()
#Example dictionary item
"Chemistry: AQA GCSE Higher" = {
authors: ["Ewan Melling Flavell", "George Pidgeon", "Dr Eric Demoncheaux"]
courseId: "e39e7f70-d100-11e7-9b85-bbf8589a9044"
darkText: true
description: "chem↵chemis"
firstPublished: "2019-07-05T15:21:36.235Z"
headerImageURL: "seneca-image-cdn:///2018-04/870d464e-1afb-40ed-a6e9-e675579a3f66/chemistry.jpg"
id: "e39e7f70-d100-11e7-9b85-bbf8589a9044"
regions: ["GB"]
sectionIds: ["eb552340-d100-11e7-9b85-bbf8589a9044", "2a3d1970-d122-11e7-bce0-9d60619a6a6b",…]
subscriptionTier: "FREE"
tags: {29304df7-aad4-4b2f-ac43-2fb169c04ebd: [{id: "8b215c64-328d-4600-82b8-18cbe38ca289", value: "AQA"}],…}
visibility: "PUBLIC"
}
Returns nested dictionary. It returns a dictionary with courses that contain the search term. The key is the course title and the value is the metadata associated with that course. Please note, if you run this with no search query, it will return all courses and their metadata - a large amount of data!
senecalearning.getCourseInfo(courseId="")
seneca.getCourseInfo(courseId="<course id>")
Returns dict. It returns a dictionary with metadata about the relevant course. The key is the course title.
senecalearning.getCourseStats(courseId="")
seneca.getCourseStats(courseId="<course id>")
Returns nested dict. It returns a dictionary with all the lessons you have studied in the specified course and their metadata
#Example dictionary item
"Exam-Style Questions - Organic Compounds" = {
averageScore: 0.9259259259259259
averageSessionScore: 0.9259259259259259
bestScore: 1
courseId: "e39e7f70-d100-11e7-9b85-bbf8589a9044"
lastScore: 1
lastStudied: 1601323272
moduleIdsIncorrectLast: []
moduleIdsStudied: ["6ec3e9b0-819a-4d67-9a21-3669d382e6e4", "be975cda-eea5-48ad-97f3-d57bf7fa3910",…]
proficiency: 1
recentSectionEvents: [,…]
sectionId: "131de50f-5cfc-4b68-8a27-9251409aaac2"
sessionModulesCorrect: 25
sessionModulesStudied: 69
sessionsCompleted: 3
studied: True
spacing: 1.9807043651
totalStudyTime: 466
userId: "<REDACTED>"
worstScore: 0.7777777777777778
}
Metadata
Release files for senecalearning 1.0.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| senecalearning-1.0.20.tar.gz | 4.6 kB | Without provenance | Details for senecalearning-1.0.20.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| senecalearning-1.0.20-py3-none-any.whl | Python 3 | none | any | Details for senecalearning-1.0.20-py3-none-any.whl |
Total release size: 10.0 kB
Release files / senecalearning-1.0.20.tar.gz
| Download URL | senecalearning-1.0.20.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbe352eb912f74759b7a92bf5794e7f9bb02b3d4b3f499de5495c969c04ff54f
|
|
BLAKE2b-256 checksum How to use checksums |
540005eb82ca765ae817252e0d614431462edd5f1fa7673a16744f785975985d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
|
Release files / senecalearning-1.0.20-py3-none-any.whl
| Download URL | senecalearning-1.0.20-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ed951150c78886c7c0d6e0ab02d0cdb336e0ad091e7cf751ab829a8fa0e7f57
|
|
BLAKE2b-256 checksum How to use checksums |
f784f9416ab81371c21515416be293c767a4cf63645ed1415da2ab5221aa3e9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
|
Security for senecalearning 1.0.20
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.