{ "info": { "author": "ocket8888", "author_email": "ocket8888@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Utilities" ], "description": "pypre\n=====\n\nA python preprocessor\n\nThis package is meant to pre-process raw python 3 files.\n\nUsage\n-----\n\n::\n\n pypre [ -i INPUT_FILE or --input INPUT_FILE ] [ -o OUTPUT_FILE --output OUTPUT_FILE ]\n\n| If an input file is not given, pypre will read input on stdin.\n Likewise, if an output file is not\n| given, pypre will write output to stdout.\n\nSyntax\n------\n\nThe syntax for the preprocessor is fairly simple:\n\n- ``#define []``\n\n This defines a new constant name \"CONST\", optionally with the\n value \"VALUE\". If a VALUE is not specified, \"CONST\" will be\n assigned the value ``None``. \"VALUE\" **must** be a python literal\n value. The primitive objects currently supported are:\n\n - ``int``\n - ``float``\n - ``str``\n - ``bytes``\n This also includes the following primitive collections of\n these types:\n - ``list``\n - ``tuple``\n - ``dict``\n - ``set``\n Finally, values **MUST** be literal. pypre cannot and will not\n interpret ``#define``\\ s that include ``#define``\\ d constant\n names.\n Just like the C/C++ preprocessor, anywhere a ``#define``\\ d\n constant is found within the source code (except on lines\n containing directives) it will be replaced with its value.\n *WARNING:* This does not yet check whether names are inside of\n string literals or comments.\n\n- ``#undef ``\n\n Removes the definition of the name specified by \"CONST\". If the\n name wasn't defined in the first place, nothing happens (or at\n least it shouldn't).\n\n- ``#ifdef ``\n\n Begins a block of conditionally-compiled code. All code up to the\n matching terminator will be included in the output if and only if\n the constant named by \"CONST\" has been defined. (see ``#endif``)\n\n- ``#ifndef ``\n\n Provided mainly for historical reasons, this begins a block of\n conditionally-compiled code similar to ``#ifdef``, but will\n include the enclosed block if and only if the named constant\n \"CONST\" is *not* defined.\n\n- ``#if ``\n\n The real meat of pypre. This begins a block of\n conditionally-compiled code based on the truth-y value of \"EXPR\".\n \"EXPR\" can take two forms. In the first form, it takes a single\n value. It can be - somewhat uselessly - a python literal that\n would be valid as the \"VALUE\" of a ``#define``, or it can be the\n name of a previously-\\ ``#define``\\ d value. In its second form,\n \"EXPR\" looks like: `` `` Where each \"VALUE\" is\n anything that would be valid for a \"VALUE\" in the first form, and\n \"OP\" is a boolean operator. Valid operators and their definition\n are:\n\n - ``=``\n\n The Equality Operator - tests that the two values are\n equal.\n\n - ``!``\n\n The Inequality Operator - tests that the two values are\n NOT equal.\n\n - ``<``\n\n The Less-Than Operator - tests that the first value is\n strictly less than the second.\n\n - ``>``\n\n The Greater-Than Operator - tests that the first value is\n strictly greater than the second.\n\n- ``#else``\n\n If found within a block of conditionally-compiled code, will\n begin a section of conditionally-code that will be included if\n and only if the lines between the directive that started the\n block and the line containing ``#else`` are *not* included.\n\n- ``#endif``\n\n Ends a block of conditionally-compiled code. For every ``#if``,\n ``#ifdef`` and ``ifndef``, there must be exactly one ``#endif``.\n\nGuaranteed Values\n-----------------\n\n| The following values are defined at runtime, and can be overridden\n with an environment variable\n| of the same name:\n\n- ``PYTHON_VERSION``\n\n A tuple of the form \"(MAJOR, MINOR, MICRO)\" where each element is\n of type ``int``. It will default to the version information of\n the interpreter used to run pypre. Setting this will set\n ``PYTHON_MAJOR_VERSION``, ``PYTHON_MINOR_VERSION``, and\n ``PYTHON_MICRO_VERSION`` accordingly.\n\n- ``PYTHON_MAJOR_VERSION``\n\n An ``int`` representing a Python major version number. Will\n default to the major version number of the interpreter used to\n run pypre. If you set this variable through the environment\n variable of the same name, it will set ``PYTHON_MINOR_VERSION``\n and ``PYTHON_MICRO_VERSION`` both to ``0`` (unless those are set\n as well, in which case they will use their defined values).\n\n- ``PYTHON_MINOR_VERSION``\n\n An ``int`` representing a Python minor version number. Will\n default to the minor version number of the interpreter used to\n run pypre. If you set this variable through the environment\n variable of the same name, it will set ``PYTHON_MAJOR_VERSION``\n to ``3`` and ``PYTHON_MICRO_VERSION`` to ``0``. (unless those are\n set as well, in which case they will use their defined values).\n\n- ``PYTHON_MICRO_VERSION``\n\n An ``int`` representing a Python micro version number. Will\n default to the micro version number of the interpreter used to\n run pypre. If you set this variable through the environment\n variable of the same name, it will set ``PYTHON_MAJOR_VERSION``\n to ``3`` and ``PYTHON_MINOR_VERSION`` to ``0``. (unless those are\n set as well, in which case they will use their defined values).\n\n- ``PYTHON_IMPLEMENTATION``\n\n A ``str`` that names the Python implementation. Defaults to the\n output of ``platform.python_implementation()``. Some examples\n include: \u2018CPython\u2019, \u2018IronPython\u2019, \u2018Jython\u2019, \u2018PyPy\u2019.\n\n- ``OS``\n\n A ``str`` naming the operating system. Defaults to the\n ``sysname`` part of the output of ``os.uname()``.\n\n- ``ARCH``\n\n A string specifying the system's architecture. Defaults to the\n output of ``platform.machine()``\n\n- ``IS64``\n\n True if the host processor is 64-bit, otherwise False. Default is\n determined using the ``bits`` part of the output of\n ``platform.architecture()``.\n\n- ``__DATE__``\n\n A literal ``str`` containing the date on which the pre-processing\n is occurring, in the same format as the C++ macro of the same\n name: \"Mmm dd yyyy\". The default value is obtained from the\n output of ``time.strftime(\"%b %d %Y\")``.\n\n- ``__TIME__``\n\n A literal ``str`` containing the local time at which the\n pre-processing is occurring, in the same format as the C++ macro\n of the same name: \"hh:mm:ss\". The default value is obtained from\n the output of ``time.strftime(\"%H:%M:%S\")``.\n\n- ``__IPV6__``\n\n ``True`` if the system supports IPv6 addressing, ``False``\n otherwise. Default value is obtained from the value of\n ``socket.has_ipv6``.\n\n- ``__BYTE_ORDER__``\n\n This is a value representing the native byte order of the host\n machine. Its default value is calculated using the ``struct``\n library and it has no particular guaranteed value. The only thing\n that can be depended upon is that it will be equal to either\n ``__BIG_ENDIAN__`` or ``__LITTLE_ENDIAN__``; never both and never\n neither. *Implementation Note:* As of the time of this writing,\n ``__BIG_ENDIAN__`` is set to the value ``1`` and\n ``__LITTLE_ENDIAN__`` is set to the value ``0``. This is subject\n to change as I may need to specify the endian-ness of bits or\n gods only knows what else in the future.\n\n| Note that if you do choose to override these values, you MUST match\n their type. For example, if\n| the name ``FOO`` is provided with a value of (b'\\\\x69', 15.2), you\n must provide a value that is a\n| 2-tuple of the form (``bytes``, ``float``). In bash, this example\n would look like:\n\n.. code:: bash\n\n FOO=\"(b'my overridden bytes', -1.1)\" pypre\n\nSome caveats and disclaimers:\n-----------------------------\n\n- Do not use spaces in your names or values (except between elements in\n collections) as this will instantly crash the preprocessor.\n- pypre is only built for, and only tested against Python 3 versions.\n Don't be surprised if it doesn't work if run through your Python 2\n interpreter. (Note that you can easily include pypre directives in\n Python 2 code as long as pypre itself is run through Python 3,\n although it will require you to set ``PYTHON_VERSION`` yourself if\n you plan to use it.)\n- Setting ``PYTHON_VERSION`` and one of the more specific\n \"MAJOR\"/\"MINOR\"/\"MICRO\" variables to non-compatible values will cause\n the preprocessor to immediately exit. For example, you can't have\n ``PYTHON_VERSION=(2,7,0)`` and ``PYTHON_MAJOR_VERSION=3`` - be sure\n your environment makes sense.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Sensibility/pypre", "keywords": "preprocessor analysis static compile process preprocess pre-process", "license": "", "maintainer": "", "maintainer_email": "", "name": "pypre", "package_url": "https://pypi.org/project/pypre/", "platform": "", "project_url": "https://pypi.org/project/pypre/", "project_urls": { "Homepage": "https://github.com/Sensibility/pypre" }, "release_url": "https://pypi.org/project/pypre/0.3.0/", "requires_dist": [ "setuptools", "typing" ], "requires_python": "~=3.0", "summary": "A Python 3 Pre-processor", "version": "0.3.0" }, "last_serial": 3618148, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "3fecb723c2c1cdeb341df3d62e493baa", "sha256": "50e0b200f00c4a9c0c337dd726a6ea2123483eb8f0e99e188ee8c485decfd379" }, "downloads": -1, "filename": "pypre-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3fecb723c2c1cdeb341df3d62e493baa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.0", "size": 16944, "upload_time": "2018-02-23T19:12:43", "url": "https://files.pythonhosted.org/packages/64/90/c6c27d3fe750aee5e106fc7ae252dd582a6a9f55526345639501b17a108d/pypre-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ba1625013cb14a1d92b74eeb6960142", "sha256": "8e0cb76fc18bd2143076f3f87cfe25a3c17b88a2594b7949e31021f0cae6fea1" }, "downloads": -1, "filename": "pypre-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6ba1625013cb14a1d92b74eeb6960142", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.0", "size": 26465, "upload_time": "2018-02-23T19:12:44", "url": "https://files.pythonhosted.org/packages/b5/9a/94e09efb29f1a8fe7bedb9a0df6896c90199736017361760dd4036fd385c/pypre-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "3d1154604dc1776ea2c5fdcb7224675b", "sha256": "01a01a0d962f54a98709b8f7a5056b995b2df544a9c9ca132d8d7a2eb65cd55b" }, "downloads": -1, "filename": "pypre-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3d1154604dc1776ea2c5fdcb7224675b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.0", "size": 16957, "upload_time": "2018-02-26T17:22:35", "url": "https://files.pythonhosted.org/packages/69/0f/d3153ab52f6f4032cdf3d4d8905ad42b3017498f74b0195de731f169beb6/pypre-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fbde9b8ee6b01ba2a320e676e234d338", "sha256": "477c5bff8a15186ed38c7956263bd46125a8af2e5c1a97b05eab3100cdfcc5b3" }, "downloads": -1, "filename": "pypre-0.3.0.tar.gz", "has_sig": false, "md5_digest": "fbde9b8ee6b01ba2a320e676e234d338", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.0", "size": 26458, "upload_time": "2018-02-26T17:22:38", "url": "https://files.pythonhosted.org/packages/a0/61/1143fbbdbf3940f487838841b6be7ccd4fd312c1298abaae33448005cdd0/pypre-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3d1154604dc1776ea2c5fdcb7224675b", "sha256": "01a01a0d962f54a98709b8f7a5056b995b2df544a9c9ca132d8d7a2eb65cd55b" }, "downloads": -1, "filename": "pypre-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3d1154604dc1776ea2c5fdcb7224675b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.0", "size": 16957, "upload_time": "2018-02-26T17:22:35", "url": "https://files.pythonhosted.org/packages/69/0f/d3153ab52f6f4032cdf3d4d8905ad42b3017498f74b0195de731f169beb6/pypre-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fbde9b8ee6b01ba2a320e676e234d338", "sha256": "477c5bff8a15186ed38c7956263bd46125a8af2e5c1a97b05eab3100cdfcc5b3" }, "downloads": -1, "filename": "pypre-0.3.0.tar.gz", "has_sig": false, "md5_digest": "fbde9b8ee6b01ba2a320e676e234d338", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.0", "size": 26458, "upload_time": "2018-02-26T17:22:38", "url": "https://files.pythonhosted.org/packages/a0/61/1143fbbdbf3940f487838841b6be7ccd4fd312c1298abaae33448005cdd0/pypre-0.3.0.tar.gz" } ] }