text: A Python to JavaScript two way converter. Your client side done in a Jiphy.
  Project description
  Write your client side code in a Jiphy! Jiphy is a two-way Python->JavaScript converter. It’s not meant to create runnable Python code from complex JavaScript files, or runnable JavaScript from complex Python projects. Instead, Jiphy enables Python programmers to more easily write JavaScript code by allowing them to use more familiar syntax, and even JavaScript developers to more easily write Python code.
  As a Python developer you can convert existing code in someone else’s project from JavasScript into Python, edit it, and then convert it back before submitting.
  Jiphy’s Design Objectives:
  -
  Write:
  import underscore as _ def my_function(argument1, argument2): if argument1: del argument2 elif argument2: print(argument2) if somevar is someothervar And x is not b: pass
  Get:
  var _ = require('_'); function my_function(argument1, argument2) { if (argument1) { delete argument2; } else if (argument2) { console.log(argument2); } if (somevar === someothervar && x !== b) {} }
  in a jiphy.
  Why jiphy?
  jiphy (pronounced: jiffy) simply stands for JavaScript In, Python Out.
  Jiphy is very different from other attempts at Python -> JavaScript conversion for the following reasons: - Converts in both directions (JavaScript -> Python, Python -> JavaScript). - Allows intermixing of code. You can add a Python function to a JavaScript file and then convert it all to JavaScript. - Converts lines 1:1, so you always know which source line causes which output line. No source mapping needed. - Doesn’t require any extra JavaScript files to be loaded. - Can be used by a single developer without team buy-in.
  Jiphy only supports syntax, but with ES6 around the corner should one day support Classes, default arguments, etc.
  Important things to know when writing Python for conversion to JavaScript
  - Every indented block must have a line after it.
  For instance:
  if something is True: do_something() print("done")
  Is valid as the if statement has a new line after it. However:
  if something is True: do_something() print("done")
  is NOT valid in Jiphy. The lack of a new line makes it impossible to do a 1:1 conversion and still be nicely formatted JS code.
  - jiphy
  from the command line:
  jiphy mypythonfile.py mypythonfile2.py
  or to conform all code to the specified file format
  jiphy mypythonfile.js mypythonfile2.js --conform
  or recursively:
  jiphy -rc .
  which is equivalent to
  jiphy **/*.py
  or recursively conform:
  jiphy -rc --conform .
  or to see the proposed changes without applying them
  jiphy mypythonfile.py --diff
  from within Python:
  import jiphy jiphy.to.javascript(python_code) jiphy.to.python(javascript_code)
  Thanks and I hope you find jiphy useful!
  ~Timothy Crosley
  Project details
  Release history Release notifications | RSS feed
  Download files
  Download the file for your platform. If you're not sure which to choose, learn more about installing packages.