{ "info": { "author": "Josef Friedrich", "author_email": "josef@friedrich.rocks", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Topic :: Utilities" ], "description": ".. image:: http://img.shields.io/pypi/v/tmep.svg\n :target: https://pypi.python.org/pypi/tmep\n :alt: This package on the Python Package Index\n\n.. image:: https://travis-ci.org/Josef-Friedrich/tmep.svg?branch=master\n :target: https://travis-ci.org/Josef-Friedrich/tmep\n :alt: Continuous integration\n\n.. image:: https://readthedocs.org/projects/tmep/badge/?version=latest\n :target: https://tmep.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n====\ntmep\n====\n\nTemplate and Macros Expansion for Path names.\n\nInstallation\n============\n\nFrom Github\n------------\n\n.. code:: Shell\n\n git clone https://github.com/Josef-Friedrich/tmep.git\n cd tmep\n python setup.py install\n\nFrom PyPI\n----------\n\n.. code:: Shell\n\n pip install tmep\n easy_install tmep\n\nUsage\n=====\n\n.. code:: Python\n\n >>> import tmep\n >>> template = '$prename $lastname'\n >>> values = {'prename': 'Franz', 'lastname': 'Schubert'}\n >>> out = tmep.parse(template, values)\n >>> print(out)\n Franz Schubert\n\nThis module implements a string formatter based on the standard PEP\n292 string.Template class extended with function calls. Variables, as\nwith string.Template, are indicated with $ and functions are delimited\nwith %.\n\nThis module assumes that everything is Unicode: the template and the\nsubstitution values. Bytestrings are not supported. Also, the templates\nalways behave like the ``safe_substitute`` method in the standard\nlibrary: unknown symbols are left intact.\n\nThis is sort of like a tiny, horrible degeneration of a real templating\nengine like Jinja2 or Mustache.\n\nDevelopment\n===========\n\nTest\n----\n\n::\n\n tox\n\n\nPublish a new version\n---------------------\n\n::\n\n git tag 1.1.1\n git push --tags\n python setup.py sdist upload\n\n\nPackage documentation\n---------------------\n\nThe package documentation is hosted on\n`readthedocs `_.\n\nGenerate the package documentation:\n\n::\n\n python setup.py build_sphinx\n\n\nFunctions\n=========\n\n.. code ::\n\n alpha\n -----\n\n %alpha{text}\n This function first ASCIIfies the given text, then all non alphabet\n characters are replaced with whitespaces.\n\n alphanum\n --------\n\n %alphanum{text}\n This function first ASCIIfies the given text, then all non alpanumeric\n characters are replaced with whitespaces.\n\n asciify\n -------\n\n %asciify{text}\n Translate non-ASCII characters to their ASCII equivalents. For\n example, \u201ccaf\u00e9\u201d becomes \u201ccafe\u201d. Uses the mapping provided by the\n unidecode module.\n\n delchars\n --------\n\n %delchars{text,chars}\n Delete every single character of \u201cchars\u201c in \u201ctext\u201d.\n\n deldupchars\n -----------\n\n %deldupchars{text,chars}\n Search for duplicate characters and replace with only one occurrance\n of this characters.\n\n first\n -----\n\n %first{text} or %first{text,count,skip} or\n %first{text,count,skip,sep,join}\n Returns the first item, separated by ; . You can use\n %first{text,count,skip}, where count is the number of items (default\n 1) and skip is number to skip (default 0). You can also use\n %first{text,count,skip,sep,join} where sep is the separator, like ; or\n / and join is the text to concatenate the items.\n\n if\n --\n\n %if{condition,truetext} or %if{condition,truetext,falsetext}\n If condition is nonempty (or nonzero, if it\u2019s a number), then returns\n the second argument. Otherwise, returns the third argument if\n specified (or nothing if falsetext is left off).\n\n ifdef\n -----\n\n %ifdef{field}, %ifdef{field,text} or %ifdef{field,text,falsetext}\n If field exists, then return truetext or field (default). Otherwise,\n returns falsetext. The field should be entered without $.\n\n ifdefempty\n ----------\n\n %ifdefempty{field,text} or %ifdefempty{field,text,falsetext}\n If field exists and is empty, then return truetext. Otherwise, returns\n falsetext. The field should be entered without $.\n\n ifdefnotempty\n -------------\n\n %ifdefnotempty{field,text} or %ifdefnotempty{field,text,falsetext}\n If field is not empty, then return truetext. Otherwise, returns\n falsetext. The field should be entered without $.\n\n initial\n -------\n\n %initial{text}\n Get the first character of a text in lowercase. The text is converted\n to ASCII. All non word characters are erased.\n\n left\n ----\n\n %left{text,n}\n Return the first \u201cn\u201d characters of \u201ctext\u201d.\n\n lower\n -----\n\n %lower{text}\n Convert \u201ctext\u201d to lowercase.\n\n nowhitespace\n ------------\n\n %nowhitespace{text,replace}\n Replace all whitespace characters with replace. By default: a dash (-)\n %nowhitespace{$track,_}\n\n num\n ---\n\n %num{number,count}\n Pad decimal number with leading zeros.\n %num{$track,3}\n\n replchars\n ---------\n\n %replchars{text,chars,replace}\n Replace the characters \u201cchars\u201d in \u201ctext\u201d with \u201creplace\u201d.\n %replchars{text,ex,-} > t--t\n\n right\n -----\n\n %right{text,n}\n Return the last \u201cn\u201d characters of \u201ctext\u201d.\n\n sanitize\n --------\n\n %sanitize{text}\n Delete in most file systems not allowed characters.\n\n shorten\n -------\n\n %shorten{text} or %shorten{text,max_size}\n Shorten \u201ctext\u201d on word boundarys.\n %shorten{$title,32}\n\n time\n ----\n\n %time{date_time,format,curformat}\n Return the date and time in any format accepted by strftime. For\n example, to get the year some music was added to your library, use\n %time{$added,%Y}.\n\n title\n -----\n\n %title{text}\n Convert \u201ctext\u201d to Title Case.\n\n upper\n -----\n\n %upper{text}\n Convert \u201ctext\u201d to UPPERCASE.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Josef-Friedrich/tmep", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tmep", "package_url": "https://pypi.org/project/tmep/", "platform": "", "project_url": "https://pypi.org/project/tmep/", "project_urls": { "Homepage": "https://github.com/Josef-Friedrich/tmep" }, "release_url": "https://pypi.org/project/tmep/2.0.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Template and Macros Expansion for Path names.", "version": "2.0.0" }, "last_serial": 4983574, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "7d7df184d3698bdcb6e5175d90e39dac", "sha256": "a3477c8eb05972182410c11f9c8d07439b5598cbe95df5f40b039b42b037c69e" }, "downloads": -1, "filename": "tmep-1.0.3.tar.gz", "has_sig": false, "md5_digest": "7d7df184d3698bdcb6e5175d90e39dac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27361, "upload_time": "2017-12-15T19:57:10", "url": "https://files.pythonhosted.org/packages/0d/fd/a611771df7a7f15c2f10859fdabce51fa8cc9c4cfa17e697434c88d9d316/tmep-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "3d5cf5648fa311ee46ebaaaa3ed2558f", "sha256": "a86d70703223278da8669d058d06f63fc7b33b9eb50f686d06433d5fde8ca25f" }, "downloads": -1, "filename": "tmep-1.0.4.tar.gz", "has_sig": false, "md5_digest": "3d5cf5648fa311ee46ebaaaa3ed2558f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32002, "upload_time": "2018-01-27T14:53:07", "url": "https://files.pythonhosted.org/packages/b9/d5/863e8ac6ce5399533a9769208e57109c0df12519753db2440f461942c335/tmep-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "288e9f1d8511332082a14e6ed08edcbc", "sha256": "ffb5e1be924b86ddbed8d2e5ad0da33d0130b9d765e0dbace14db9dc6b97c694" }, "downloads": -1, "filename": "tmep-1.0.5.tar.gz", "has_sig": false, "md5_digest": "288e9f1d8511332082a14e6ed08edcbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32275, "upload_time": "2018-01-28T15:01:34", "url": "https://files.pythonhosted.org/packages/26/fa/4842d31e2db6e9f436375d1c062b61f613292fb30f0dd0ee91fd5ad48c6c/tmep-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "e4b72471c65a6bfc988306f444b190fc", "sha256": "997c00de12bfc0a02d3c5ce95a9b1ca3c5a29fc956cb9edee3ccea76db468ab5" }, "downloads": -1, "filename": "tmep-1.0.6.tar.gz", "has_sig": false, "md5_digest": "e4b72471c65a6bfc988306f444b190fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32458, "upload_time": "2018-01-28T20:45:59", "url": "https://files.pythonhosted.org/packages/b3/65/75dffd21f4809991eb8f57d04dcf02f0a573d27e6b389f2e79fd678357fd/tmep-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "9a1f52892a084f580f0c956133217913", "sha256": "8adddc6da0ab4bafe4399693ee79dd351e8622174bb35dc6cfa975453a5d5ade" }, "downloads": -1, "filename": "tmep-1.0.7.tar.gz", "has_sig": false, "md5_digest": "9a1f52892a084f580f0c956133217913", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32633, "upload_time": "2018-01-29T20:04:19", "url": "https://files.pythonhosted.org/packages/b4/89/cef5df5a17ae8ea68c19efb3be9f2eb14a9ab2cc5adfc5812f4bd8332053/tmep-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "60d2bd75336a779e4bb1cd78ea0224a6", "sha256": "5748472565cdb7f17ab50d7ead82155b0fdd8e7c935e57a13229684c1ae58773" }, "downloads": -1, "filename": "tmep-1.0.8.tar.gz", "has_sig": false, "md5_digest": "60d2bd75336a779e4bb1cd78ea0224a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28815, "upload_time": "2018-02-07T08:56:28", "url": "https://files.pythonhosted.org/packages/2c/6a/bf709f4d438233e93473bf46ba412ce168368691a436e993d441154b6a53/tmep-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "3c18c38184e139d25be1de8447162d08", "sha256": "a91f1f0686458b5bee623cd9cba43747ad1b710834780d76c88c6462c9714cbf" }, "downloads": -1, "filename": "tmep-1.0.9.tar.gz", "has_sig": false, "md5_digest": "3c18c38184e139d25be1de8447162d08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31359, "upload_time": "2018-02-28T16:23:49", "url": "https://files.pythonhosted.org/packages/21/e7/b1dcc055b9f0a49aa6d83f0e54b7d635658673d9805021264c7c5e289d55/tmep-1.0.9.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "6101ca6f02d2954bfeeab17def1d6cac", "sha256": "2204d5087073e7313082b8547a3d6d30caed733abd45a076ccb0e342bca82c20" }, "downloads": -1, "filename": "tmep-1.1.0.tar.gz", "has_sig": false, "md5_digest": "6101ca6f02d2954bfeeab17def1d6cac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31800, "upload_time": "2018-03-10T22:27:16", "url": "https://files.pythonhosted.org/packages/b4/6f/fe77f05a05bd86f9b11fe3b20d40d6414532908981551cdde6444347b20a/tmep-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "b7c93982c4ee81065dcd5f82783ac1be", "sha256": "fe46ba6270b9943267fd48dc1c4e689853ef640bb67968dfa2351687f615569c" }, "downloads": -1, "filename": "tmep-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b7c93982c4ee81065dcd5f82783ac1be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30082, "upload_time": "2018-03-11T09:57:05", "url": "https://files.pythonhosted.org/packages/81/9f/4563966e87ecf3c3480428c771294d371b759bdd46ce253d204cc7510f90/tmep-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "d71c27ffa0af5dcc7b6387f697edd37f", "sha256": "372e45a82e6cd5deb80abe431e2e2cdc36460f8bcc3dc06fd8bde7d6a74807cc" }, "downloads": -1, "filename": "tmep-1.1.2.tar.gz", "has_sig": false, "md5_digest": "d71c27ffa0af5dcc7b6387f697edd37f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32046, "upload_time": "2018-03-11T10:59:16", "url": "https://files.pythonhosted.org/packages/f1/e8/7c8b732c44b57a25882c06e24d4d04407c58edd2b00f9e088c0f9f8eefed/tmep-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "ab72fd11bbe18e9c5369f2a17700e709", "sha256": "7642e38ea76f0e0ac615bea188105c26f2fd4928e7113c97893d01df7cacaa00" }, "downloads": -1, "filename": "tmep-1.1.3.tar.gz", "has_sig": false, "md5_digest": "ab72fd11bbe18e9c5369f2a17700e709", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31415, "upload_time": "2019-02-14T23:10:52", "url": "https://files.pythonhosted.org/packages/4b/11/f27396c72bb3db723d30a741f4df0b5e845dbc3959ebca32c71446ed5d5f/tmep-1.1.3.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "7d2b0662072ddbc943dd2e1200b69bcd", "sha256": "5bd60a58f104bd6cdb464fba1c069734782509bed60562e6e620ee32f3a66c12" }, "downloads": -1, "filename": "tmep-2.0.0.tar.gz", "has_sig": false, "md5_digest": "7d2b0662072ddbc943dd2e1200b69bcd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 32446, "upload_time": "2019-03-25T16:58:52", "url": "https://files.pythonhosted.org/packages/27/eb/9f3a67a11ba0d58690c90398fe33a954dc6c17d611200bd269192560a710/tmep-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d2b0662072ddbc943dd2e1200b69bcd", "sha256": "5bd60a58f104bd6cdb464fba1c069734782509bed60562e6e620ee32f3a66c12" }, "downloads": -1, "filename": "tmep-2.0.0.tar.gz", "has_sig": false, "md5_digest": "7d2b0662072ddbc943dd2e1200b69bcd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 32446, "upload_time": "2019-03-25T16:58:52", "url": "https://files.pythonhosted.org/packages/27/eb/9f3a67a11ba0d58690c90398fe33a954dc6c17d611200bd269192560a710/tmep-2.0.0.tar.gz" } ] }