{"id":21849083,"url":"https://github.com/wils0ns/oi","last_synced_at":"2025-03-21T17:41:50.294Z","repository":{"id":91975256,"uuid":"105940340","full_name":"wils0ns/oi","owner":"wils0ns","description":"Command line parser for python applications.","archived":false,"fork":false,"pushed_at":"2020-08-28T08:33:29.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T12:41:34.139Z","etag":null,"topics":["argparse","cli","parser","python"],"latest_commit_sha":null,"homepage":"","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/wils0ns.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-10-05T21:05:17.000Z","updated_at":"2023-02-15T20:15:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"695658a5-5b8c-4e50-ac55-63fbaeb31c04","html_url":"https://github.com/wils0ns/oi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Foi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Foi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Foi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Foi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wils0ns","download_url":"https://codeload.github.com/wils0ns/oi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244842496,"owners_count":20519629,"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":["argparse","cli","parser","python"],"created_at":"2024-11-28T00:10:43.075Z","updated_at":"2025-03-21T17:41:50.263Z","avatar_url":"https://github.com/wils0ns.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Oi - Simple command-line interface parser.\n==========================================\n\nThis small python package implements a simple object-oriented layer on top of python's `argparse \u003chttps://docs.python.org/2/library/argparse.html\u003e`_,\noffering a more intuitive and easier way to build command-line interfaces.\n\nQuick Start\n-----------\n\nInstalling Oi package.\n~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: bash\n\n    pip install oicli\n\nUsage example\n~~~~~~~~~~~~~\n\nGiven the commands bellow:\n\n.. code-block:: bash\n\n    $ myapp user list\n    $ myapp user add --name Wilson --email wilson@codeminus.org\n\nThe parser would look like this:\n\n.. code-block:: python\n\n    import oi\n\n    app = oi.App('myapp')\n    user_cmd = oi.Command(app, 'user')\n\n    user_list_cmd = oi.Command(user_cmd, 'list')\n\n    user_add_cmd = oi.Command(user_cmd, 'add')\n    user_add_cmd.add_argument('--name')\n    user_add_cmd.add_argument('--email')\n\n    print(app.parse_args())\n\nRunning the application with the code above:\n\n.. code-block:: bash\n\n    $ myapp user\n    Namespace(command='user')\n\n.. code-block:: bash\n\n    $ myapp user list\n    Namespace(command='user_list')\n\n.. code-block:: bash\n\n    $ myapp user add --name Wilson --email wilson@codeminus.org\n    Namespace(command='user_add', email='wilson@codeminus.org', name='Wilson')\n\n\nNotice the **command** attribute of the Namespace.\nIt correspond to the name of the command invoked.\nThe sub-command name is appended to its parent command to ensure a unique identifier is created.\n\nWhat does \"Oi\" mean? Well... What does it mean to you? Try the `wiki \u003chttps://en.wikipedia.org/wiki/Oi_(interjection)\u003e`_.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwils0ns%2Foi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwils0ns%2Foi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwils0ns%2Foi/lists"}