FastInput


NameFastInput JSON
Version 0.3 PyPI version JSON
download
home_pagehttps://github.com/alexwtz/fastInput
SummaryA package that wrap the input function with validation
upload_time2024-02-07 20:23:05
maintainer
docs_urlNone
authorAlexandre Wetzel
requires_python
licenseMIT
keywords input validation prompt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            **A Python library to simplify the input from user**

This library is a wrapper arround the input method. It allows to very the input according to the selected type, lower or upper bound provided.

*Instalation*

```
pip install FastInput
```

*Usage*
Asking for an integer value between 0 and 4:
```python
import FastInput as fi

yourChoice = fi.input_with_validation("Provide your id", InputType.INTEGER,False,0,4))
```
Asking for a string:
```python
import FastInput as fi

yourChoice = fi.input_with_validation("What is your name", InputType.STRING,False))
```
Asking for a user validation:
```python
import FastInput as fi

yourChoice = fi.input_for_confirmation("Do you agree?[Y/n]", True))
```
Asking for a choice in a list:
```python
import FastInput as fi

list=[1,2,"test",False]
yourChoice = input_within_list(list)
```

*Result*

```
$> python FastInput/fast_input.py
What is your user?

Your answer cannot be empty.
Alex
Provide your id
( >= 0 )
-1
Wrong choice. Please provide an answer >= 0
0
Provide your id2
( <= 10 )
12
Wrong choice. Please provide an answer <= 10
a
Wrong choice type. Please provide an answer of type : integer

Your answer cannot be empty.
5
Provide your id3 any integer
w
Wrong choice type. Please provide an answer of type : integer
123
InitForm(user='Alex', id=0, id2=5, id3=123)
Do you like this app?
Yes

Choose a value among : [1, 2, 'test', False]
4
Your choice is not in the list
Choose a value among : [1, 2, 'test', False]
Alex
Your choice is not in the list
Choose a value among : [1, 2, 'test', False]
test

Choose a value among :
  1. 1
  2. 2
  3. test
  4. True
( >= 1 and <= 4 )
1
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alexwtz/fastInput",
    "name": "FastInput",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "input,validation,prompt",
    "author": "Alexandre Wetzel",
    "author_email": "alexwtz@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2c/24/412a2ec17b6fd4d3efadb55877b502dbb72f631fab75253c6fd7a6ea09a3/FastInput-0.3.tar.gz",
    "platform": null,
    "description": "**A Python library to simplify the input from user**\n\nThis library is a wrapper arround the input method. It allows to very the input according to the selected type, lower or upper bound provided.\n\n*Instalation*\n\n```\npip install FastInput\n```\n\n*Usage*\nAsking for an integer value between 0 and 4:\n```python\nimport FastInput as fi\n\nyourChoice = fi.input_with_validation(\"Provide your id\", InputType.INTEGER,False,0,4))\n```\nAsking for a string:\n```python\nimport FastInput as fi\n\nyourChoice = fi.input_with_validation(\"What is your name\", InputType.STRING,False))\n```\nAsking for a user validation:\n```python\nimport FastInput as fi\n\nyourChoice = fi.input_for_confirmation(\"Do you agree?[Y/n]\", True))\n```\nAsking for a choice in a list:\n```python\nimport FastInput as fi\n\nlist=[1,2,\"test\",False]\nyourChoice = input_within_list(list)\n```\n\n*Result*\n\n```\n$> python FastInput/fast_input.py\nWhat is your user?\n\nYour answer cannot be empty.\nAlex\nProvide your id\n( >= 0 )\n-1\nWrong choice. Please provide an answer >= 0\n0\nProvide your id2\n( <= 10 )\n12\nWrong choice. Please provide an answer <= 10\na\nWrong choice type. Please provide an answer of type : integer\n\nYour answer cannot be empty.\n5\nProvide your id3 any integer\nw\nWrong choice type. Please provide an answer of type : integer\n123\nInitForm(user='Alex', id=0, id2=5, id3=123)\nDo you like this app?\nYes\n\nChoose a value among : [1, 2, 'test', False]\n4\nYour choice is not in the list\nChoose a value among : [1, 2, 'test', False]\nAlex\nYour choice is not in the list\nChoose a value among : [1, 2, 'test', False]\ntest\n\nChoose a value among :\n  1. 1\n  2. 2\n  3. test\n  4. True\n( >= 1 and <= 4 )\n1\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package that wrap the input function with validation",
    "version": "0.3",
    "project_urls": {
        "Download": "https://github.com/alexwtz/FastInput/archive/refs/tags/0.3.tar.gz",
        "Homepage": "https://github.com/alexwtz/fastInput"
    },
    "split_keywords": [
        "input",
        "validation",
        "prompt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c24412a2ec17b6fd4d3efadb55877b502dbb72f631fab75253c6fd7a6ea09a3",
                "md5": "f1a3353dc6b418c4e105db2208d7112f",
                "sha256": "9e1dc4dc7e599bc00ec224f8f77d68035caa74ab71d47d144fc700ca38f3f5a4"
            },
            "downloads": -1,
            "filename": "FastInput-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f1a3353dc6b418c4e105db2208d7112f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4924,
            "upload_time": "2024-02-07T20:23:05",
            "upload_time_iso_8601": "2024-02-07T20:23:05.820263Z",
            "url": "https://files.pythonhosted.org/packages/2c/24/412a2ec17b6fd4d3efadb55877b502dbb72f631fab75253c6fd7a6ea09a3/FastInput-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-07 20:23:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexwtz",
    "github_project": "fastInput",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fastinput"
}
        
Elapsed time: 0.17761s