{ "info": { "author": "Szymon Sidor", "author_email": "szymon.sidor@gmail.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 3.3" ], "description": "### Preprocessor\n\nSuited for simple preprocessing of Python files. The original use case of the package was annoying Cython work to do with data types. Notice that Preprocessor can run on any type of file (e.g. TSV, C++ sources etc.). To avoid clashes with other programming language preprocessor prefix and suffix is fully tunable.\n\n#### Example\nHere's a small file where we replicate the same Cython code 3 times - once for every of int, float and double datatypes. You can find the code for `typed_expression` function in `sample_utils.py` in this repo.\n\n```Python\npyp\nfrom sample_utils import typed_expression\nypy\n\ncdef class Mat:\n cdef CMat[dtype] matinternal\n int dtype\n\n def sum(Mat self):\n # Inline preprcoessor expression. Executes a function.\n # Generally inline expressions should be one line,\n # But can be extended to multiple where all the data\n # on second line and following will be captured into\n # a string argument passed as last positional argument\n # to a function\n pypinline typed_expression(pyp, \"self.matinternal\", \"CMat\",\n print('siema')\n return WrapMat(TYPED_EXPRESSION.sum())\n ypy\n```\n\nThe output of the preprocessed file looks like this:\n\n```Python\ncdef class Mat:\n cdef CMat[dtype] matinternal\n int dtype\n\n def sum(Mat self):\n # Inline preprcoessor expression. Executes a function.\n # Generally inline expressions should be one line,\n # But can be extended to multiple where all the data\n # on second line and following will be captured into\n # a string argument passed as last positional argument\n # to a function\n if self.dtype == np.int32:\n print('siema')\n return WrapMat(((self.matinternal)).sum())\n elif self.dtype == np.float32:\n print('siema')\n return WrapMat(((self.matinternal)).sum())\n elif self.dtype == np.float64:\n print('siema')\n return WrapMat(((self.matinternal)).sum())\n else:\n raise ValueError(\"Invalid dtype:\" + self.dtype + \" (should be one of int32, float32, float64)\")\n```\n\n#### Command Line Interface\n\nPreprocessor comes with a command line script, to easily run the preprocessor form environments outside of Python\n\n```bash\npreprocessor --input sample.py.pre --output sample.py\n```", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/nivwusquorum/preprocessor", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nivwusquorum/preprocessor", "keywords": "Macros,Processing,FileIO", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "preprocessor", "package_url": "https://pypi.org/project/preprocessor/", "platform": "any", "project_url": "https://pypi.org/project/preprocessor/", "project_urls": { "Download": "https://github.com/nivwusquorum/preprocessor", "Homepage": "https://github.com/nivwusquorum/preprocessor" }, "release_url": "https://pypi.org/project/preprocessor/1.1.3/", "requires_dist": null, "requires_python": null, "summary": "Preprocessor for files.", "version": "1.1.3" }, "last_serial": 1667753, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3cf45fa6265b6f72eeab11d18c06b972", "sha256": "67c650d82037a1fedcd7f17c4f72549c1e7c82156306d3a2bd33b813a68831dc" }, "downloads": -1, "filename": "preprocessor-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3cf45fa6265b6f72eeab11d18c06b972", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1045, "upload_time": "2015-08-02T08:08:58", "url": "https://files.pythonhosted.org/packages/92/b4/1fec6c776e8e6d9f65bd5367b26ee708f70c140759cd59de760b2b27d795/preprocessor-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "9abf4e00b8a102f86338d50850722d50", "sha256": "cbec262a02306221f649c52c54074365f4b8b3d2cbabac464ed66cd8436903f6" }, "downloads": -1, "filename": "preprocessor-1.0.1.tar.gz", "has_sig": false, "md5_digest": "9abf4e00b8a102f86338d50850722d50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1122, "upload_time": "2015-08-02T08:11:07", "url": "https://files.pythonhosted.org/packages/37/99/48bd2dda648004aa0d0adb82a57d1b546d034fbe7b7167769d7657c726c2/preprocessor-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "82e0feb5b7f421b8b20b150e1e6fc0bb", "sha256": "29f1c3de36789fa55d59fc6dc75d6e361a56f4ce2a80a2fbe8bd39c420f50c50" }, "downloads": -1, "filename": "preprocessor-1.0.2.tar.gz", "has_sig": false, "md5_digest": "82e0feb5b7f421b8b20b150e1e6fc0bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2134, "upload_time": "2015-08-02T08:13:06", "url": "https://files.pythonhosted.org/packages/9b/c0/9fac1d0483f95e97b3392ae926638efad62f8a381f5fd835252b1196d2d2/preprocessor-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a5e9907b6e4db89430a4af26f8d7f4bc", "sha256": "a3ff4301afc189b2ac01b432682e1aea15057b1d1d80c327843ea3b9d8de477d" }, "downloads": -1, "filename": "preprocessor-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a5e9907b6e4db89430a4af26f8d7f4bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2154, "upload_time": "2015-08-02T08:16:54", "url": "https://files.pythonhosted.org/packages/c9/db/6f637f4c7d50c176c2ff65eba191e3b54dfeedde3926ac19043e9f0fdc16/preprocessor-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "2651cd2e8f08d311184502ea754c2fea", "sha256": "236ad8802836c1d9210e1f983a8be13ae56ac4fffa5fc668354a83ed6f2d44ee" }, "downloads": -1, "filename": "preprocessor-1.0.4.tar.gz", "has_sig": false, "md5_digest": "2651cd2e8f08d311184502ea754c2fea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3199, "upload_time": "2015-08-02T09:32:40", "url": "https://files.pythonhosted.org/packages/ff/80/75c5092f30fe2a28a318fdba93f68f61ab0bbc937ce5e786d9b02f8d9a7f/preprocessor-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "c5dec97b8ef3370a75b8dd8f1d1d388b", "sha256": "6bea94ab3fad2dd7f604bd297642293e770550c64c13a43f32bcc28e7f3e9ade" }, "downloads": -1, "filename": "preprocessor-1.0.5.tar.gz", "has_sig": false, "md5_digest": "c5dec97b8ef3370a75b8dd8f1d1d388b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3561, "upload_time": "2015-08-02T09:33:37", "url": "https://files.pythonhosted.org/packages/86/bd/9890d584ceefe27820cb4c686c357d72255bc8d5fd1c1ff9f09af801a021/preprocessor-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "e3b2d891cd1d054db28d22aaa6ac2c26", "sha256": "a20bdfaceb4fe213f58ccb7d6015f3f8fac856bf6560ac379ccdc5a1c76b148a" }, "downloads": -1, "filename": "preprocessor-1.0.6.tar.gz", "has_sig": false, "md5_digest": "e3b2d891cd1d054db28d22aaa6ac2c26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3574, "upload_time": "2015-08-03T01:34:49", "url": "https://files.pythonhosted.org/packages/7a/7e/9a8a6d757b41c3fe39d79412dd594bac94bf70b17f910a3c82f35c258806/preprocessor-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "bd34167a64f4bbd482e5e909074b9521", "sha256": "6529f3c3e88f90cee80e54088b79e14bda2a9fc2a933ffb968227d663d8bb9bd" }, "downloads": -1, "filename": "preprocessor-1.0.7.tar.gz", "has_sig": false, "md5_digest": "bd34167a64f4bbd482e5e909074b9521", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3564, "upload_time": "2015-08-03T01:41:08", "url": "https://files.pythonhosted.org/packages/2e/34/631aced0e9f202bd6e2b31bd58493970d9043664721d8258ac355d298f55/preprocessor-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "5a1b4b161239068960f97a8ce7deb7fd", "sha256": "94907c0babc1e7d7dd9f7cab5697148204e04cee497ca3fc58111f6efc1cb740" }, "downloads": -1, "filename": "preprocessor-1.0.8.tar.gz", "has_sig": false, "md5_digest": "5a1b4b161239068960f97a8ce7deb7fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3705, "upload_time": "2015-08-03T06:38:16", "url": "https://files.pythonhosted.org/packages/e9/d7/74ce1f7697d4b6b087c9b31de6034fc2bf156ed9a6ba04d591766601a131/preprocessor-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "005db84ddfa53aab40a5a082bed26ece", "sha256": "662b4e406e775fd381c5a6276cb07bdab9eb4c1c953654cea658ce3ebe51a3d4" }, "downloads": -1, "filename": "preprocessor-1.0.9.tar.gz", "has_sig": false, "md5_digest": "005db84ddfa53aab40a5a082bed26ece", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3713, "upload_time": "2015-08-03T07:01:17", "url": "https://files.pythonhosted.org/packages/55/a7/111f7ee9e3e8e826d74a12ff5a66763ec07a38795d16b118ea25ed0a28ee/preprocessor-1.0.9.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ea08596fd5e9dbbfdd4a13a6d75c3570", "sha256": "766a719024b72d881783269d8a8a042fafe6d9af16e1cc38aaa3b16cd45f46a3" }, "downloads": -1, "filename": "preprocessor-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ea08596fd5e9dbbfdd4a13a6d75c3570", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4111, "upload_time": "2015-08-04T07:17:58", "url": "https://files.pythonhosted.org/packages/f0/79/996a3b21dcaccd9c7155a8c8dfc5d20fbc743df9ec031c3854b867c01515/preprocessor-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "f2b9ea3fb49c43eaba65148f9b676ed1", "sha256": "31c675429c97ef4f1b2181b2150ab63e40c87958cc46d24213b8322b26a6048c" }, "downloads": -1, "filename": "preprocessor-1.1.1.tar.gz", "has_sig": false, "md5_digest": "f2b9ea3fb49c43eaba65148f9b676ed1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4134, "upload_time": "2015-08-05T05:40:37", "url": "https://files.pythonhosted.org/packages/99/9f/386d0108ccbd004e8efb84b3e06fc71f765cf7e4a7fd428c05d9a23941ce/preprocessor-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "3170b0abf50d9890ab7595b5cbe5a9d2", "sha256": "9a3a99caa3bc69944fd920aedaada0e2f4dfc843651022f1299e2f144884eac6" }, "downloads": -1, "filename": "preprocessor-1.1.2.tar.gz", "has_sig": false, "md5_digest": "3170b0abf50d9890ab7595b5cbe5a9d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4152, "upload_time": "2015-08-05T05:42:30", "url": "https://files.pythonhosted.org/packages/76/8c/df8ffd1f31b875f14bc69fcb4f8b8ca01a499bdb175531b4ea2159c21e35/preprocessor-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "ef287ec910666943a30ee17e8f5ce34f", "sha256": "1cf360f24a21a3af8ef4a08837c549d20b5160199f6bbc0e4b7fedfda1822855" }, "downloads": -1, "filename": "preprocessor-1.1.3.tar.gz", "has_sig": false, "md5_digest": "ef287ec910666943a30ee17e8f5ce34f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4211, "upload_time": "2015-08-07T04:24:34", "url": "https://files.pythonhosted.org/packages/96/ad/d9f4ffb9bb97d1cb5bcb876b7932571d4dbaa3eff1701ad45d367f0ea27b/preprocessor-1.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef287ec910666943a30ee17e8f5ce34f", "sha256": "1cf360f24a21a3af8ef4a08837c549d20b5160199f6bbc0e4b7fedfda1822855" }, "downloads": -1, "filename": "preprocessor-1.1.3.tar.gz", "has_sig": false, "md5_digest": "ef287ec910666943a30ee17e8f5ce34f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4211, "upload_time": "2015-08-07T04:24:34", "url": "https://files.pythonhosted.org/packages/96/ad/d9f4ffb9bb97d1cb5bcb876b7932571d4dbaa3eff1701ad45d367f0ea27b/preprocessor-1.1.3.tar.gz" } ] }