{ "info": { "author": "Tsuyoshi Hombashi", "author_email": "gogogo.vm@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pytypeutil\n==========\n\n.. image:: https://badge.fury.io/py/pytypeutil.svg\n :target: https://badge.fury.io/py/pytypeutil\n\n.. image:: https://img.shields.io/pypi/pyversions/pytypeutil.svg\n :target: https://pypi.python.org/pypi/pytypeutil\n\n.. image:: https://img.shields.io/travis/thombashi/pytypeutil/master.svg?label=Linux\n :target: https://travis-ci.org/thombashi/pytypeutil\n\n.. image:: https://img.shields.io/appveyor/ci/thombashi/pytypeutil/master.svg?label=Windows\n :target: https://ci.appveyor.com/project/thombashi/pytypeutil\n\n.. image:: https://coveralls.io/repos/github/thombashi/pytypeutil/badge.svg?branch=master\n :target: https://coveralls.io/github/thombashi/pytypeutil?branch=master\n\n.. image:: https://img.shields.io/github/stars/thombashi/pytypeutil.svg?style=social&label=Star\n :target: https://github.com/thombashi/pytypeutil\n\nSummary\n-------\n\nA python library for variable type checker/validator/converter at run time.\n\nUsage\n=====\n\nType Check\n----------------------\n\n.. code:: pycon\n\n >>> from pytypeutil.type import Integer\n >>> Integer(1).is_type()\n True\n >>> Integer(1.1).is_type()\n False\n\n\nType Validation\n----------------------\n\n.. code:: pycon\n\n >>> from pytypeutil.type import Integer\n >>> Integer(1).validate()\n >>> try:\n ... Integer(1.1).validate()\n ... except TypeError as e:\n ... print(e)\n ...\n invalid value type: expected=INTEGER, actual=\n\n\nType Conversion\n----------------------\n\nconvert\n~~~~~~~~~~~~~~\n.. code:: pycon\n\n >>> from pytypeutil.type import Integer\n >>> from pytypeutil import TypeConversionError\n >>> Integer(\"1\").convert()\n 1\n >>> try:\n ... Integer(1.1).convert()\n ... except TypeConversionError as e:\n ... print(e)\n ...\n failed to convert from float to INTEGER\n\ntry_convert\n~~~~~~~~~~~~~~\n.. code:: pycon\n\n >>> from pytypeutil.type import Integer\n >>> Integer(\"1\").try_convert()\n 1\n >>> print(Integer(1.1).try_convert())\n None\n\nforce_convert\n~~~~~~~~~~~~~~\n.. code:: pycon\n\n >>> from pytypeutil.type import Integer\n >>> Integer(\"1\").force_convert()\n 1\n >>> Integer(1.1).force_convert()\n 1\n\n\nFor more information\n====================\n\nMore examples are available at \nhttp://pytypeutil.rtfd.io/en/latest/pages/reference/index.html\n\nFeatures\n========\n\nSupported types are as follows:\n\n- bool\n- datetime\n- dict\n- int\n- float\n - Real number\n - Infinite\n - Not a number\n- None\n- str\n - null string\n\nType check/validate/convert results will be decided according to ``strict_level``\nwhich can be passed to constructors. API reference can be found at the document.\n\n\nInstallation\n============\n\n::\n\n pip install pytypeutil\n\n\nDependencies\n============\nPython 2.7+ or 3.3+\n\n- `mbstrdecoder `__\n- `python-dateutil `__\n- `pytz `__\n- `six `__\n\n\nTest dependencies\n-----------------\n- `pytest `__\n- `pytest-runner `__\n- `tox `__\n\nDocumentation\n=============\n\nhttp://pytypeutil.rtfd.io/", "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/thombashi/pytypeutil", "keywords": "type,validator,converter", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "pytypeutil", "package_url": "https://pypi.org/project/pytypeutil/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pytypeutil/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/thombashi/pytypeutil" }, "release_url": "https://pypi.org/project/pytypeutil/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "A python library for variable type checker/validator/converter at run time.", "version": "0.0.1" }, "last_serial": 2634956, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0d8ef196c9688e46bdf583f74f4a87e2", "sha256": "fbee0bc8a6494f9869fc4fd55611654a224d493f0960a3ca9cdd1ffeb2d530c0" }, "downloads": -1, "filename": "pytypeutil-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0d8ef196c9688e46bdf583f74f4a87e2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 26556, "upload_time": "2017-02-11T07:04:58", "url": "https://files.pythonhosted.org/packages/ae/c9/d0fb1491a0beef768e6d8b4a4558ec640d1afb5ef2e05a9d764f283d9917/pytypeutil-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e49e581fcaa932d1446fe920280305d9", "sha256": "bb802a976d1601a1031d1c2ef085fa8b67022c384f650d8a90de0cf407dec373" }, "downloads": -1, "filename": "pytypeutil-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e49e581fcaa932d1446fe920280305d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17606, "upload_time": "2017-02-11T07:04:54", "url": "https://files.pythonhosted.org/packages/15/02/6529770f8aec77bf424cbdf6ab1fe65d1db515a1c53ca020a73bbeee50bf/pytypeutil-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0d8ef196c9688e46bdf583f74f4a87e2", "sha256": "fbee0bc8a6494f9869fc4fd55611654a224d493f0960a3ca9cdd1ffeb2d530c0" }, "downloads": -1, "filename": "pytypeutil-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0d8ef196c9688e46bdf583f74f4a87e2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 26556, "upload_time": "2017-02-11T07:04:58", "url": "https://files.pythonhosted.org/packages/ae/c9/d0fb1491a0beef768e6d8b4a4558ec640d1afb5ef2e05a9d764f283d9917/pytypeutil-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e49e581fcaa932d1446fe920280305d9", "sha256": "bb802a976d1601a1031d1c2ef085fa8b67022c384f650d8a90de0cf407dec373" }, "downloads": -1, "filename": "pytypeutil-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e49e581fcaa932d1446fe920280305d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17606, "upload_time": "2017-02-11T07:04:54", "url": "https://files.pythonhosted.org/packages/15/02/6529770f8aec77bf424cbdf6ab1fe65d1db515a1c53ca020a73bbeee50bf/pytypeutil-0.0.1.tar.gz" } ] }