easyio


Nameeasyio JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryEasy-to-use input and output functions
upload_time2023-03-29 02:30:27
maintainer
docs_urlNone
author
requires_python>=3
licenseCopyright 2022 Casey Devet 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 output io
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # EasyIO

This module provides easy-to-use functions for input and output in Python.

## Installation

```
pip install easyio
```

## Usage

This package is meant to supplement the IO functions built in to python for beginner programmers.

We recommend that you import using `import *` to add the functions to the global namespace:

```
from easyio import *
```

NOTE: When importing using `import *`, the built-in `input()` function will be overwritten with the `input()` function from this 
package.

### Input

The following functions are provided to aid in user input:

```
input(prompt=None, /, *, sep=' ', file=None, type=<class 'str'>)
    Read a line of input.
    
    The prompt string, if given, is printed to the console 
    before reading input.
    
    The sep parameter, which defaults to a single space is 
    what is printed after the prompt, but before the input 
    is retrieved.  If no prompt is given, this is not 
    printed.
    
    The file can be any file-like object that has a 
    .readline() method.  If no file is given, input is 
    retrieved from the standard input stream (stuff typed 
    into the console).  If a file is given, the prompt and 
    sep are not printed.
    
    The input value can be converted to any type using the 
    type parameter.  This needs to be a function that takes 
    a string and converts it to the desired type (e.g. int, 
    float, number, etc.)

inputs(prompt=None, /, **kwargs)
    Read multiple lines of input.  You can specify quant
    as the number you want to read.  If quant is not given
    the function will keep reading inputs until a blank line
    if input.
    
    The prompt string, if given, is printed to the console 
    before reading each line of input.
    
    Any keyword arguments (e.g. file, sep, type) will be
    forwarded to the input() function.
    
    When reading from a file, the end of the inputs is the
    end of the file, not a blank line.
```

### Output

The following functions are provided to aid in output to the user:

```
error(message, status=0)
    Print an error message to the console and end the 
    program.
    
    An optional status code can be provided.
```

### Types

The following functions are provided to convert strings to other useful types.  These are meant to be used as the `type` argument for the `input()` function.

```
nat(value)
    Convert to a natural number (1, 2, 3, ...).
    
    If the value is a natural number, the result will
    be an int object.  If given a numerical value with 
    decimals, it will be truncated (rounded towards 0).  
    If the value is not a natural number there will be 
    an error.

number(value)
    Convert to a numerical value.
    
    Whole numbers will be returned as int objects and 
    decimal numbers will be returned as float objects.

positive(value)
    Convert to a positive number.
    
    Whole numbers will be returned as int objects and 
    decimal numbers will be returned as float objects.

whole(value)
    Convert to a whole number (0, 1, 2, 3, ...).
    
    If the value is a natural number, the result will
    be an int object.  If given a numerical value with 
    decimals, it will be truncated (rounded towards 0).  
    If the value is not a natural number there will be 
    an error.
```

## License

