Skip to content

poweif/brpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

183 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brpy is a browser-side interactive python client that stresses edit-as-you-go rapid-prototyping. The long term goal of the project is to provide a Mathematica-like environment where students, teachers, applied math enthusiasts and engineers can express their ideas and collaborate on projects.

With this platform, it should be simple to create standalone lessons, learning modules, and algorithm walkthrough/demos. brpy currently provides markdown and latex-style output and glut-based WebGL hooks. (In the future, we might provide built-in d3 support and canvas2D support.)

brpy is built on a fork/branch of skulpt.

Outline

This project is roughly divided into three parts:

  1. Modification to skulpt

    • Added a few modules (webgl, threejs math)
    • Patched missing language feature (inheritance)
    • Associated dom elements to python-code evaluation
    • Allow for KaTeX and kramdown (kramed)
  2. Server-side

    • Tornado
    • Cache-level file-saving
      • 1st level is mongoDB for fast access
      • 2nd level is the user's Google Drive or the server-side disk
      • Allow developers save-to-disk
  3. Client-side

Requirements

Enable save to user's gDrive (strongly recommended)

Installation

  • For the python packages, you can use pip to install them:
pip install simplejson google-api-python-client tornado motor watchdog
  • Clone the forked skulpt (in the brpy root dir.):
git clone https://github.com/poweif/skulpt.git

Enable save to user's gDrive

  • mongoDB installation
  • Google API
    • Go to the Google API console
    • Create a new project, give it a name
    • After you've selected the project, (on the left-hand side) go to API & auth -> APIs
    • Make sure the following APIs are enabled:
      • Drive API
      • Drive SDK
    • Go to API & auth -> Credentials -> Create Client ID
      • Choose 'Service accountandJSON key`
      • Click Create Client ID
      • Download JSON for the Client ID you just created
    • Rename the client ID file to client_secret.json
    • Move client_secret.json to ./tools/files/

Running the server

  • Run script in skulpt to generate skulpt javascript library. If you're developing the forked skulpt, then watch.py is useful as it will watch for changes and update the resulting lib. Otherwise, just run it once and stop it with Ctrl-C.
cd skulpt
python ./tmp/watch.py ../js
  • Run sass to generate css files. This can also be terminated with Ctrl-C if you will not be changing the sass files.
./tool/sass
  • Make sure the Google API Client ID file is present as ./tools/files/client_secret.json

  • Run the server (terminate with Ctrl-C)

python tools/server/tornado_server.py
  • Open browser to http://localhost:8124

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors