tobool


Nametobool JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/jamesabel/tobool
Summaryconvert any boolean-like value such as string, int, etc. to an actual bool
upload_time2023-12-27 09:20:32
maintainer
docs_urlNone
authorabel
requires_python
licenseMIT License
keywords boolean
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            
<p align="center">
    <!--
    <a href="https://app.circleci.com/pipelines/github/jamesabel/tobool" alt="build">
        <img src="https://img.shields.io/circleci/build/gh/jamesabel/tobool" />
    </a>
    -->
    <a href="https://codecov.io/gh/jamesabel/tobool" alt="codecov">
        <img src="https://img.shields.io/codecov/c/github/jamesabel/tobool/master" />
    </a>
    <a href="https://pypi.org/project/tobool/" alt="pypi">
        <img src="https://img.shields.io/pypi/v/tobool" />
    </a>
    <a href="https://pypi.org/project/tobool/" alt="downloads">
        <img src="https://img.shields.io/pypi/dm/tobool" />
    </a>
    <!--
    <a alt="python">
        <img src="https://img.shields.io/pypi/pyversions/tobool" />
    </a>
    -->
    <a alt="license">
        <img src="https://img.shields.io/github/license/jamesabel/tobool" />
    </a>
</p>

# tobool

Convert many different representations of a bool to an actual bool or a None

# Usage

```
pip install tobool

from tobool import to_bool

# Examples:
print(to_bool("True"))  # True
print(to_bool("False"))  # False
print(to_bool("Yes"))  # True
print(to_bool("T"))  # True
print(to_bool(1))  # True
print(to_bool("None"))  # None

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jamesabel/tobool",
    "name": "tobool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "boolean",
    "author": "abel",
    "author_email": "j@abel.co",
    "download_url": "https://github.com/jamesabel/tobool",
    "platform": null,
    "description": "\r\n<p align=\"center\">\r\n    <!--\r\n    <a href=\"https://app.circleci.com/pipelines/github/jamesabel/tobool\" alt=\"build\">\r\n        <img src=\"https://img.shields.io/circleci/build/gh/jamesabel/tobool\" />\r\n    </a>\r\n    -->\r\n    <a href=\"https://codecov.io/gh/jamesabel/tobool\" alt=\"codecov\">\r\n        <img src=\"https://img.shields.io/codecov/c/github/jamesabel/tobool/master\" />\r\n    </a>\r\n    <a href=\"https://pypi.org/project/tobool/\" alt=\"pypi\">\r\n        <img src=\"https://img.shields.io/pypi/v/tobool\" />\r\n    </a>\r\n    <a href=\"https://pypi.org/project/tobool/\" alt=\"downloads\">\r\n        <img src=\"https://img.shields.io/pypi/dm/tobool\" />\r\n    </a>\r\n    <!--\r\n    <a alt=\"python\">\r\n        <img src=\"https://img.shields.io/pypi/pyversions/tobool\" />\r\n    </a>\r\n    -->\r\n    <a alt=\"license\">\r\n        <img src=\"https://img.shields.io/github/license/jamesabel/tobool\" />\r\n    </a>\r\n</p>\r\n\r\n# tobool\r\n\r\nConvert many different representations of a bool to an actual bool or a None\r\n\r\n# Usage\r\n\r\n```\r\npip install tobool\r\n\r\nfrom tobool import to_bool\r\n\r\n# Examples:\r\nprint(to_bool(\"True\"))  # True\r\nprint(to_bool(\"False\"))  # False\r\nprint(to_bool(\"Yes\"))  # True\r\nprint(to_bool(\"T\"))  # True\r\nprint(to_bool(1))  # True\r\nprint(to_bool(\"None\"))  # None\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "convert any boolean-like value such as string, int, etc. to an actual bool",
    "version": "0.4.0",
    "project_urls": {
        "Download": "https://github.com/jamesabel/tobool",
        "Homepage": "https://github.com/jamesabel/tobool"
    },
    "split_keywords": [
        "boolean"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f1f193f13ab26ebf609d980aeb8285f1d78c8f1f87727139e2d9a0181b01571a",
                "md5": "96be38a727934228afa8afbe475a0af4",
                "sha256": "1b31c9ece9bad47e8a53e17bf0f38335570cb1d9576b2dc0d3df61bab4f1cb47"
            },
            "downloads": -1,
            "filename": "tobool-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "96be38a727934228afa8afbe475a0af4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4328,
            "upload_time": "2023-12-27T09:20:32",
            "upload_time_iso_8601": "2023-12-27T09:20:32.402676Z",
            "url": "https://files.pythonhosted.org/packages/f1/f1/93f13ab26ebf609d980aeb8285f1d78c8f1f87727139e2d9a0181b01571a/tobool-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-27 09:20:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jamesabel",
    "github_project": "tobool",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "tobool"
}
        
Elapsed time: 0.21070s