timedinput


Nametimedinput JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryTimeout for python inputs
upload_time2023-05-05 20:17:39
maintainer
docs_urlNone
author
requires_python
licenseMIT License Copyright (c) 2023 Kerollos Emad Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords input stdin timeout console
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # timedinput 
A Python module that waits for a specified amount of time for user input. If no input is received within the given timeout period, the module sets the variable value as per the default or raises an exception. This module is similar to the [inputtimeout](https://pypi.org/project/inputimeout/) module, but with a few differences.

## Usage
The timedinput function takes three optional arguments: prompt, timeout, and default.
```py
from timedinput import timedinput

# Prompt the user for input with a timeout of 10 seconds
user_input = timedinput("Enter something: ", timeout=10)

# Prompt the user for input with a timeout of 5 seconds and a default value of "default"
user_input = timedinput("Enter something: ", timeout=5, default="default")
```
If the user enters input within the specified timeout, the function returns the user's input as a string. If the user does not enter input within the specified timeout, the function returns the default value (if one was provided) or raises a TimeoutOccurred exception.

## Installation
The `timedinput` module can be installed using pip.
```
pip install timedinput
```

## Compatibility
Works on all platforms, including Windows and Unix-like operating systems.

## License
Released under the MIT License. See the LICENSE file for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "timedinput",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "input,stdin,timeout,console",
    "author": "",
    "author_email": "Kerollos Emad <kerollos.em@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/83/1d/2b712b126632762ae74954d0d842d0d43d8fd8b38de4c70f451f709b1b2a/timedinput-0.1.1.tar.gz",
    "platform": null,
    "description": "# timedinput \nA Python module that waits for a specified amount of time for user input. If no input is received within the given timeout period, the module sets the variable value as per the default or raises an exception. This module is similar to the [inputtimeout](https://pypi.org/project/inputimeout/) module, but with a few differences.\n\n## Usage\nThe timedinput function takes three optional arguments: prompt, timeout, and default.\n```py\nfrom timedinput import timedinput\n\n# Prompt the user for input with a timeout of 10 seconds\nuser_input = timedinput(\"Enter something: \", timeout=10)\n\n# Prompt the user for input with a timeout of 5 seconds and a default value of \"default\"\nuser_input = timedinput(\"Enter something: \", timeout=5, default=\"default\")\n```\nIf the user enters input within the specified timeout, the function returns the user's input as a string. If the user does not enter input within the specified timeout, the function returns the default value (if one was provided) or raises a TimeoutOccurred exception.\n\n## Installation\nThe `timedinput` module can be installed using pip.\n```\npip install timedinput\n```\n\n## Compatibility\nWorks on all platforms, including Windows and Unix-like operating systems.\n\n## License\nReleased under the MIT License. See the LICENSE file for more information.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Kerollos Emad  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Timeout for python inputs",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/kerollosy/timedinput/issues",
        "Source": "https://github.com/kerollosy/timedinput"
    },
    "split_keywords": [
        "input",
        "stdin",
        "timeout",
        "console"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aee8fabcb79d89ae44d1f37890895077f9ab33f22256228a01606337700f37b9",
                "md5": "bbd7e22b2a120d2f7a53ea0bcc76f24b",
                "sha256": "987fdbdda1a1b40784495cb6ed2eccd334d5c78ca70104861deecd226549681f"
            },
            "downloads": -1,
            "filename": "timedinput-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bbd7e22b2a120d2f7a53ea0bcc76f24b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4493,
            "upload_time": "2023-05-05T20:17:26",
            "upload_time_iso_8601": "2023-05-05T20:17:26.071773Z",
            "url": "https://files.pythonhosted.org/packages/ae/e8/fabcb79d89ae44d1f37890895077f9ab33f22256228a01606337700f37b9/timedinput-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "831d2b712b126632762ae74954d0d842d0d43d8fd8b38de4c70f451f709b1b2a",
                "md5": "55c4eba6bab81f1d2756d79ed3fcd74f",
                "sha256": "86ab8f178163ea98e066480e39b36acd933fa6a94509a46274edeb7671327c35"
            },
            "downloads": -1,
            "filename": "timedinput-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "55c4eba6bab81f1d2756d79ed3fcd74f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3750,
            "upload_time": "2023-05-05T20:17:39",
            "upload_time_iso_8601": "2023-05-05T20:17:39.581314Z",
            "url": "https://files.pythonhosted.org/packages/83/1d/2b712b126632762ae74954d0d842d0d43d8fd8b38de4c70f451f709b1b2a/timedinput-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-05 20:17:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kerollosy",
    "github_project": "timedinput",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "appveyor": true,
    "lcname": "timedinput"
}
        
Elapsed time: 0.06254s