Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add import/export functionality #62

Merged
merged 4 commits into from
Oct 10, 2019
Merged

Conversation

psvenk
Copy link
Member

@psvenk psvenk commented Oct 4, 2019

Description: This PR adds two command-line options, json and out. The json option allows the user to specify a JSON file to read from (instead of scraping Aspen), similar to running ./serve.js fake but with control over what file is used. The out option allows the user to specify a file to which JSON containing information about the user's grades, schedule, etc. is dumped. This JSON file can be read later by using the json option with Aspine's serve.js. Additionally, the arguments insecure and fake are now accepted both as arguments and as options (so ./serve.js --insecure is equivalent to ./serve.js insecure).

Examples:

# Load sample file, equivalent to "fake" argument
./serve.js --json=./public/sample2.json

# Dump data into 2019-10-03.json
./serve.js --out=2019-10-03.json

# Read from 2019-10-03.json instead of scraping Aspen
./serve.js --json=2019-10-03.json

Use case: Aspen only allows students to see their current year and the previous year, thereby stopping students from viewing their grades from two years ago. This feature will make it much easier for students to archive their gradebook. Additionally, graduating students will be able to save their gradebook for future reference in case their accounts are terminated upon graduation.

Future additions: Some features that might be nice to implement down the road:

  • Import/export functionality from the Web interface, so that the user won't have to host Aspine on their own computer to backup their Aspen data
  • Add the Aspine version number to the JSON so that users will know what version of Aspine to download if a future version breaks compatibility
  • Add support for "previous year" grades in Aspine (relevant here because the previous academic year would be included in exports)

psvenk added 4 commits October 3, 2019 18:47
Pull in latest changes from upstream
The command-line options "json" and "out" have been introduced. If the "json"
option is given, the json file at the given path is used instead of scraping
Aspen. If the "out" option is given, Aspen is scraped as usual, but the data
are dumped to a json file at the given path.
Command-line options are now allowed for "insecure" and "fake", i.e.
`serve.js --insecure` and `serve.js --fake` are now valid
(in addition to `serve.js insecure` and `serve.js fake`)
@Ruborcalor Ruborcalor merged commit 9ffc3c6 into Aspine:master Oct 10, 2019
@psvenk psvenk deleted the add-backup branch October 11, 2019 21:54
psvenk added a commit that referenced this pull request Apr 2, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 15, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 15, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 15, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 20, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 20, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 20, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 20, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 20, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 21, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 26, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 26, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 26, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request Apr 30, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
psvenk added a commit that referenced this pull request May 2, 2020
These options were added in <#62>
as a server-side import/export feature, but they no longer work as
intended since lazy loading was added in
<#77>.
In any case, this is superseded by the client-side import/export feature
and the lite version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants