Code Monkey home page Code Monkey logo

epfl-moodle's Introduction

Requirements

  • setuptools for the installation (in the python package setuptools in debian)
  • python-3.4 or above.
  • BeautifulSoup (installed by the setup.py)
  • requests (installed by the setup.py)
  • keyring (installed by the setup.py). Note that depending on your desktop environment, you might also need to install keyrings.alt.
  • requests-cache (optional)
  • A moodle account subscribed to at least one course

Installation

Type:

git clone git://github.com/gcmalloc/epfl-moodle.git
cd epfl-moodle
python setup.py install

Usage

Do, with $username as your gaspar username :

moodle $username

This will initialise a moodle configuration file in the current directory. A menu will be then displayed, choose which course you would like to keep up to date in this directory. Then the script will download all the specified courses.

Then

moodle $username

will update all the course kept in this directory

You can also simply download a single course with

moodle $username $course-url

With $course-url, the url of the course you want to scrap.This url must match the following scheme: http://moodle.epfl.ch/course/view.php?id=$id

The files will be downloaded in the current directory.

epfl-moodle's People

Contributors

antoinealb avatar gcmalloc avatar smarter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

epfl-moodle's Issues

Proper argument passing

We must have the possibility to use the software to download a list of courses.
An argument parser would be, therefore mandatory.

parsing filenames with non-ascii characters

At EPFL, many courses are taught in french, resulting in filenames with non-ascii characters (such as é,à,ê,è,...). It currently results in the following error :
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 25: ordinal not in range(128) (example for filename Introduction, e-mail forgé).
Below the traceback :

Traceback (most recent call last):
  File "/usr/local/bin/moodle", line 4, in <module>
    __import__('pkg_resources').run_script('epfl-moodle==0.5.0', 'moodle')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 742, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1510, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/epfl_moodle-0.5.0-py2.7.egg/EGG-INFO/scripts/moodle", line 179, in <module>

File "/usr/local/lib/python2.7/dist-packages/epfl_moodle-0.5.0-py2.7.egg/EGG-INFO/scripts/moodle", line 165, in main
File "/usr/local/lib/python2.7/dist-packages/epfl_moodle-0.5.0-py2.7.egg/EGG-INFO/scripts/moodle", line 72, in course_download

  File "build/bdist.linux-x86_64/egg/epfl_moodle/moodle.py", line 26, in __str__
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 25: ordinal not in range(128)

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.