{ "info": { "author": "Michael Galloy", "author_email": "mgalloy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "======\nepochs\n======\n\n\n.. image:: https://img.shields.io/pypi/v/epochs.svg\n :target: https://pypi.python.org/pypi/epochs\n\n.. image:: https://img.shields.io/travis/mgalloy/epochs.svg\n :target: https://travis-ci.org/mgalloy/epochs\n\n.. image:: https://readthedocs.org/projects/epochs/badge/?version=latest\n :target: https://epochs.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/mgalloy/epochs/shield.svg\n :target: https://pyup.io/repos/github/mgalloy/epochs/\n :alt: Updates\n\n\n\nPython package to handle configuration files specifying values changing over time\n\n\n* Free software: BSD license\n* Documentation: https://epochs.readthedocs.io.\n\n\nFeatures\n--------\n\nThe main features of epochs are:\n\n* Parse date-based configuration files and retrieve values based on datetime.\n* Validate configuration files, both normal and epoch date-based ones, against a specification.\n\nFor example, for a configuration file, ``epochs.cfg``, such as::\n\n [2019-04-09 20:27:15]\n value : 3\n\n [2019-04-09 22:31:01]\n value : 5\n\nThe dates can be anything parsed by `dateutil.parser.parse`_. Then, epochs can retrieve the correct value from the config file corresponding to a given date:\n\n.. code-block:: python\n\n >>> import epochs\n >>> ep = epochs.parse('epochs.cfg')\n >>> value = ep.get('value', datetime='2019-04-09 21:55:45')\n >>> print(value)\n 3\n >>> value = ep.get('value', datetime='2019-04-09 23:15:40')\n >>> print(value)\n 5\n\nThe \"correct\" value is the one specified in the earliest section of the configuration file with a date on or before the given date.\n\nBelow is an example specification for a configuration file::\n\n [city]\n name : required=True, type=str\n streets : required=True, type=List[str]\n temp : required=False, type=float, default=0.0\n\nAnd an example configuration file following this specification::\n\n [city]\n name : Boulder\n streets : [Broadway, Baseline, Valmont]\n\nThen to parse the configuration file with its specification:\n\n.. code-block:: python\n\n >>> import epochs\n >>> cf = epochs.parse('example.cfg', spec='spec.cfg')\n >>> name = cf.get('name', section='city')\n >>> print(name)\n Boulder\n >>> streets = cf.get('streets', section='city')\n >>> print(steets)\n ['Broadway', 'Baseline', 'Valmont']\n >>> temp = cf.get('temp', section='city')\n >>> print(temp, type(temp))\n 0.0 \n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n.. _`dateutil.parser.parse`: https://dateutil.readthedocs.io/en/stable/parser.html\n\n\n=======\nHistory\n=======\n\n0.1.0 (2019-04-12)\n------------------\n* initial creation\n\n0.1.1 (2019-04-19)\n------------------\n* basic config parser with specification file\n\n0.1.2 (2019-04-19)\n------------------\n* better repr and str representations\n\n0.2.0 (2019-04-22)\n------------------\n* basic epoch parser\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mgalloy/epochs", "keywords": "epochs", "license": "BSD license", "maintainer": "", "maintainer_email": "", "name": "epochs", "package_url": "https://pypi.org/project/epochs/", "platform": "", "project_url": "https://pypi.org/project/epochs/", "project_urls": { "Homepage": "https://github.com/mgalloy/epochs" }, "release_url": "https://pypi.org/project/epochs/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Python package to handle configuration files specifying values changing over time", "version": "0.2.0" }, "last_serial": 5324015, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "7d2e2aad838c25d771311b2143d04be2", "sha256": "4fba2abe7dec700219f79c5438950dad28ec3223d75bc1c587aff2564c07df68" }, "downloads": -1, "filename": "epochs-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7d2e2aad838c25d771311b2143d04be2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7593, "upload_time": "2019-05-27T21:30:00", "url": "https://files.pythonhosted.org/packages/7e/6b/ed521178ed38efe996d27e64a1c71c90b0d9a7f2a16afcd69b51882e64b3/epochs-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ab7c9a43a17d39ada7f646c2de24880", "sha256": "8a41bc8424014700309cc4e824c7c2c620134b61a9aa032736c4cd49d6d65d83" }, "downloads": -1, "filename": "epochs-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6ab7c9a43a17d39ada7f646c2de24880", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16630, "upload_time": "2019-05-27T21:30:02", "url": "https://files.pythonhosted.org/packages/50/4b/867078a9f95e58a7d0a873ed25c7bd30fe2f08367b0f114823e4d2df2c0d/epochs-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d2e2aad838c25d771311b2143d04be2", "sha256": "4fba2abe7dec700219f79c5438950dad28ec3223d75bc1c587aff2564c07df68" }, "downloads": -1, "filename": "epochs-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7d2e2aad838c25d771311b2143d04be2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7593, "upload_time": "2019-05-27T21:30:00", "url": "https://files.pythonhosted.org/packages/7e/6b/ed521178ed38efe996d27e64a1c71c90b0d9a7f2a16afcd69b51882e64b3/epochs-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ab7c9a43a17d39ada7f646c2de24880", "sha256": "8a41bc8424014700309cc4e824c7c2c620134b61a9aa032736c4cd49d6d65d83" }, "downloads": -1, "filename": "epochs-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6ab7c9a43a17d39ada7f646c2de24880", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16630, "upload_time": "2019-05-27T21:30:02", "url": "https://files.pythonhosted.org/packages/50/4b/867078a9f95e58a7d0a873ed25c7bd30fe2f08367b0f114823e4d2df2c0d/epochs-0.2.0.tar.gz" } ] }