{ "info": { "author": "David Stanek", "author_email": "dstanek@dstanek.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Testing" ], "description": "typist - Test time type checking\n================================\n\n.. image:: https://secure.travis-ci.org/dstanek/typist.png\n\n**typist** is a test time tool that uses your Sphinx docstrings (you do document\nyour code right?) to ensure that your callables:\n\n- are only called with the types they expect\n- only return types they advertise\n- only raise exceptions they advertise\n\nUsage\n-----\n\nRight now you have to import typist and install it. The argument to install is\nthe top level package for the code you are interested in testing. In the\nfuture I plan on creating plugins for test frameworks.\n\n .. code:: python\n\n import typist\n typist.install('keystone')\n\ntypist implements an `import hook`_ that will use Python's `AST`_ to add a\ndecorator to all of your callables. The decorator ensures the callable is\nproperly used based on its docstring type declarations. If your callable\ndoesn't have :param:, :returns or :raises: then it works just fine, it's\njust not checked.\n\nType language \n-------------\n\nTypes will be pulled from the following formats:\n\n :param {type} varname: some descriptive text\n :rtype avarname: {types}\n :returns {types}: some descriptive text\n\n`{type}` can be any valid Python type. Some examples:\n\n- `int`\n- `list`\n- `:py:class:typist._import_hook.Finder`\n- `typist._import_hook.Finder`\n\n`{types}` can be a list of types separated by commas that includes an optional\n'or'. All the same types as above can be used in the list. Some examples:\n\n- `list` or None\n- `int`, `float` or `long`\n- `int`, `float`, `long`\n- `typist._py.PY2` or `typist._py.PY3`\n- `list` or `callable`\n\n`callable` above is a special case. While technically it's not a type it does\ndescribe the way an object should behave. Another special cases that doesn't\nwork yet, but may soon is `iterable`.\n\nThis languasge for specifying a type will grow a bit more rich for collections.\nIt would be really handy to allow the developer to specify parameterized types\nlike:\n\n- `list` - a `list` of `int`\n- `dict` - a `dict` where the keys are strings and\n the values are instances of package.module.Class\n\nBackground\n----------\n\nThe idea to write to this came to me when I was working on Python 3 support\nfor `Keystone`_. I wanted to ensure that the code was actually getting the\nbinary or text types that it expected. I was sick of the bullshit practice of\n`.encode('utf8').decode('utf8')` (maybe I got that backwards) that made the\nexceptions go away, but does nothing to solve the problem.\n\nI didn't bother looking for something that was already implemented because I\nwanted to learn a bit about import hooks. If you know of something better then\nplease let me know. If this is the best thing since sliced bread I'd also like\nto know.\n\n.. _Keystone: http://docs.openstack.org/developer/keystone/\n.. _import hook: https://www.python.org/dev/peps/pep-0302/\n.. _AST: https://docs.python.org/2/library/ast.html", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dstanek/typist", "keywords": null, "license": "Apache Software License", "maintainer": null, "maintainer_email": null, "name": "typist", "package_url": "https://pypi.org/project/typist/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/typist/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dstanek/typist" }, "release_url": "https://pypi.org/project/typist/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "type checking at test time", "version": "0.0.1" }, "last_serial": 1657048, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7d1d493bd423733c94467f4c4a08405f", "sha256": "73411a3a3926d31ac05538e8ba4f2fe96fc81932e32dae9aab3cdd925c964d12" }, "downloads": -1, "filename": "typist-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "7d1d493bd423733c94467f4c4a08405f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11704, "upload_time": "2015-07-30T17:06:40", "url": "https://files.pythonhosted.org/packages/ad/d3/4a777422be68da90506828fc46675d83f2badc3a805dbd7ddfe3046278e9/typist-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e2a1e53b7c7a3f076cb8e5e621c2753", "sha256": "4e7399216f0282c69a61e511e3857fcf1b001a21ddb0192fb83b2a89397adde3" }, "downloads": -1, "filename": "typist-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3e2a1e53b7c7a3f076cb8e5e621c2753", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11705, "upload_time": "2015-07-30T17:08:54", "url": "https://files.pythonhosted.org/packages/f6/44/e0bd138588fa6e9dbe0130566a63b1fe3955034af55bf64d5de4857d43db/typist-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a6a0f1487575f1a95e279f62fca8c91", "sha256": "feec0126c8f029e61790073ae559cfdab0759e09a21b36ff8b0cf008a1eb63bb" }, "downloads": -1, "filename": "typist-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2a6a0f1487575f1a95e279f62fca8c91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6484, "upload_time": "2015-07-30T17:06:37", "url": "https://files.pythonhosted.org/packages/64/c8/d15e22c77135fff6eb959b756b7fae5a61b209920909481597648bcf73ce/typist-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d1d493bd423733c94467f4c4a08405f", "sha256": "73411a3a3926d31ac05538e8ba4f2fe96fc81932e32dae9aab3cdd925c964d12" }, "downloads": -1, "filename": "typist-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "7d1d493bd423733c94467f4c4a08405f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11704, "upload_time": "2015-07-30T17:06:40", "url": "https://files.pythonhosted.org/packages/ad/d3/4a777422be68da90506828fc46675d83f2badc3a805dbd7ddfe3046278e9/typist-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e2a1e53b7c7a3f076cb8e5e621c2753", "sha256": "4e7399216f0282c69a61e511e3857fcf1b001a21ddb0192fb83b2a89397adde3" }, "downloads": -1, "filename": "typist-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3e2a1e53b7c7a3f076cb8e5e621c2753", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11705, "upload_time": "2015-07-30T17:08:54", "url": "https://files.pythonhosted.org/packages/f6/44/e0bd138588fa6e9dbe0130566a63b1fe3955034af55bf64d5de4857d43db/typist-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a6a0f1487575f1a95e279f62fca8c91", "sha256": "feec0126c8f029e61790073ae559cfdab0759e09a21b36ff8b0cf008a1eb63bb" }, "downloads": -1, "filename": "typist-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2a6a0f1487575f1a95e279f62fca8c91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6484, "upload_time": "2015-07-30T17:06:37", "url": "https://files.pythonhosted.org/packages/64/c8/d15e22c77135fff6eb959b756b7fae5a61b209920909481597648bcf73ce/typist-0.0.1.tar.gz" } ] }