Package: ralph-malph
Ralph, the ultimate Learning Record Store (and more!) for your learning analyticsDocumentation:https://openfun.github.io/ralphSource Code:https://github.com/openfun/ralphRalph is a toolbox for your learning analytics, it can be used as a:LRS, a HTTP API server to collect xAPI statements (learning events), following theADL LRS standardcommand-line interface(CLI), to build data pipelines the UNIX-way™️,library, to fetch learning events from various backends, (de)serialize or
convert them from and to various standard formats such asxAPI, oropenedxhtml⚡️ Quick start guide: Run the LRS serverPreliminary notes:curl,jqanddocker composeare required to run
some commands of this tutorial. Make sure they are installed first.In order to run the Elasticsearch backend locally on GNU/Linux operating
systems, ensure that your virtual memory limits are not too low and
increase them (temporally) if needed by typing this command from your
terminal (asrootor usingsudo):sysctl -w vm.max_map_count=262144Reference:https://www.elastic.co/guide/en/elasticsearch/reference/master/vm-max-map-count.htmlTo bootstrap a test environment on your machine, clone this project first and
run thebootstrapMakefile target:makebootstrapThis command will create required.envfile (you may want to edit it for your
test environment), build the Ralph's Docker image and start a single node
Elasticsearch clusterviaDocker compose.You can check theelasticsearchservice status using thestatushelper:makestatus# This is an alias for: docker compose psYou may now start the LRS server using:makerunThe server should be up and running athttp://localhost:8100. You can check its status using
the heartbeat probe:curlhttp://localhost:8100/__heartbeat__The expected answer should be:{"database":"ok"}If the database status is satisfying, you are now ready to send xAPI statements
to the LRS:gunzip-cdata/statements.json.gz|\head-n100|\jq-s.|\curl-Lk\--userralph:secret\-XPOST\-H"Content-Type: application/json"\-d@-\http://localhost:8100/xAPI/statements/The command above fetches one hundred (100) example xAPI statements from ourPotsieproject and sends them to the LRS
usingcurl.You can get them back from the LRS usingcurlto query the/xAPI/statements/endpoint:curl-s\--userralph:secret\-H"Content-Type: application/json"\http://localhost:8100/xAPI/statements/\|jqNote that usingjqis optional in this case, it is used to improve response
readability. It is not required to install it to run this snippet.⚡️ Quick start guide: Manipulate data with the CLIWith the Docker imageRalph is distributed as aDocker
image. IfDockeris installed on your machine, it
can be pulled from DockerHub:dockerrun--pullalways--rmfundocker/ralph:latestralph--helpWith the Python packageRalph is distributed as a standard python package; it can be installedviapipor any other python package manager (e.g.Poetry, Pipenv, etc.):# Install the full packagepipinstall\ralph-malph[full]# Install only the core package (library usage without backends, CLI and LRS)pipinstallralph-malphIf you installed the full package (including the CLI, LRS and supported
backends), theralphcommand should be available in yourPATH. Try to
invoke the program usage thanks to the--helpflag:ralph--helpYou should see a list of available commands and global flags forralph. Note
that each command has its own usage that can be invokedvia:ralphCOMMAND--helpYou should substituteCOMMANDby the target command,e.g.list, to see
its usage.MigratingSome major version changes require updating persistence layers. Check out themigration guidefor more information.ContributingThis project is intended to be community-driven, so please, do not hesitate to
get in touch if you have any question related to our implementation or design
decisions.We try to raise our code quality standards and expect contributors to follow
the recommendations from ourhandbook.Useful commandsYou can explore all available rules using:makehelpbut here are some of them:Bootstrap the project:make bootstrapRun tests:make testRun all linters:make lintIf you add new dependencies to the project, you will have to rebuild the Docker
image (and the development environment):make down && make bootstrapLicenseThis work is released under the MIT License (seeLICENSE).