Offline alternative Memento

Hello everyone, I’m posting in this category now because, in hindsight, it is more appropriate than the General Discussion forum in which my last post was hidden.

Offline Memrise-like alternative Memento.

I want to demonstrate a personal alternative to Memrise than I’ve been building for the last 5 weeks called Memento. It is now open-sourced and available to download here for Windows, Linux and Android

It’s an offline, local application that is directly compatible with Memrise courses and anything else you decide to build and share for it (though at the moment the application itself does not have the ability to build courses on its own so you would have to do it manually with any text editor).

It operates offline on course files stored on your local device. Most course files are stored as Json while the multimedia levels are stored as Markdown files. Images and audio are also stored as plain files (e.g. mp3, jpg, png) in one of the course’s folders.

It supports testing on text, images and audio and has support for mnemonics (called mems in Memrise). There’s a short 6 minute video demo on the Github page. Actions are louder than words so I recommend watching the video that can demonstrate the application much better than I can.

There’s also a python script included for downloading Memrise courses and exporting them to a Memento format.

I built Memento mainly for myself, but I would be happy to know if it makes someone else happy too.
It is licensed with the GNU General Public License v3.0 so you can do whatever you want with it, as long as any derivatives of it use the same license.

As some other users mentioned previously, this could also serve as a way to backup your courses (especially community courses) so that they are not entirely at the mercy of the Memrise leadership.

5 Likes

Go to the releases page
Screenshot_20210705_162411

To download a prebuilt version for your device.

Now that you also downloaded memento-master.zip, you can extract only the helper_scripts folder that contains the Python script. Then you need to open a terminal (or command prompt or powershell in Windows), use the cd command to enter the folder with the python script and execute it like this

python scrape_memrise.py MEMRISE_COURSE_URL

The script itself will show you more instructions if you execute it without giving it any other arguments

This will begin downloading the course you’ve specified through the URL in the current working directory of the terminal. Finally you will have a new folder that contains all the course’s files. Afterwards you just place it somewhere, launch Memento, go to the settings page and use, for example, the browse button to locate the folder which contains the course folder you just downloaded. Then you can place any other courses you download in the same folder.

Hopefully this helps

EDIT: If you want to change something like a typo, open the course’s folder, then open the seedbox.json file with any text editor, search for the typo and change it. Then you just re-open the course through the app (no need to restart it) and the changes will be visible.

Are you referring to changing how many times you are tested on an item for the first time before it is fully “learned”? By default this is 5 and at the moment I have not implemented a way to change it, but I’ll look into it for the next public release.

1 Like

Sorry, that picture was just a guide where to find the releases page. I should’ve just given it like this

You don’t need to do what you’re doing right now, like installing Qt - that’s for compiling the app from source. You only need to go to the releases page page and download a ready-made archive for Windows or Linux or the APK for Android.

1 Like

Python needs to remain installed as long as you wish to use the script for downloading Memrise courses and converting them to a Memento format.

On a side note, I am looking for a way to integrate it into the app itself so that you don’t need to install Python and use the script manually. Hopefully I’ll manage to do that eventually.

You can place the “Build” folder anywhere and give it any name. The app can be run just by starting the executable - no need to install it.

Oh this is my bad. I did not know that the Python requests module is not built in so I did not mention installing it in the instructions.

If you don’t already have pip installed, get it from this guide

Now install the requests python module by writing

python -m pip install requests

in the command line

Also if you haven’t done so already, install beautiful soup in the same way

python -m pip install beautifulsoup4

Now this should hopefully cover everything and the script should work.

1 Like

installed requests and the soup.
Now when running the scrape sript, I get this:

