Skip to main content

Validator for marugoto game content

Project description

maruval

Command line utilities for marugoto content

Version 0.1.0

Build Status codecov.io PyPI version Code style: black

Installing dependencies

maruval is predominantly written Python, so your machine needs Python and the Python package manager pip for installation. You should already have Python.

To check if you have pip, type which pip3 and/or which pip into your command line. If either command returns a path to pip, you can proceed to Installing maruval.

To install pip, run the following command:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && rm get-pip.py

Now which pip should show a path to a pip executable.

If you want to use marupretty, the JSON pretty printer, you'll need to have the jq utility installed. Get it here and save it as jq in /usr/bin

Installing maruval

Once you have Python, pip3/pip, and maybe jq, run the following:

pip3 install maruval
# or, from the git repo:
git clone https://github.com/uzh/maruval && cd maruval && python.setup.py install

Commands

  • maruval: validate marugoto data
  • marufind a utility to find folders with particular contents
  • marupretty: pretty-print a JSON file or all files in a directory

maruval: validate content

The main tool, maruval, checks for syntax and content errors in your JSON data. Use it on the command line like this:

maruval -f -nw <path-to-content>

Optional arguments:

  • -f/--fail-first will stop maruval after first error
  • -nw/--no-warnings will suppress warning messages

Show help

maruval --help

marufind: find particular content directories

# show directories containing both a videoComponent and textExercise file
marufind videoComponent,textExercise <path-to-content>
# show the opposite
marufind -not videoComponent,textExercise <path-to-content>
# show directories containing any of these files
marufind -any videoComponent,textExercise <path-to-content>
# show directories not containing any of these files
marufind -not -any videoComponent,textExercise <path-to-content>
# show directories containing only page, mail and dialog files
marufind -only page,mail,dialog <path-to-content>
# invert this --- directories containing more than these files
marufind -not -only page,mail,dialog <path-to-content>
marufind --help

marupretty: tidy up a file or content directory

marupretty <path-to-content>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maruval-0.1.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

maruval-0.1.0-py3.7.egg (19.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page