{ "info": { "author": "austinv11", "author_email": "austinv11@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Testing", "Topic :: Software Development :: Testing :: Unit", "Topic :: Utilities" ], "description": "TinkerTest\n==========\nInline testing/validation in python 3, based on this wonderful blog post: https://tinkering.xyz/abusing-type-annotations/\n\n## What is this?\nTinkerTest aims to simplify data validation checking in both unit tests and production environments. In order to do this\nconveniently, TinkerTest ~~abuses~~ makes use of the fact that python type annotations can be any arbitrary python \nexpression. Using this fact allows us to inject validation logic into your scripts which simply evaluate your type \nannotations.\n\n## Helpful Hint\nStarting from python 3.7, the `annotations` future import exists. This may be helpful for you, as its lazy evaluation\nshould prevent some common mistakes in using this library.\n\n## Trivial Example\n```python\n# my_script.py\nfrom tinkertest import inject_into_type\n\nclass MyClass:\n my_field: 'my_field < 0' # This field only accepts values < 0\n my_str_field: str # This field only accepts strings\n \n def __init__(self, my_field, my_str_field):\n self.my_field = my_field\n self.my_str_field = my_str_field\n \n # This function only accepts a non-None argument and should always return 1\n def some_func(self, input_val: 'input_val is not None') -> 'returned == 1': # 'returned' is a magic variable for use in return annotations\n ...\n \ninject_into_type(MyClass) # Wires all the injections, now any calls will be validated!\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/austinv11/tinkertest", "keywords": "testing test annotations validation", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "TinkerTest", "package_url": "https://pypi.org/project/TinkerTest/", "platform": "", "project_url": "https://pypi.org/project/TinkerTest/", "project_urls": { "Bug Reports": "https://github.com/austinv11/tinkertest/issues", "Homepage": "https://github.com/austinv11/tinkertest", "Source": "https://github.com/austinv11/tinkertest/" }, "release_url": "https://pypi.org/project/TinkerTest/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "TinkerTest is a tool designed to make data validation fun!", "version": "0.1.1" }, "last_serial": 4184308, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "7bdccaba18649b117c883d0df0e36bfc", "sha256": "723d269ff81dff28b0b10f2d4dadde8c6687fcc78ea4dcd1f435ee9eab22aa46" }, "downloads": -1, "filename": "TinkerTest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7bdccaba18649b117c883d0df0e36bfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8539, "upload_time": "2018-08-19T03:10:23", "url": "https://files.pythonhosted.org/packages/1b/ea/3c4658f60592f1a1735cfbdffd977a54ad50a10540670972922da5772bfc/TinkerTest-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7bdccaba18649b117c883d0df0e36bfc", "sha256": "723d269ff81dff28b0b10f2d4dadde8c6687fcc78ea4dcd1f435ee9eab22aa46" }, "downloads": -1, "filename": "TinkerTest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7bdccaba18649b117c883d0df0e36bfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8539, "upload_time": "2018-08-19T03:10:23", "url": "https://files.pythonhosted.org/packages/1b/ea/3c4658f60592f1a1735cfbdffd977a54ad50a10540670972922da5772bfc/TinkerTest-0.1.1.tar.gz" } ] }