Gathering preliminary data
Traceback (most recent call last):
File “C:\Program Files (x86)\Memento-master\helper_scripts\scrape_memrise.py”, line 73, in
course = MemriseCourse(a, destination)
File “C:\Program Files (x86)\Memento-master\helper_scripts\MemriseCourse.py”, line 48, in __ init__
soup = BeautifulSoup(requests.get(url).content, features=“lxml”)
File “C:\Users\jakub\AppData\Local\Programs\Python\Python39\lib\site-packages\bs4__ init__.py”, line 243, in __ init__
raise FeatureNotFound(
bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml. Do you need to install a parser library?

Yeah that’s another thing I didn’t foresee. Is it fixed if you execute the following?

python -m pip install lxml

Also: it seems it is skipping audio …? Then it will be of little use to me to scrape the course(s). On the other hand, I do not need mnemonics. How to set it to scrape the course including audio but excluding mnemonics?

Was I not supposed to enter a path to which to save the course? I have not done anything but wrote the source URL as the arguemnt of the scrape_memrise.py

But the course you showed me before doesn’t have any audio…

And if you want to skip scraping mnemonics, just pass the -m option like this

python scrape_memrise.py -m URL

By default audio is included too. If you specifically want to exclude it, you can pass the -n like above. Try giving it a course that has audio though.

EDIT: Actually in your case it seems to have an issue with the path. I think I’ve made a mistake with the script that makes it difficult to use in Windows operating systems. I’ll push a fix soon, but if you want to fix it now, you’ll have to

  1. open the file MemriseCourse.py
  2. near the top find the line that begins with forbiddenFileCharacters
  3. remove the colon character → :
  4. save and then rerun the script

Also thanks for staying with me for so long. It appears I’ve missed to test some things in Windows.

After removing the colon from the script, it downloads the lessons, and then it says:

Traceback (most recent call last):
File “C:\Program Files (x86)\Memento-master\helper_scripts\scrape_memrise.py”, line 74, in
course.autoScrape(destination, minLevel, maxLevel, skipAudio, skipMnemonics)
File “C:\Program Files (x86)\Memento-master\helper_scripts\MemriseCourse.py”, line 365, in autoScrape
self.writeCourseInfo(destination)
File “C:\Program Files (x86)\Memento-master\helper_scripts\MemriseCourse.py”, line 170, in writeCourseInfo
os.mkdir(self.courseDir)
PermissionError: [WinError 5] Access denied: ‘C:\Program Files (x86)\Memento-master\helper_scripts\Manual of Standard Tibetan’

So, if I understand it well, it automatically downloads the course to the same directory where the script is located. And Windows does not give it access to the Programs folder. Should I move the script to some folder where Windows should not deny access and run again?

Yes it appears that is the problem this time. The easiest way would be to move the script somewhere else, or you could manually give it another location with the -d option

python scrape_memrise.py -m -d "C:\Users\USERNAME\Desktop" URL

Or something like that. This will combine skipping mnemonics and changing the location.

Did it finally finish normally?

Damn it, yet another Windows-specific problem I didn’t test for. I’ve pushed a fix. Can you download this new MemriseCourse.py from here and replace your current one

https://raw.githubusercontent.com/mementoseeds/Memento/development/helper_scripts/MemriseCourse.py

Also this time, execute the command like this

python scrape_memrise.py -m -f 1 -t 1 -d "C:\Users\USERNAME\Desktop" URL

This will make it download only the first level. This way it’ll be easier to tell if there are any remaining problems without downloading the entire course only to fail at the last moment. If it succeeds then you can try downloading the entire course again.

I apologize for stringing you along this far. If it doesn’t work yet again, tomorrow I’ll spin up a Windows virtual machine and try the script on Windows for myself and fix any problems I find.

I guess it worked this time. That is, I got no error message when scraping.

Now, it is a bit unintuitive to start using the app:
Used the course-location BROWSE button and entered the directory in which the directory with the course is contained.
Seemed lost again when I did not see what to do next. Only later I realized I had to go back to the settings and press Refresh to get the course listed.

Perhaps I need to make a better explanation for this step.

Basically every course is a folder that contains some files and more folders. You’ve already seen that after the Python script outputted a folder with some files in it, correct?

What you have to do is place that folder in another folder like this

–top folder
----course folder one
----course folder two

And in the app’s settings you have to select the top folder - I.E. the folder that contains all the course folders, NOT the course’s own folder.

Afterwards you just restart the app and you’re done.

EDIT: Actually you have to manually click the “Refresh courses” button to make the course visible or enable the option to auto-refresh courses on startup and then restart the app.

Thanks, got it now. I did happen to enter the top folder. What I initially did not do is using the refresh button.

Now, I believe, before I proceed to download the whole course, I must delete this entire directory of the course that contains only the one level.

Yes, if the script sees you already have a folder with the same name, it will abort very early on to prevent conflicts.

I hope you can finally enjoy the app :sweat_smile:

Actually no I have not implemented that. Right now you can only manually change the location where the course will be downloaded. Afterwards the course’s folder will be named after the course’s title. However the name of the folder does not matter for the app because it will read the proper title from the info.json file.

Actually, right now the folder’s name only affects the order of your courses. If you have multiple courses, they will be ordered alphabetically according to their folder names inside the app course list (I’ll implement a proper sorting function eventually)

Is this another course different from the one you showed me before?

No there’s no problem. If the names are the same, just rename the folder. Like I said, the folder’s name only affects the order of your courses in the app’s course list.

Yes, you can set a range of which levels to download for a course. However, if you wanna download the entire course, you have to download it again - you can’t just download the missing part and merge it with the one you already have.

I don’t understand this part.