{ "info": { "author": "sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]", "author_email": "sonntagsgesicht@icloud.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Education", "Topic :: Office/Business", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "\n\nPython project *mitschreiben*\n-----------------------------\n\n.. image:: https://img.shields.io/codeship/78df14e0-ba83-0137-e4e4-5ec1c160b8c0/master.svg\n :target: https://codeship.com/projects/364816\n :alt: CodeShip\n\n.. image:: https://travis-ci.org/sonntagsgesicht/mitschreiben.svg?branch=master\n :target: https://travis-ci.org/sonntagsgesicht/mitschreiben\n :alt: Travis ci\n\n.. image:: https://img.shields.io/readthedocs/mitschreiben\n :target: http://mitschreiben.readthedocs.io\n :alt: Read the Docs\n\n.. image:: https://img.shields.io/codefactor/grade/github/sonntagsgesicht/mitschreiben/master\n :target: https://www.codefactor.io/repository/github/sonntagsgesicht/mitschreiben\n :alt: CodeFactor Grade\n\n.. image:: https://img.shields.io/codeclimate/maintainability/sonntagsgesicht/mitschreiben\n :target: https://codeclimate.com/github/sonntagsgesicht/mitschreiben/maintainability\n :alt: Code Climate maintainability\n\n.. image:: https://img.shields.io/codecov/c/github/sonntagsgesicht/mitschreiben\n :target: https://codecov.io/gh/sonntagsgesicht/mitschreiben\n :alt: Codecov\n\n.. image:: https://img.shields.io/lgtm/grade/python/g/sonntagsgesicht/mitschreiben.svg\n :target: https://lgtm.com/projects/g/sonntagsgesicht/mitschreiben/context:python/\n :alt: lgtm grade\n\n.. image:: https://img.shields.io/lgtm/alerts/g/sonntagsgesicht/mitschreiben.svg\n :target: https://lgtm.com/projects/g/sonntagsgesicht/mitschreiben/alerts/\n :alt: total lgtm alerts\n\n.. image:: https://img.shields.io/github/license/sonntagsgesicht/mitschreiben\n :target: https://github.com/sonntagsgesicht/mitschreiben/raw/master/LICENSE\n :alt: GitHub\n\n.. image:: https://img.shields.io/github/release/sonntagsgesicht/mitschreiben?label=github\n :target: https://github.com/sonntagsgesicht/mitschreiben/releases\n :alt: GitHub release\n\n.. image:: https://img.shields.io/pypi/v/mitschreiben\n :target: https://pypi.org/project/mitschreiben/\n :alt: PyPI Version\n\n.. image:: https://img.shields.io/pypi/pyversions/mitschreiben\n :target: https://pypi.org/project/mitschreiben/\n :alt: PyPI - Python Version\n\n.. image:: https://img.shields.io/pypi/dm/mitschreiben\n :target: https://pypi.org/project/mitschreiben/\n :alt: PyPI Downloads\n\n\nmitschreiben (german for 'to take notes') helps recording values during\ncalculations for later evaluation, e.g. check if the right objects or\nvalues were used or to present the results in structure of tables\n\nIt provides a class called Record which is basically used for everything. It grants access to record object, it is used\nfor the recording and it is a context manager used to trigger whether to record or not.\n\nExample Usage\n-------------\n\nIn the first ``Record(key = value)`` or ``Record(dictionary)`` is placed where one wants to\nrecord a value. The decorator ``Prefix`` provided by this class is used\nto define a key extension under which the recorded value will be stored in the\n``Record``. The Prefixes get stacked, so when there is a successive\nfunction call to another function which is prefixed those Prefixes are\nconcatenated.\n\n.. code:: python\n\n from mitschreiben import Record\n\n def magical_stuff_happens(baz, barz):\n return \"That's\", \"great\"\n\n class Foo():\n\n @Record.Prefix()\n def bar(self, baz, barz)\n some_value1, some_value2 = self.do_something(baz, barz)\n\n Record(a_key=some_value1, another_key=some_value2)\n\n return some_value1, some_value2\n\n @Record.Prefix()\n def do_something(self, baz, barz):\n\n a_dict = {'again_a_key': baz, 'so_creative': barz}\n\n Record(a_dict)\n\n return magical_stuff_happens(baz, barz)\n\n def __repr__(self):\n return \"Foo({})\".format(id(self))\n\n\nNow, since ``Record`` is a contextmanager, the recording will only\nhappen in such a context. The ``with``-statement activates the recording and returns the current scopes record object\nfor convenient access. Another thing is, that record level is increased by this statement, leading to record objects\nthat are only available in that scope. When leaving the ``with`` the outer scopes's record will be extend by the inner\none, by prepending the outer records current prefix stack to each key of the inner one.\n\n\n.. code:: python\n\n with Record() as rec:\n foo = Foo()\n foo.do_something(\"baz\", \"barz\")\n foo.bar(\"baz\",\"barz\")\n\n print rec.entries\n\n\nThe entries are a dict whose keys are tuples which are the stacked Prefixes. In this way it is possible to determine which method on which object was called, what then led\nto successive calls, where in the end a value is recorded. The example above has the following output.\n\n.. code:: python\n\n {('Foo(42403656).do_something', 'again_a_key'): 'baz', ('Foo(42403656).bar', 'Foo(42403656).do_something', 'again_a_key'): 'baz', ('Foo(42403656).do_something', 'so_creative'): 'barz', ('Foo(42403656).bar', 'a_key'): \"That's\", ('Foo(42403656).bar', 'another_key'): 'great', ('Foo(42403656).bar', 'Foo(42403656).do_something', 'so_creative'): 'barz'}\n\n\nFormatting the output\n---------------------\n\nThe Record can be represented in different formats. The base to this is a *tree of dictionaries*,\nimplemented by the class ``DictTree`` in ``mitschreiben.formatting``. For the two base outputs however, one\ndoes not need to actually instantiate a ``DictTree`` yourself. The respective methods are\n\n.. code::python\n\n Record().to_csv_files(PATH)\n Record().to_html_tables(FILENAME, PATH)\n\n\nBoth of these methods produce tables of the output. The idea is that, that certain calculations are made with different\nobjects, leading to the same keywords. So one obtains a table with row keys (object names) and column keys (the keywords\nused to record a value). As the name of the former methods suggests, it produces this tables and writes them as single\n.csv files into ``Path``, whereas the latter construct a html document in which one can navigate through the tree structure\nand see the tables at those positions where they would be placed in the tree. Those tables would look similar to\n\n.. code:: html\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
table
a_keyagain_a_keyanother_keyso_creative
Foo(42403656).barThat'sNonegreatNone
Foo(42403656).do_somethingNonebazNonebarz
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
table
Foo(42403656).do_something
again_a_keybaz
so_creativebarz
\n\nAnother way would be to work with the ``DictTree`` directly.\n\n.. code:: python\n\n from mitschreiben.formatting import DictTree\n\n DT = DictTree(rec.entries)\n\n tables = DT.make_tables()\n for t in tables:\n print t.pretty_string()\n print\n\nThis results in the following output. The first table represents the top\nlevel of the record, whereas the other tabels are named by\n*object.function*.\n\n.. code::\n\n Values | a_key | again_a_key | another_key | so_creative\n Foo(42403656).bar | That's | None | great | None\n Foo(42403656).do_something | None | baz | None | barz\n\n Foo(42403656).bar\n Values | again_a_key | so_creative\n Foo(42403656).do_something | baz | barz\n\n\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/sonntagsgesicht/mitschreiben", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "mitschreiben", "package_url": "https://pypi.org/project/mitschreiben/", "platform": "any", "project_url": "https://pypi.org/project/mitschreiben/", "project_urls": { "Homepage": "https://github.com/sonntagsgesicht/mitschreiben" }, "release_url": "https://pypi.org/project/mitschreiben/0.3/", "requires_dist": [ "six" ], "requires_python": "", "summary": "Python library supplying a tool to record values during calculations", "version": "0.3" }, "last_serial": 5849966, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "d9588cbccf6d0043c41b7105022b57a7", "sha256": "9e48ffd6680f26e51a9abeb2854e816302da66f9e83dc6e819a12a4c7d7308a5" }, "downloads": -1, "filename": "mitschreiben-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "d9588cbccf6d0043c41b7105022b57a7", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14332, "upload_time": "2017-12-31T10:59:40", "url": "https://files.pythonhosted.org/packages/4a/65/5357cd402dc3e33119c3f8ef94b92a28b65e472a6f203e9a8ef1a06622ef/mitschreiben-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a9c807fdb5f9eee0c3bb24250161aef", "sha256": "f833c3ff52f52965f071f2cec8a9ff1ff8380bf818629d655ff31512fd84339e" }, "downloads": -1, "filename": "mitschreiben-0.2.tar.gz", "has_sig": false, "md5_digest": "3a9c807fdb5f9eee0c3bb24250161aef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15672, "upload_time": "2017-12-31T10:59:45", "url": "https://files.pythonhosted.org/packages/ae/b2/ccf338d030cfb5a4b5e3954fcf8186d2fe1599b03067ccbad4f797b2ca36/mitschreiben-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "e38cb34e93448899a7baebbb9694f83c", "sha256": "08a508651bbaff6520ad33412058d67c58563bf16d7e2342c3d8c64990f7ff0b" }, "downloads": -1, "filename": "mitschreiben-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "e38cb34e93448899a7baebbb9694f83c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14347, "upload_time": "2017-12-31T11:19:38", "url": "https://files.pythonhosted.org/packages/5e/6c/c450ef104b8b1bdf228391cc0ae4fbc1d26aa92675b4bd0560c115ffdd59/mitschreiben-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70715f9075b5024c5d994d762c40c7dd", "sha256": "ff1cc48d647853d8f8cb4b13dae90e8e3b18b3bf97312e4ce36734b1b18dfd81" }, "downloads": -1, "filename": "mitschreiben-0.2.1.zip", "has_sig": false, "md5_digest": "70715f9075b5024c5d994d762c40c7dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23112, "upload_time": "2017-12-31T11:19:42", "url": "https://files.pythonhosted.org/packages/42/94/7c7a25b7d778f421c61b809e85b5c0fcaff8781f278e87cefe01176935d3/mitschreiben-0.2.1.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "ee61914ac83c330d4702abaa023c97a0", "sha256": "0df8919bd6e28dedfcb70f57c93ba6cd24f731fee5fbc9d166de931a64f45a86" }, "downloads": -1, "filename": "mitschreiben-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "ee61914ac83c330d4702abaa023c97a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19179, "upload_time": "2019-09-18T12:50:59", "url": "https://files.pythonhosted.org/packages/51/95/545dd298bdb4e36f6f716828868290f2b4769eb25443f75cd4dc7af528e4/mitschreiben-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e33e9784c3503df33cd66bb81109f34", "sha256": "98aa522e121a56fbe6c349410a24f1e7a6594b4624b91b3a2e9ac157f951f5b1" }, "downloads": -1, "filename": "mitschreiben-0.3.tar.gz", "has_sig": false, "md5_digest": "8e33e9784c3503df33cd66bb81109f34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18961, "upload_time": "2019-09-18T12:51:01", "url": "https://files.pythonhosted.org/packages/b3/17/d08ebfcc357b5f7e7f1a23ee70a5cf7ea75155794f60de838beeeda9bfda/mitschreiben-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ee61914ac83c330d4702abaa023c97a0", "sha256": "0df8919bd6e28dedfcb70f57c93ba6cd24f731fee5fbc9d166de931a64f45a86" }, "downloads": -1, "filename": "mitschreiben-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "ee61914ac83c330d4702abaa023c97a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19179, "upload_time": "2019-09-18T12:50:59", "url": "https://files.pythonhosted.org/packages/51/95/545dd298bdb4e36f6f716828868290f2b4769eb25443f75cd4dc7af528e4/mitschreiben-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e33e9784c3503df33cd66bb81109f34", "sha256": "98aa522e121a56fbe6c349410a24f1e7a6594b4624b91b3a2e9ac157f951f5b1" }, "downloads": -1, "filename": "mitschreiben-0.3.tar.gz", "has_sig": false, "md5_digest": "8e33e9784c3503df33cd66bb81109f34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18961, "upload_time": "2019-09-18T12:51:01", "url": "https://files.pythonhosted.org/packages/b3/17/d08ebfcc357b5f7e7f1a23ee70a5cf7ea75155794f60de838beeeda9bfda/mitschreiben-0.3.tar.gz" } ] }