{ "info": { "author": "B\u00e1lint Aradi", "author_email": "baradi09@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Pre-processors" ], "description": "*********************************************\nFypp \u2014 Python powered Fortran metaprogramming\n*********************************************\n\n.. image:: https://travis-ci.org/aradi/fypp.svg?branch=develop\n :target: https://travis-ci.org/aradi/fypp\n\nFypp is a Python powered preprocessor. It can be used for any programming\nlanguages but its primary aim is to offer a Fortran preprocessor, which helps to\nextend Fortran with condititional compiling and template metaprogramming\ncapabilities. Instead of introducing its own expression syntax, it uses Python\nexpressions in its preprocessor directives, offering the consistency and\nversatility of Python when formulating metaprogramming tasks. It puts strong\nemphasis on robustness and on neat integration into developing toolchains.\n\nThe project is `hosted on github `_.\n\n`Detailed DOCUMENTATION `_ is available on\n`readthedocs.org `_.\n\nFypp is released under the *BSD 2-clause license*.\n\n\nMain features\n=============\n\n* Definition, evaluation and removal of variables::\n\n #:if DEBUG > 0\n print *, \"Some debug information\"\n #:endif\n\n #:set LOGLEVEL = 2\n print *, \"LOGLEVEL: ${LOGLEVEL}$\"\n\n #:del LOGLEVEL\n\n* Macro definitions and macro calls::\n\n #:def assertTrue(cond)\n #:if DEBUG > 0\n if (.not. ${cond}$) then\n print *, \"Assert failed in file ${_FILE_}$, line ${_LINE_}$\"\n error stop\n end if\n #:endif\n #:enddef assertTrue\n\n ! Invoked via direct call (argument needs no quotation)\n @:assertTrue(size(myArray) > 0)\n\n ! Invoked as Python expression (argument needs quotation)\n $:assertTrue('size(myArray) > 0')\n\n* Conditional output::\n\n program test\n #:if defined('WITH_MPI')\n use mpi\n #:elif defined('WITH_OPENMP')\n use openmp\n #:else\n use serial\n #:endif\n\n* Iterated output (e.g. for generating Fortran templates)::\n\n interface myfunc\n #:for dtype in ['real', 'dreal', 'complex', 'dcomplex']\n module procedure myfunc_${dtype}$\n #:endfor\n end interface myfunc\n\n* Inline directives::\n\n logical, parameter :: hasMpi = #{if defined('MPI')}# .true. #{else}# .false. #{endif}#\n\n* Insertion of arbitrary Python expressions::\n\n character(*), parameter :: comp_date = \"${time.strftime('%Y-%m-%d')}$\"\n\n* Inclusion of files during preprocessing::\n\n #:include \"macrodefs.fypp\"\n\n* Using Fortran-style continutation lines in preprocessor directives::\n\n #:if var1 > var2 &\n & or var2 > var4\n print *, \"Doing something here\"\n #:endif\n\n* Passing (unquoted) multiline string arguments to callables::\n\n #! Callable needs only string argument\n #:def debug_code(code)\n #:if DEBUG > 0\n $:code\n #:endif\n #:enddef debug_code\n\n #! Pass code block as first positional argument\n #:call debug_code\n if (size(array) > 100) then\n print *, \"DEBUG: spuriously large array\"\n end if\n #:endcall debug_code\n\n #! Callable needs also non-string argument types\n #:def repeat_code(code, repeat)\n #:for ind in range(repeat)\n $:code\n #:endfor\n #:enddef repeat_code\n\n #! Pass code block as positional argument and 3 as keyword argument \"repeat\"\n #:call repeat_code(repeat=3)\n this will be repeated 3 times\n #:endcall repeat_code\n\n* Preprocessor comments::\n\n #! This will not show up in the output\n #! Also the newline characters at the end of the lines will be suppressed\n\n* Suppressing the preprocessor output in selected regions::\n\n #! Definitions are read, but no output (e.g. newlines) will be produced\n #:mute\n #:include \"macrodefs.fypp\"\n #:endmute\n\n* Explicit request for stopping the preprocessor::\n\n #:if DEBUGLEVEL < 0\n #:stop 'Negative debug level not allowed!'\n #:endif\n\n* Easy check for macro parameter sanity::\n\n #:def mymacro(RANK)\n #! Macro only works for RANK 1 and above\n #:assert RANK > 0\n :\n #:enddef mymacro\n\n* Line numbering directives in output::\n\n program test\n #:if defined('MPI')\n use mpi\n #:endif\n :\n\n transformed to ::\n\n # 1 \"test.fypp\" 1\n program test\n # 3 \"test.fypp\"\n use mpi\n # 5 \"test.fypp\"\n :\n\n when variable ``MPI`` is defined and Fypp was instructed to generate line\n markers.\n\n* Automatic folding of generated lines exceeding line length limit\n\n\nInstalling\n==========\n\nFypp needs a working Python interpreter. It is compatible with Python 2 (version\n2.6 and above) and Python 3 (all versions).\n\nAutomatic install\n-----------------\n\nUse Pythons command line installer ``pip`` in order to download the stable\nrelease from the `Fypp page on PyPI `_ and\ninstall it on your system::\n\n pip install fypp\n\nThis installs both, the command line tool ``fypp`` and the Python module\n``fypp.py``. Latter you can import if you want to access the functionality of\nFypp directly from within your Python scripts.\n\n\nManual install\n--------------\n\nFor a manual install, you can download the source code of the **stable**\nreleases from the `Fypp project website\n`_.\n\nIf you wish to obtain the latest **development** version, clone the projects\nrepository::\n\n git clone https://github.com/aradi/fypp.git\n\nand check out the `master` branch.\n\nThe command line tool is a single stand-alone script. You can run it directly\nfrom the source folder ::\n\n FYPP_SOURCE_FOLDER/bin/fypp\n\nor after copying it from the `bin` folder to any location listed in your `PATH`\nenvironment variable, by just issuing ::\n\n fypp\n\nThe python module ``fypp.py`` can be found in ``FYP_SOURCE_FOLDER/src``.\n\n\nRunning\n=======\n\nThe Fypp command line tool reads a file, preprocesses it and writes it to\nanother file, so you would typically invoke it like::\n\n fypp source.fpp source.f90\n\nwhich would process `source.fpp` and write the result to `source.f90`. If\ninput and output files are not specified, information is read from stdin and\nwritten to stdout.\n\nThe behavior of Fypp can be influenced with various command line options. A\nsummary of all command line options can be obtained by::\n\n fypp -h\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/aradi/fypp", "keywords": "fortran metaprogramming pre-processor", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "fypp", "package_url": "https://pypi.org/project/fypp/", "platform": "", "project_url": "https://pypi.org/project/fypp/", "project_urls": { "Homepage": "https://github.com/aradi/fypp" }, "release_url": "https://pypi.org/project/fypp/2.1.1/", "requires_dist": null, "requires_python": "", "summary": "Python powered Fortran preprocessor", "version": "2.1.1" }, "last_serial": 3169888, "releases": { "0.11": [ { "comment_text": "", "digests": { "md5": "9e1e953f5a1d15d586beb8e46842b014", "sha256": "975d939b5f63f3947136cea85b1113a09652137214ee87469532535e8a383ab4" }, "downloads": -1, "filename": "fypp-0.11.tar.gz", "has_sig": false, "md5_digest": "9e1e953f5a1d15d586beb8e46842b014", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24444, "upload_time": "2016-03-09T07:52:56", "url": "https://files.pythonhosted.org/packages/1f/f6/ca80dd97f48ac8416280f7ff7abc8831477510fa460338c50d0bedefac39/fypp-0.11.tar.gz" } ], "0.12": [ { "comment_text": "", "digests": { "md5": "41d5084093940d46522c2eb473513fde", "sha256": "764d6e84798830e27c1b75aeb10e210c87fed8bfb0f4deffd1a33ed183579339" }, "downloads": -1, "filename": "fypp-0.12.tar.gz", "has_sig": false, "md5_digest": "41d5084093940d46522c2eb473513fde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25526, "upload_time": "2016-03-11T10:45:31", "url": "https://files.pythonhosted.org/packages/00/9d/8f0017e4b49e480c85dceeaa5710534e2d1872ad6222765fef8e60e8226b/fypp-0.12.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "2e42ab14d3f10f935da313015fc79747", "sha256": "5246cd35aa4d72c5c9a6192cafb0f305f47d177e147bc47861ffadc296279506" }, "downloads": -1, "filename": "fypp-1.0.tar.gz", "has_sig": false, "md5_digest": "2e42ab14d3f10f935da313015fc79747", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28119, "upload_time": "2016-04-05T08:53:22", "url": "https://files.pythonhosted.org/packages/9c/05/fe3bec7c3b43e0b488cb29c73f9a0a29021abd924324c43e26d07a917428/fypp-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "6aa64e4c104075fda8fcdd3222e2a028", "sha256": "e4ab9525b1650969c71dda28a652396e8f98f31dea36afd1a4f5143f19248338" }, "downloads": -1, "filename": "fypp-1.1.tar.gz", "has_sig": false, "md5_digest": "6aa64e4c104075fda8fcdd3222e2a028", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27576, "upload_time": "2016-07-22T06:10:33", "url": "https://files.pythonhosted.org/packages/08/b0/19e9bdb3c91d42a355f62281a638a17e120b5806dbc6f1b8ff93af3c0b72/fypp-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "6eefb6ebc717b3349a372d3efe6efce1", "sha256": "bd5782255e71ec6e3b1b51aae513e9a07d77e39bc9660ccebdd1ebf9ace555af" }, "downloads": -1, "filename": "fypp-1.2.tar.gz", "has_sig": false, "md5_digest": "6eefb6ebc717b3349a372d3efe6efce1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30604, "upload_time": "2016-12-05T12:23:01", "url": "https://files.pythonhosted.org/packages/e8/c9/090ef12cb513926a2d8b579e7a101ee9714034000e6713d8769b7b275480/fypp-1.2.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "bef9e51b8e3eef0794c1f13de24fbfe7", "sha256": "92828b475eca59179d307df375b9db8c8ba48baa5f90e35291f67a18170a0041" }, "downloads": -1, "filename": "fypp-2.0.tar.gz", "has_sig": false, "md5_digest": "bef9e51b8e3eef0794c1f13de24fbfe7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42779, "upload_time": "2017-03-07T12:43:04", "url": "https://files.pythonhosted.org/packages/5b/71/31128a09e210c384fb870e3edb088d060a6bac9c726812a983d202de9367/fypp-2.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "1a586a5164f55920316d312aa609df44", "sha256": "bdf3f213f57360c978a91df7e87005ccc67b0ccd3360983e207e8a860edc23e7" }, "downloads": -1, "filename": "fypp-2.0.1.tar.gz", "has_sig": false, "md5_digest": "1a586a5164f55920316d312aa609df44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42924, "upload_time": "2017-03-13T19:06:54", "url": "https://files.pythonhosted.org/packages/80/f5/492ef0ca3b607157548f3a354316d913d07bba9bb840f37b7ea48ce9b024/fypp-2.0.1.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "43568f97ce457e143901e6bdfb35fa82", "sha256": "9f819554b202671e40a199b3491ed6a7e7420bece047d114b2c7e460ced9d4b7" }, "downloads": -1, "filename": "fypp-2.1.tar.gz", "has_sig": false, "md5_digest": "43568f97ce457e143901e6bdfb35fa82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64700, "upload_time": "2017-08-08T14:01:47", "url": "https://files.pythonhosted.org/packages/b9/ce/00ba1f91431e018e2f80a576aaf117cbb6f2721a5de0d900bc06b2c8a08f/fypp-2.1.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "5f65c81a38e730d46f8703630c3659bd", "sha256": "a0dad193bce4420927953dbd2068cb9fbfdb0bc0a161bafca366b1ed87cb954c" }, "downloads": -1, "filename": "fypp-2.1.1.tar.gz", "has_sig": false, "md5_digest": "5f65c81a38e730d46f8703630c3659bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65021, "upload_time": "2017-09-13T07:18:40", "url": "https://files.pythonhosted.org/packages/83/2e/aa6fc7ec5b0bf65d3fa0fb5c33896bbf36053c6ecf80e0ac40b09f2d6aed/fypp-2.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5f65c81a38e730d46f8703630c3659bd", "sha256": "a0dad193bce4420927953dbd2068cb9fbfdb0bc0a161bafca366b1ed87cb954c" }, "downloads": -1, "filename": "fypp-2.1.1.tar.gz", "has_sig": false, "md5_digest": "5f65c81a38e730d46f8703630c3659bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65021, "upload_time": "2017-09-13T07:18:40", "url": "https://files.pythonhosted.org/packages/83/2e/aa6fc7ec5b0bf65d3fa0fb5c33896bbf36053c6ecf80e0ac40b09f2d6aed/fypp-2.1.1.tar.gz" } ] }