{ "info": { "author": "okay", "author_email": "okayzed+okp@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# okp\n\nokp (pronounced like okapi) is a python script that processes .cpy files and\ngenerates C++ code.\n\nif the following code makes you happy, okp might be for you:\n\n def weird_multiply(int a, b):\n for i = 0; i < b; i++:\n a *= b\n return a\n\n\n def main():\n int a, b\n read a, b\n\n print \"WEIRD MULTIPLIED:\", weird_multiply(a, b)\n\n## status\n\nokp is not a good idea for anyone to use, but try it anyways and let me\nknow what you've built\n\n## installation\n\n pip install okp\n\n### motivation\n\ni saw vrsperanza's CPY and the light hit me: a language that looks like python\nbut compiles like C. i decided i want to write programs in it. okp is my\nattempt to write a pre-processor like CPY but in python.\n\n## usage\n\n```\n# print c++ source\nokp -p file.cpy\n\n# compile code\nokp file.cpy\n\n# compile multiple cpy files together\nokp file1.cpy file2.cpy\n\n# specify the executable file\nokp file1.cpy -o ./a.out\n\n# compile and run \nokp file.cpy -r\n\n# compil and run (stdin is passed to the binary) \nokp file.cpy -ri < input.txt\n\n# compile a hybrid project\nokp file1.h file2.cpp file3.cpy -o ./a.out\n```\n\n## features\n\n### from CPY\n\nFeatures that okp implements from CPY are:\n\n* indentation based bracketing\n* automatic parenthesization of conditionals\n* auto variable declarations\n* return multiple values from functions\n* automatic variable destructuring\n* `for` and `rof` loop shorthand (to enable, use `-for` and `-rof` flags)\n* `known` keyword\n* `#raw` include directive\n* disabling auto variable declarations (-ni flag)\n* compilation of hybrid projects\n\nFeatures that are **not** implemented yet:\n\n* export project + Makefile\n\n### original\n\nSome original features of okp to make it look more pythonic are:\n\n* `def` keyword before function names\n* `block` keyword for creating blocks\n* `pass` keyword for no-ops\n* `print` and `read` keywords\n* `self` keyword\n* lines that start with IGNORE_CHAR are not pre-processed\n* triple backticks for multi-line escapes\n\n## further resources and similar projects\n\n* [CPY github](https://github.com/vrsperanza/CPY)\n* [what if c looked more like python](http://cpprocks.com/what-if-c-looked-more-like-python-or-coffeescript/)\n* [coffee++](https://bixense.com/coffeepp/)\n* [MyDef](https://github.com/hzhou/MyDef)\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/okayzed/okp", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "okp", "package_url": "https://pypi.org/project/okp/", "platform": "", "project_url": "https://pypi.org/project/okp/", "project_urls": { "Homepage": "http://github.com/okayzed/okp" }, "release_url": "https://pypi.org/project/okp/0.0.8/", "requires_dist": null, "requires_python": "", "summary": "an compiler for .cpy files", "version": "0.0.8" }, "last_serial": 4896776, "releases": { "0.0.1a0": [ { "comment_text": "", "digests": { "md5": "9f51d9a69851f01ec8a99b6241168397", "sha256": "c8df42d0e0624065184dfa74d47107ad7bf571f6bbfaaede6a040944ad22154e" }, "downloads": -1, "filename": "okp-0.0.1a0.tar.gz", "has_sig": false, "md5_digest": "9f51d9a69851f01ec8a99b6241168397", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14364, "upload_time": "2018-11-25T23:35:21", "url": "https://files.pythonhosted.org/packages/78/ff/e22d7576144e1854a44d778a010748166bdae6b6a798df234f6c81048ac1/okp-0.0.1a0.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4115bb443144d5df011c9df89026e9a2", "sha256": "e2e91ede1999a786301fdcae057507ae27cbed95d04fcb2f4e45a50644ec5a95" }, "downloads": -1, "filename": "okp-0.0.2.tar.gz", "has_sig": false, "md5_digest": "4115bb443144d5df011c9df89026e9a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14558, "upload_time": "2018-12-03T00:13:39", "url": "https://files.pythonhosted.org/packages/e9/74/cc0a2bf0c8ce676e92f1fc740b2c2768f675f856750ce146f260fbb0608b/okp-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "1b93a1fd4f1db9bab7a417e7a89454d1", "sha256": "9bb5d1ec028a84c23282df0a99dc68b655de164116e3331835b6b4fc5e976fac" }, "downloads": -1, "filename": "okp-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1b93a1fd4f1db9bab7a417e7a89454d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14609, "upload_time": "2018-12-03T20:02:22", "url": "https://files.pythonhosted.org/packages/83/72/ae83fadf253a2fee40bd2fc73ffd7b16feaff998975b18ec3957ac9f1aec/okp-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "209ef2e912779ac90d96d7016c89cbba", "sha256": "091b694f7669267e99b21efb408868c632ae99f90496ad6ba2dbbffe0eca2642" }, "downloads": -1, "filename": "okp-0.0.4.tar.gz", "has_sig": false, "md5_digest": "209ef2e912779ac90d96d7016c89cbba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14760, "upload_time": "2018-12-05T17:18:10", "url": "https://files.pythonhosted.org/packages/51/55/368e2c8430daccb4c584037dca888fb19032faa595f9e1967bb84d32395a/okp-0.0.4.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "24e0222439d825a3e7cdba67fabaedaa", "sha256": "fbdaf273ac1b303a624ba09db34b39666ff18df151fafb7d75d9fb00023a69bc" }, "downloads": -1, "filename": "okp-0.0.6.tar.gz", "has_sig": false, "md5_digest": "24e0222439d825a3e7cdba67fabaedaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14948, "upload_time": "2019-01-13T22:08:01", "url": "https://files.pythonhosted.org/packages/f0/e3/5c20ad9c4cc1acf4a3a056660a1b22ccb4203ca48655db5206da4711e52c/okp-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "dd161aa178e32b74d4de95e8f5fc8d4c", "sha256": "b908b9d7a1127844f42746bc91a00281b4dd9a19e02c6c130f394786985d122e" }, "downloads": -1, "filename": "okp-0.0.7.tar.gz", "has_sig": false, "md5_digest": "dd161aa178e32b74d4de95e8f5fc8d4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14978, "upload_time": "2019-03-04T18:54:06", "url": "https://files.pythonhosted.org/packages/a5/4b/2396b2fa3e94e10d1454736d2a6350b27c7c15c6b74f1002f7612ef919cf/okp-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "498ff92cad9c0cc54a8d7cc778a670bd", "sha256": "b7d02e09c91dd234aa37dbc35e768ccb7bc2676d888df8764677d6d96733a0a6" }, "downloads": -1, "filename": "okp-0.0.8.tar.gz", "has_sig": false, "md5_digest": "498ff92cad9c0cc54a8d7cc778a670bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15010, "upload_time": "2019-03-05T00:09:42", "url": "https://files.pythonhosted.org/packages/ed/e6/9943fe7c44f3fc8064b040db5dbf66975e31921720d56222692d57aae191/okp-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "498ff92cad9c0cc54a8d7cc778a670bd", "sha256": "b7d02e09c91dd234aa37dbc35e768ccb7bc2676d888df8764677d6d96733a0a6" }, "downloads": -1, "filename": "okp-0.0.8.tar.gz", "has_sig": false, "md5_digest": "498ff92cad9c0cc54a8d7cc778a670bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15010, "upload_time": "2019-03-05T00:09:42", "url": "https://files.pythonhosted.org/packages/ed/e6/9943fe7c44f3fc8064b040db5dbf66975e31921720d56222692d57aae191/okp-0.0.8.tar.gz" } ] }