This package is licensed under the MIT License, making it free for you to use, change and profit from.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "easyio",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "",
    "keywords": "input,output,io",
    "author": "",
    "author_email": "Casey Devet <cjdevet@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ed/c6/e131fedff4a4da4e1336cd5093b2ef741ed360e15262359a0bbb51472dde/easyio-0.1.3.tar.gz",
    "platform": null,
    "description": "# EasyIO\n\nThis module provides easy-to-use functions for input and output in Python.\n\n## Installation\n\n```\npip install easyio\n```\n\n## Usage\n\nThis package is meant to supplement the IO functions built in to python for beginner programmers.\n\nWe recommend that you import using `import *` to add the functions to the global namespace:\n\n```\nfrom easyio import *\n```\n\nNOTE: When importing using `import *`, the built-in `input()` function will be overwritten with the `input()` function from this \npackage.\n\n### Input\n\nThe following functions are provided to aid in user input:\n\n```\ninput(prompt=None, /, *, sep=' ', file=None, type=<class 'str'>)\n    Read a line of input.\n    \n    The prompt string, if given, is printed to the console \n    before reading input.\n    \n    The sep parameter, which defaults to a single space is \n    what is printed after the prompt, but before the input \n    is retrieved.  If no prompt is given, this is not \n    printed.\n    \n    The file can be any file-like object that has a \n    .readline() method.  If no file is given, input is \n    retrieved from the standard input stream (stuff typed \n    into the console).  If a file is given, the prompt and \n    sep are not printed.\n    \n    The input value can be converted to any type using the \n    type parameter.  This needs to be a function that takes \n    a string and converts it to the desired type (e.g. int, \n    float, number, etc.)\n\ninputs(prompt=None, /, **kwargs)\n    Read multiple lines of input.  You can specify quant\n    as the number you want to read.  If quant is not given\n    the function will keep reading inputs until a blank line\n    if input.\n    \n    The prompt string, if given, is printed to the console \n    before reading each line of input.\n    \n    Any keyword arguments (e.g. file, sep, type) will be\n    forwarded to the input() function.\n    \n    When reading from a file, the end of the inputs is the\n    end of the file, not a blank line.\n```\n\n### Output\n\nThe following functions are provided to aid in output to the user:\n\n```\nerror(message, status=0)\n    Print an error message to the console and end the \n    program.\n    \n    An optional status code can be provided.\n```\n\n### Types\n\nThe following functions are provided to convert strings to other useful types.  These are meant to be used as the `type` argument for the `input()` function.\n\n```\nnat(value)\n    Convert to a natural number (1, 2, 3, ...).\n    \n    If the value is a natural number, the result will\n    be an int object.  If given a numerical value with \n    decimals, it will be truncated (rounded towards 0).  \n    If the value is not a natural number there will be \n    an error.\n\nnumber(value)\n    Convert to a numerical value.\n    \n    Whole numbers will be returned as int objects and \n    decimal numbers will be returned as float objects.\n\npositive(value)\n    Convert to a positive number.\n    \n    Whole numbers will be returned as int objects and \n    decimal numbers will be returned as float objects.\n\nwhole(value)\n    Convert to a whole number (0, 1, 2, 3, ...).\n    \n    If the value is a natural number, the result will\n    be an int object.  If given a numerical value with \n    decimals, it will be truncated (rounded towards 0).  \n    If the value is not a natural number there will be \n    an error.\n```\n\n## License\n\nThis package is licensed under the MIT License, making it free for you to use, change and profit from.\n",
    "bugtrack_url": null,
    "license": "Copyright 2022 Casey Devet 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": "Easy-to-use input and output functions",
    "version": "0.1.3",
    "split_keywords": [
        "input",
        "output",
        "io"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "003c81b815546053903532735dbc7fc4eb2f48f9440b7b2b54bbb04d872d4195",
                "md5": "51f6a7acded595e634b09ceb9b3eba71",
                "sha256": "9ad4d9cae42f073f84482d536085ac0b94c4270a43c6af0a22a5306db988a563"
            },
            "downloads": -1,
            "filename": "easyio-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "51f6a7acded595e634b09ceb9b3eba71",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 9151,
            "upload_time": "2023-03-29T02:30:25",
            "upload_time_iso_8601": "2023-03-29T02:30:25.659845Z",
            "url": "https://files.pythonhosted.org/packages/00/3c/81b815546053903532735dbc7fc4eb2f48f9440b7b2b54bbb04d872d4195/easyio-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "edc6e131fedff4a4da4e1336cd5093b2ef741ed360e15262359a0bbb51472dde",
                "md5": "6503e5a7347d8050571da5d23b5638f4",
                "sha256": "9e0ca9e2c68f775f9c886693d3ffae9f1decfcf05860daf1fe661cfeb6272613"
            },
            "downloads": -1,
            "filename": "easyio-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "6503e5a7347d8050571da5d23b5638f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 5074,
            "upload_time": "2023-03-29T02:30:27",
            "upload_time_iso_8601": "2023-03-29T02:30:27.693492Z",
            "url": "https://files.pythonhosted.org/packages/ed/c6/e131fedff4a4da4e1336cd5093b2ef741ed360e15262359a0bbb51472dde/easyio-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-29 02:30:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "easyio"
}
        
Elapsed time: 0.11096s