{ "info": { "author": "Timothy Crosley", "author_email": "timothy.crosley@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "[![eXamples - Python Tests and Documentation Done by Example.](https://raw.github.com/timothycrosley/examples/master/art/logo_large.png)](https://timothycrosley.github.io/examples/)\n_________________\n\n[![PyPI version](https://badge.fury.io/py/examples.svg)](http://badge.fury.io/py/examples)\n[![Build Status](https://travis-ci.org/timothycrosley/examples.svg?branch=master)](https://travis-ci.org/timothycrosley/examples)\n[![codecov](https://codecov.io/gh/timothycrosley/examples/branch/master/graph/badge.svg)](https://codecov.io/gh/timothycrosley/examples)\n[![Join the chat at https://gitter.im/timothycrosley/examples](https://badges.gitter.im/timothycrosley/examples.svg)](https://gitter.im/timothycrosley/examples?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://pypi.python.org/pypi/examples/)\n[![Downloads](https://pepy.tech/badge/examples)](https://pepy.tech/project/examples)\n_________________\n\n[Read Latest Documentation](https://timothycrosley.github.io/examples/) - [Browse GitHub Code Repository](https://github.com/timothycrosley/examples/)\n_________________\n\n**eXamples** (AKA: xamples for SEO) is a Python3 library enabling interactable, self-documenting, and self-verifying examples. These examples are attached directly to Python functions using decorators or via separate `MODULE_examples.py` source files.\n\n[![Example Usage Gif](https://raw.githubusercontent.com/timothycrosley/examples/master/art/example.gif)](https://raw.githubusercontent.com/timothycrosley/examples/master/art/example.gif)\n\nKey Features:\n\n* **Simple and Obvious API**: Add `@examples.example(*args, **kwargs)` decorators for each example you want to add to a function.\n* **Auto Documenting**: Examples, by default, get added to your functions docstring viewable both in interactive interpreters and when using [portray](https://timothycrosley.github.io/portray/) or [pdocs](https://timothycrosley.github.io/pdocs/).\n* **Signature Validating**: All examples can easily be checked to ensure they match the function signature (and type annotations!) with a single call (`examples.verify_all_signatures()`).\n* **Act as Tests**: Examples act as additional test cases, that can easily be verified using a single test case in your favorite test runner: (`examples.test_all_examples()`).\n* **Async Compatibility**: Examples can be attached and tested as easily against async functions as non-async ones.\n\nWhat's Missing:\n\n* **Class Support**: Currently examples can only be attached to individual functions. Class and method support is planned for a future release.\n\n## Quick Start\n\nThe following guides should get you up and running using eXamples in no time.\n\n1. [Installation](https://timothycrosley.github.io/examples/docs/quick_start/1.-installation/) - TL;DR: Run `pip3 install examples` within your projects virtual environment.\n2. [Adding Examples](https://timothycrosley.github.io/examples/docs/quick_start/2.-adding-examples/) -\n TL;DR: Add example decorators that represent each of your examples:\n\n # my_module_with_examples.py\n from examples import example\n\n @example(1, number_2=1, _example_returns=2)\n def add(number_1: int, number_2: int) -> int:\n return number_1 + number_2\n\n3. [Verify and Test Examples](https://timothycrosley.github.io/examples/docs/quick_start/3.-testing-examples/) -\n TL;DR: run `examples.verify_and_test_examples` within your projects test cases.\n\n # test_my_module_with_examples.py\n from examples import verify_and_test_examples\n\n import my_module_with_examples\n\n\n def test_examples_verifying_signature():\n verify_and_test_examples(my_module_with_examples)\n\n4. Introspect Examples -\n\n import examples\n\n from my_module_with_examples import add\n\n\n examples.get_examples(add)[0].use() == 2\n\n## Why Create Examples?\n\nI've always wanted a way to attach examples to functions in a way that would be re-useable for documentation, testing, and API proposes.\nJust like moving Python parameter types from comments into type annotations has made them more broadly useful, I hope examples can do the same for example calls.\n\nI hope you too find `eXamples` useful!\n\n~Timothy Crosley\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "Timothy Crosley", "maintainer_email": "timothy.crosley@gmail.com", "name": "examples", "package_url": "https://pypi.org/project/examples/", "platform": "", "project_url": "https://pypi.org/project/examples/", "project_urls": null, "release_url": "https://pypi.org/project/examples/1.0.1/", "requires_dist": [ "pydantic (>=0.32.2,<0.33.0)" ], "requires_python": ">=3.6,<4.0", "summary": "Tests and Documentation Done by Example.", "version": "1.0.1" }, "last_serial": 5834028, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f8409a2b81a3ea2c9e32122a20cc985d", "sha256": "d6506694618e118538e26a25d2981de5a7aefd2c371aad9ffa8099bf9d100e33" }, "downloads": -1, "filename": "examples-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f8409a2b81a3ea2c9e32122a20cc985d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 1941, "upload_time": "2019-09-06T05:33:23", "url": "https://files.pythonhosted.org/packages/82/21/bdae174c5d650b7c0e57f061efff13e06f7094663675dc0309b9f0e97f86/examples-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c22d7ae439e2ae5f228a2d2bc4312ba", "sha256": "9be0f06129fbd45e822dbe8e7297d0063a34528ee8d49ce1a51dc6330d44fafd" }, "downloads": -1, "filename": "examples-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2c22d7ae439e2ae5f228a2d2bc4312ba", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 1814, "upload_time": "2019-09-06T05:33:25", "url": "https://files.pythonhosted.org/packages/ce/8c/df807615420586436d74aeb4e8f15e27dd11c7090945dc5241a12c33bf9e/examples-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "5d540a7ad6ec488dccb09c8641517628", "sha256": "1c8565a49ff6dd3e3bd93e5f56b11d233db52c8624e7502d704f726af7b6b9ca" }, "downloads": -1, "filename": "examples-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5d540a7ad6ec488dccb09c8641517628", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 5662, "upload_time": "2019-09-09T16:26:01", "url": "https://files.pythonhosted.org/packages/aa/dd/777c686e1e754cfe75d9292ef76f1f1de1d2671cd0649f4d4b72a48bdc02/examples-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff9bd3d27249a54f83378bf36582f2ab", "sha256": "383c7afcaa91f22f354239a05834d38d15aa52e159ab859beba1efd875f6fdcd" }, "downloads": -1, "filename": "examples-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ff9bd3d27249a54f83378bf36582f2ab", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 4850, "upload_time": "2019-09-09T16:26:02", "url": "https://files.pythonhosted.org/packages/c3/0e/1559a1be8bd49564ded040c0539aadc770c5258ff4c41095263aa50b9263/examples-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "82d69a7a13b88fd0655abd0443db5fbb", "sha256": "17d69fe4f70af7ddcc18b47d97a0587339074b6cd565bb2f834e428c0262290e" }, "downloads": -1, "filename": "examples-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "82d69a7a13b88fd0655abd0443db5fbb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7816, "upload_time": "2019-09-10T09:19:37", "url": "https://files.pythonhosted.org/packages/e2/37/c36f7e528bb6609142256cbd297809984f3e90d20210469fa1c9f3150a86/examples-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e430043b9ac0b5f9169aff4f20662b9f", "sha256": "bba7ee36f9e798c89b32aecedc66dca012bd5fe04c6be8e4cb6570ed44c8f47e" }, "downloads": -1, "filename": "examples-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e430043b9ac0b5f9169aff4f20662b9f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 7237, "upload_time": "2019-09-10T09:19:38", "url": "https://files.pythonhosted.org/packages/7f/96/0fbf84c641fb30b90a2bd85f07b61bc44c842621140c8900c22cedd5e1d4/examples-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "9852cb77ad4974abd44796afaf627aa5", "sha256": "29c91644475d19befb5eedcc0d8ca2dbb98955e6beace8f0613fa5e8d6ae42fd" }, "downloads": -1, "filename": "examples-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9852cb77ad4974abd44796afaf627aa5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7520, "upload_time": "2019-09-10T16:41:29", "url": "https://files.pythonhosted.org/packages/2a/04/ecfa50c18023fe64063135fd0a628ca385ad712c7af9f6f92dd2c0bdaf25/examples-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bee9bfac62891cf33bc1b1c505ad7435", "sha256": "333cb91d3d0af8bc739cff88e112f92a59b8517d237ea35db4eaf2228ad24368" }, "downloads": -1, "filename": "examples-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bee9bfac62891cf33bc1b1c505ad7435", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 7024, "upload_time": "2019-09-10T16:41:30", "url": "https://files.pythonhosted.org/packages/73/72/3dd15e9b6b9ebc1dbbd42dde758c0e3b2765b82ccbf412cb15f073c6bcde/examples-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e1009cde2410fa89f05d210541aa6d90", "sha256": "c55d3a94c763723c4e88f2ca1a3f003fabdd445d266f6a057a0e40b25db3bf10" }, "downloads": -1, "filename": "examples-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "e1009cde2410fa89f05d210541aa6d90", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 8034, "upload_time": "2019-09-11T06:16:39", "url": "https://files.pythonhosted.org/packages/75/ae/063e698bf1c91f51cdb30da1635262bc7bc7d2e20ad652c0f25d195eb932/examples-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3714baddb4d175ac6a74b2500826d853", "sha256": "4647ba72efc80bb407db9c2d6dab4be002011b622b66313af928ad18e32ae2e5" }, "downloads": -1, "filename": "examples-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3714baddb4d175ac6a74b2500826d853", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8483, "upload_time": "2019-09-11T06:16:45", "url": "https://files.pythonhosted.org/packages/de/8c/df466ac32f081bdfc33253313c6c48c13cd79d7e9699b6173aeb6de34e02/examples-0.1.2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "f9aaa7a32ee037422ff1996da30b3748", "sha256": "e6bc53a835028a89c5dedbb7de4cfde77ae8ccbeb169599e12b728a30ba689eb" }, "downloads": -1, "filename": "examples-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f9aaa7a32ee037422ff1996da30b3748", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 8246, "upload_time": "2019-09-11T08:51:28", "url": "https://files.pythonhosted.org/packages/0e/7d/8856931d56cc6c09cfc150c5c3d927028c551f4e643cf54c503b33725ae5/examples-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cba19a1d2a0386dd444be02d9611b450", "sha256": "b4dd9fbbf0820254bcbaf47a09d38f6c70e40112277322263fda38ff46789b73" }, "downloads": -1, "filename": "examples-1.0.0.tar.gz", "has_sig": false, "md5_digest": "cba19a1d2a0386dd444be02d9611b450", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8935, "upload_time": "2019-09-11T08:51:30", "url": "https://files.pythonhosted.org/packages/cb/00/4faa3d37786f03d3cd8bd8e945d557f52ad35ad64e82f9cf7b44290bd202/examples-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "37b421e0093b8bb18211623f79aba650", "sha256": "bf3c16a072e186815a78ebf85177bd1313cdaf34298baf0a8be30957147dd47d" }, "downloads": -1, "filename": "examples-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "37b421e0093b8bb18211623f79aba650", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 8239, "upload_time": "2019-09-16T05:16:27", "url": "https://files.pythonhosted.org/packages/bd/67/aac9d1d2c94dfca7082f18b42ec56553462e627b82f881d18728ee9ea96c/examples-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1f82f4f2f4968709905b3bac1b1bb1d2", "sha256": "9dba261e3929f3274328beeadcb2212180e12dbdc033eb0f35c3666708055fc4" }, "downloads": -1, "filename": "examples-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1f82f4f2f4968709905b3bac1b1bb1d2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8924, "upload_time": "2019-09-16T05:16:29", "url": "https://files.pythonhosted.org/packages/19/6b/9390264c58eee896a5232966f7b3e90c5183459ce690ed4ef0b2a1ede8a2/examples-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37b421e0093b8bb18211623f79aba650", "sha256": "bf3c16a072e186815a78ebf85177bd1313cdaf34298baf0a8be30957147dd47d" }, "downloads": -1, "filename": "examples-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "37b421e0093b8bb18211623f79aba650", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 8239, "upload_time": "2019-09-16T05:16:27", "url": "https://files.pythonhosted.org/packages/bd/67/aac9d1d2c94dfca7082f18b42ec56553462e627b82f881d18728ee9ea96c/examples-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1f82f4f2f4968709905b3bac1b1bb1d2", "sha256": "9dba261e3929f3274328beeadcb2212180e12dbdc033eb0f35c3666708055fc4" }, "downloads": -1, "filename": "examples-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1f82f4f2f4968709905b3bac1b1bb1d2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8924, "upload_time": "2019-09-16T05:16:29", "url": "https://files.pythonhosted.org/packages/19/6b/9390264c58eee896a5232966f7b3e90c5183459ce690ed4ef0b2a1ede8a2/examples-1.0.1.tar.gz" } ] }