{"id":15905945,"url":"https://github.com/lucacappelletti94/userinput","last_synced_at":"2025-03-21T11:32:07.103Z","repository":{"id":43774230,"uuid":"190447048","full_name":"LucaCappelletti94/userinput","owner":"LucaCappelletti94","description":"Simple python package to handle cli user input.","archived":false,"fork":false,"pushed_at":"2023-12-07T17:58:56.000Z","size":203,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-01T15:42:44.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LucaCappelletti94.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-05T18:23:53.000Z","updated_at":"2021-11-18T09:46:59.000Z","dependencies_parsed_at":"2023-12-07T18:52:52.272Z","dependency_job_id":null,"html_url":"https://github.com/LucaCappelletti94/userinput","commit_stats":{"total_commits":67,"total_committers":1,"mean_commits":67.0,"dds":0.0,"last_synced_commit":"dfdad6e174c7c16ad8ba4e79be098f0b422ab2c0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fuserinput","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fuserinput/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fuserinput/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucaCappelletti94%2Fuserinput/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LucaCappelletti94","download_url":"https://codeload.github.com/LucaCappelletti94/userinput/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244791006,"owners_count":20510849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T13:20:19.411Z","updated_at":"2025-03-21T11:32:06.824Z","avatar_url":"https://github.com/LucaCappelletti94.png","language":"Python","readme":"Userinput\n=========================================================================================\n|pip| |downloads|\n\nSimple python package to handle CLI user input.\n\nHow do I install this package?\n----------------------------------------------\nAs usual, just download it using pip:\n\n.. code:: shell\n\n    pip install userinput\n\n\nAvailable validators\n----------------------------------------------\nSome commonly used validators are available with the package.\n\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| Validator name    | Description                                                                                           |\n+===================+=======================================================================================================+\n| email             | Check if given input string is a valid email.                                                         |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| version_code      | Check if given input string is a valid version code.                                                  |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| url               | Check if given input string is a valid URL. Does not check if given URL is online.                    |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| human_bool        | Check if given input string is a human Boolean, such as \"yes\", \"y\", \"true\", \"si\", \"no\", \"n\", \"false\". |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| integer           | Check if given input string is a integer numeric value.                                               |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| positive_integer  | Check if given input string  is a positive integer numeric value.                                     |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| non_empty         | Check if given input string is not empty.                                                             |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| hostname          | Check if given input string is a reachable host name.                                                 |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| ip                | Check if given input string is a reachable IP address.                                                |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n\nUse them as follows:\n\n.. code:: python\n\n    from userinput import userinput\n\n    result = userinput(\n        \"my_label\",\n        validator=\"validator name goes here\"\n    )\n\nYou can also chain validators.\nThey will be called in the order you provide.\n\n.. code:: python\n\n    from userinput import userinput\n\n    result = userinput(\n        \"my_label\",\n        validator=[\n            \"validator name goes here\",\n            my_custom_validation_function\n        ]\n    )\n\n\nAvailable sanitizers\n-----------------------------------------------\nSome commonly used sanitizers are available with the package.\n\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| Validator name    | Description                                                                                           |\n+===================+=======================================================================================================+\n| human_bool        | Cast human Boolean specified above in validators to python Booleans.                                  |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n| strip             | Remove padding spaces and repeated spaces.                                                            |\n+-------------------+-------------------------------------------------------------------------------------------------------+\n\nUse them as follows:\n\n.. code:: python\n\n    from userinput import userinput\n\n    result = userinput(\n        \"my_label\",\n        sanitizer=\"sanitizer name goes here\"\n    )\n\nYou can also chain sanitizers.\nThey will be called in the order you provide.\n\n.. code:: python\n\n    from userinput import userinput\n\n    result = userinput(\n        \"my_label\",\n        sanitizer=[\n            \"sanitizer name goes here\",\n            my_custom_sanitification_function\n        ]\n    )\n\n\n.. |pip| image:: https://badge.fury.io/py/userinput.svg\n    :target: https://badge.fury.io/py/userinput\n    :alt: Pypi project\n\n.. |downloads| image:: https://pepy.tech/badge/userinput\n    :target: https://pepy.tech/badge/userinput\n    :alt: Pypi total project downloads ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacappelletti94%2Fuserinput","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucacappelletti94%2Fuserinput","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacappelletti94%2Fuserinput/lists"}