{"id":13502791,"url":"https://github.com/chrivers/pyjaco","last_synced_at":"2025-03-17T03:30:46.440Z","repository":{"id":1400135,"uuid":"1425545","full_name":"chrivers/pyjaco","owner":"chrivers","description":"Python to JavaScript translator","archived":false,"fork":false,"pushed_at":"2013-08-17T12:02:46.000Z","size":1712,"stargazers_count":139,"open_issues_count":42,"forks_count":18,"subscribers_count":5,"default_branch":"ist/compiler","last_synced_at":"2025-02-27T16:59:26.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pyjaco.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"elliotcondon/acf-field-type-template","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrivers.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-01T10:18:45.000Z","updated_at":"2025-02-16T12:02:33.000Z","dependencies_parsed_at":"2022-07-07T11:30:05.284Z","dependency_job_id":null,"html_url":"https://github.com/chrivers/pyjaco","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrivers%2Fpyjaco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrivers%2Fpyjaco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrivers%2Fpyjaco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrivers%2Fpyjaco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrivers","download_url":"https://codeload.github.com/chrivers/pyjaco/tar.gz/refs/heads/ist/compiler","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841204,"owners_count":20356441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:02:25.152Z","updated_at":"2025-03-17T03:30:46.124Z","avatar_url":"https://github.com/chrivers.png","language":"Python","funding_links":[],"categories":["Python","Table of Contents"],"sub_categories":["Languages"],"readme":"pyjaco - Python to JavaScript compiler\n======================================\n\nweb page: http://pyjaco.org\n\nmailing list: http://groups.google.com/group/pyjaco\n\nInstallation\n------------\n\nThere are several ways to install pyjaco. Since pyjaco is still under\ndevelopment we recommend to use virtualenv. Although pythons standard\ninstallation shall work fine.\n\nvirtualenv::\n\n    git clone https://github.com/chrivers/pyjaco\n    virtualenv nameOfVenv\n    cd pyjaco\n    ../nameOfVenv/bin/python setup.py install\n\nstandard::\n\n    git clone https://github.com/chrivers/pyjaco\n    cd pyjaco\n    python setup.py install\n   \n.. case 3 is maybe outdated?\n\nmake::\n\n    git clone https://github.com/chrivers/pyjaco\n    cd pyjaco\n    make\n\n\nUsage\n-----\nIn general there are two ways to use pyjaco. The first is to compile a \nPython file to a JavaScript file and the second is to invoke the \ncompiler into a python script.\n\npy file to js file (with and without virtualenv)::\n    \n    pyjs.py [options] \u003cinfile\u003e -o \u003coutfile\u003e\n    \n    pathToVenv/bin/pyjs.py [options] \u003cinfile\u003e -o \u003coutfile\u003e\n\nWhere \u003cinfile\u003e is the name of a file that will be compiled.\nIf the infile is a directory, all files in that directory that have\nan extension of .py or .pyjaco will be compiled to .js files into the output \ndirectory. \n\nto generate the buildins, run::\n\n    pyjs.py -b generate\n\nFor more parameter see the options section.\n\ninvoke the compiler into a python program::\n\n    import sys\n    from pyjaco import Compiler\n    code = open(\"tojs.py\", \"r\")\n    compiler = Compiler()\n    compiler.append_string(code.read())\n    print str(compiler)\n\n\n\nExamples\n--------\n\nLike explained previously there are 2 ways to use pyjaco. In the pyjaco folder \nyou can find a few examples that you can use for testing.\n\npy file to js file::\n\n    pyjs.py tests/algorithms/fib.py -o fib.js\n\n\ninvoked::\n\n    python examples/gol.py \u003e examples/gol.html\n    firefox examples/gol.html\n\n\nIf it doesn't work, it's a bug. \n\n\nOptions\n-------\n\navailable options::\n\n  -h, --help            show this help message and exit\n  -o OUTPUT, --output=OUTPUT\n                        write output to OUTPUT, can be a file or directory\n  -q, --quiet           Do not print informative notes to stderr\n  -b BUILTINS, --builtins=BUILTINS\n                        INCLUDE builtins statically in each file \n                        IMPORT builtins using a load statement in each file \n                        GENERATE a separate file for builtins (output must be a directory) \n                        NONE don't include builtins\n  -I, --import          IMPORT builtins using a load statement in each file\n                        This is an alias for -b import\n  -w, --watch           Watch the input files for changes and recompile. If\n                        the input file is a single file, watch it for changes\n                        and recompile. If a directory, recompile if any .py or\n                        .pyjaco files in the directory have changes.\n\n\nTests\n-----\n\nPyjaco brings a test facility with it. However, to run the test sets a JS console\nis necessary. See here: http://code.google.com/p/v8/\n\nRun all tests, that are supposed to work. ::\n\n    ./run_tests.py\n\nRun all tests with \"foo\" in the name. Useful for running a group of tests. ::\n\n    ./run_tests.py foo\n\nRun all tests including those that are known to fail (currently). It\nshould be understandable from the output. ::\n\n    ./run_tests.py -a\n\nRun tests but ignore if an error is raised by the test. This is not\naffecting the error generated by the test files in the tests directory. ::\n\n    ./run_tests.py -x\n    or\n    ./run_tests.py --no-error\n\nFor more flags then described here, use -h option ::\n\n    ./run_tests.py -h\n    \n\nSingle test cases\n-----------------\n\nWith the \"casetest\" script you can keep comparing the output of pyjaco to\nthe output of python on the same python script. It's very useful if you are\ndebugging the compiler or standard library.\n\n./casetest foo.py\n\nWill run foo.py through python and pyjaco, and display the differences. It\nwill then display a line of \"#\", and wait for you to press enter to do another\niteration. When the files match, casetest will exit.\n\n\nLicense\n-------\n\nFree Software. See the LICENSE file for exact details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrivers%2Fpyjaco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrivers%2Fpyjaco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrivers%2Fpyjaco/lists"}