Giter Club home page Giter Club logo

moodle-download's Introduction

moodle-download

moodle-dowload.py is a small Python script to download a set of specifed files from the Moodle e-learning platform. You can create profiles (simple JSON files) that provide information on the courses and use regular expressions to determine which files should be downloaded and where they belong.

So far this has only been tested with the e-learning platform (v2.9) at University of Heidelberg. In principle, this could work for other Moodle platforms as well, but some modifications might be necessary.

If you want to check for new files and download them automatically, just set up a cron job or use a systemd service that runs moodle-download.py periodically.

Installation

  1. Download or clone the repository from GitHub.
  2. Install the requirements: sudo pip install -r requirements.txt
  3. Create necessary directories: mkdir -p ~/.config/moodle-download/profiles
  4. Copy your configuration file to ~/.config/moodle-download/moodle-download.conf (see moodle-download.conf.example for an example)
  5. Put your profile files in profiles/ (see WS-2015-2016.example for an example)
  6. Optional: Set up a cron job or a systemd service.

Profiles

All profile files must be valid JSON files. For every course you take, add a new dictionary to the profile. The key should be the course title (but doesn't really matter), id is the Moodle course id (see URL of overview page), short is a short description that will be used for symlinks, and downloads lists the files to download. The first element is a regular expression that should match the files to download, second specifies the rename pattern and the third determines the download location.

Requirements

Please install the following Python packages: docopt, mechanize, pgi. You can do that by running:

sudo pip install -r requirements.txt

License

GNU General Public License (GPLv3), see LICENSE.txt for further details.

moodle-download's People

Contributors

markus-beuckelmann avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

amrsobhy

moodle-download's Issues

OSError: dlopen(libglib-2.0.0.dylib, 6): image not found

sudo -H pip install -r requirements.txt
Collecting mechanize (from -r requirements.txt (line 1))
Downloading mechanize-0.2.5.tar.gz (383kB)
100% |████████████████████████████████| 385kB 572kB/s
Collecting docopt (from -r requirements.txt (line 2))
Downloading docopt-0.6.2.tar.gz
Collecting pgi (from -r requirements.txt (line 3))
Downloading pgi-0.0.10.1.tar.gz (224kB)
100% |████████████████████████████████| 225kB 892kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "/private/tmp/pip-build-XY3HAD/pgi/setup.py", line 18, in
import pgi
File "pgi/init.py", line 10, in
from .importer import require_version, get_required_version
File "pgi/importer.py", line 12, in
from .clib.gir import GIRepository, GIError
File "pgi/clib/gir/init.py", line 8, in
from .giargument import GIArgument
File "pgi/clib/gir/giargument.py", line 9, in
from ..glib import gboolean, gint8, guint8, gint16, guint16, gint32, guint32
File "pgi/clib/glib.py", line 16, in
_glib = find_library("glib-2.0")
File "pgi/clib/_utils.py", line 99, in find_library
_internal[name] = cdll.LoadLibrary(_so_mapping[name])
File "/Users/amrsobhy/miniconda/lib/python2.7/ctypes/init.py", line 443, in LoadLibrary
return self._dlltype(name)
File "/Users/amrsobhy/miniconda/lib/python2.7/ctypes/init.py", line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libglib-2.0.0.dylib, 6): image not found

any clue what's going wrong when attempting to install requirements?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.