Metadata-Version: 2.1
Name: TimedInputPy
Version: 0.9
Summary: Implemenation of thread-based timed input object
Author-email: hero24 <hero24@interia.pl>
Project-URL: Homepage, https://github.com/hero24/TimedInputPy/
Project-URL: Issues, https://github.com/hero24/TimedInputPy/issues/
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.0
Description-Content-Type: text/markdown

# TimedInputPy

TimedInputPy is a python library that provides input function/object that has a
thread based time limit on input.

## API

|object|method|description|
|-----|-----|-----|
|TimedInput(timeout, prompt, default||Timed input reader:|
|||timeout -> how long to wait?|
|||prompt -> what to ask?|
|||default -> what to sat when timeout happens?|
||get_input()|Function to be used as input reader|
||read()|Reads the input from the reader|
|timed_input(timeout, prompt, default)|| Function for reading timed input, arguments same as above|

## Example usage
```
# Sample usage:
if __name__ == '__main__':
    test_timeout = 5
    test_prompt = 'Enter name: '
    test_default = 'world'

    # As a method
    s = timed_input(test_timeout, test_prompt, test_default)
    print('Hello {}!'.format(s), flush=True)

    print()

    # As a class
    s = TimedInput(test_timeout, test_prompt, test_default).read()
    print('Hello {}!'.format(s), flush=True)
```
