{ "info": { "author": "Robert Parker", "author_email": "rob@parob.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Type Checker\nType check Python types with support for nested lists and dictionaries.\n\n[![coverage report](https://gitlab.com/robjampar/type-checker/badges/master/coverage.svg)](https://gitlab.com/robjampar/type-checker/commits/master)\n\n[![pipeline status](https://gitlab.com/robjampar/type-checker/badges/master/pipeline.svg)](https://gitlab.com/robjampar/type-checker/commits/master)\n\n## Installation\nType Checker is a Python package, and is compatible with `Python 3` only (for now). It can be installed through `pip`.\n\n##### Pip\n```\npip install type-checker\n```\n\n## Run the Unit Tests\nTo run the tests.\n```\npip install pipenv\npipenv install --dev\npipenv run python -m pytest tests --cov=type_checker\n```\n\n## Docs\n\nThe documentation is public, and is generated using Sphinx.\n\n[Type Checker Documentation](https://robjampar.gitlab.io/type-checker)\n\n##### Build documentation\nTo build a local static HTML version of the documentation.\n```\npip install pipenv\npipenv install sphinx\npipenv run sphinx-build docs ./public -b html\n```\n\n## Type Checking Example\n``` python\nfrom typing import Union\nfrom type_checker import type_check\n\n# the type defintion to check a value against\ntype_def = {\n \"hello\": {\n \"world\": int\n },\n \"a_key\": str,\n \"a_list\": [\n float\n ],\n int: bool,\n float: Union[bool, int]\n}\n\n# a valid test value\ntest_value = {\n \"hello\": {\n \"world\": 1\n },\n \"a_key\": \"this_is_a_string\",\n \"a_list\": [\n 3.2,\n 4.7\n 5.9\n ],\n 5: True,\n 5.2: False,\n 5.7: 10\n\n}\n\n# use validate from the type_checker package to validate the value\nis_valid = type_check(test_value, type_def)\n\nprint(f\"is valid: {is_valid}\")\n```\n\n``` text\n$ python example.py\n>>> is valid: True\n```", "description_content_type": "", "docs_url": null, "download_url": "https://gitlab.com/robjampar/type-checker/-/archive/v1.0.2/type-checker-v1.0.2.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/robjampar/type-checker", "keywords": "Type,Checker,Validator", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "type-checker", "package_url": "https://pypi.org/project/type-checker/", "platform": "", "project_url": "https://pypi.org/project/type-checker/", "project_urls": { "Download": "https://gitlab.com/robjampar/type-checker/-/archive/v1.0.2/type-checker-v1.0.2.tar.gz", "Homepage": "https://gitlab.com/robjampar/type-checker" }, "release_url": "https://pypi.org/project/type-checker/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Type checker helpers for Python.", "version": "1.0.2" }, "last_serial": 4935666, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "f92b2754878942328a12a8b19d62ea73", "sha256": "d8d39fc5dbcc54e593f655d3d9c22e1ee5b129d11eb71fdc17a4d122a15455d7" }, "downloads": -1, "filename": "type-checker-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f92b2754878942328a12a8b19d62ea73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4327, "upload_time": "2019-03-13T15:06:47", "url": "https://files.pythonhosted.org/packages/3a/d1/371c600cf0d25d566e075815c5eb9e52ebade274c1326868051910084638/type-checker-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "206ee448c483f618e45f17b0133c95c3", "sha256": "31479d1a51ee4dde8b17a634e2329162a8586dc452723fe484651157747d119b" }, "downloads": -1, "filename": "type-checker-1.0.2.tar.gz", "has_sig": false, "md5_digest": "206ee448c483f618e45f17b0133c95c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5746, "upload_time": "2019-03-13T17:07:46", "url": "https://files.pythonhosted.org/packages/3a/47/94e7f81589953ad1a2a33f8e4fb0f0987144ad7b395ddbc7f8dc61ca1415/type-checker-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "206ee448c483f618e45f17b0133c95c3", "sha256": "31479d1a51ee4dde8b17a634e2329162a8586dc452723fe484651157747d119b" }, "downloads": -1, "filename": "type-checker-1.0.2.tar.gz", "has_sig": false, "md5_digest": "206ee448c483f618e45f17b0133c95c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5746, "upload_time": "2019-03-13T17:07:46", "url": "https://files.pythonhosted.org/packages/3a/47/94e7f81589953ad1a2a33f8e4fb0f0987144ad7b395ddbc7f8dc61ca1415/type-checker-1.0.2.tar.gz" } ] }