{"id":16820603,"url":"https://github.com/op/argcmd","last_synced_at":"2025-03-17T15:25:51.018Z","repository":{"id":1263599,"uuid":"1202545","full_name":"op/argcmd","owner":"op","description":"Library for easy creation of Python scripts together with argparse","archived":false,"fork":false,"pushed_at":"2011-03-25T04:28:05.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T01:43:14.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/op.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-28T08:56:37.000Z","updated_at":"2013-12-16T02:30:10.000Z","dependencies_parsed_at":"2022-07-18T21:34:32.898Z","dependency_job_id":null,"html_url":"https://github.com/op/argcmd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/op%2Fargcmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/op%2Fargcmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/op%2Fargcmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/op%2Fargcmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/op","download_url":"https://codeload.github.com/op/argcmd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056687,"owners_count":20390773,"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-13T10:57:27.240Z","updated_at":"2025-03-17T15:25:50.997Z","avatar_url":"https://github.com/op.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"argcmd\n======\n\nEasy sub-command program creation with argument parsing and interactive shell.\n\nTogether with the power of `argparse`_, this small library removes most of the\nboiler plate you often write when you need to create python programs. It\ngathers all commands from one module and presents them as sub-commands, similar\nto eg. git.\n\nIt also comes with an optional interactive shell. When your program is run\nwithout any specific sub-command, a readline based shell is started which\nhas simple command completion and history (currently via ``--enable-history``).\nThink of eg. gdb.\n\n.. _argparse: http://code.google.com/p/argparse/\n\nUsage\n-----\n\nThere are two ways of creating programs. First way is by prefixing the method\nnames with ``cmd_`` or registering them with the ``@command``-decorator.\n\nSecond way is by subclassing the ``ArgCommand`` class. The advantage with this\nway is that you will have a unified way to setup and teardown your class\nthrough callbacks.\n\nArguments can be added both using a function, either prefixed ``args_`` or\nadded as argument to the ``@command``-decorator, -- or you can use the\n``@argument``-decorator. A small sample::\n\n    import argcmd\n\n    class Example(argcmd.ArgCmd):\n        def start(self):\n            self.calls = 0\n\n        def stop(self):\n            print 'called:', self.calls\n\n        @argcmd.argument('arg', help='arg help')\n        def bar(self, args):\n            self.calls += 1\n            print 'arg:', args.arg\n\n    if __name__ == '__main__':\n        argcmd.main()\n\nIf this command is run via the interactive shell, the counter will increase\nfor each call.\n\nSee examples for more information. For information about the parser, please\nsee argparse.\n\nRelated\n-------\n\nIf this library is not for you, don't worry. Many great projects by great\npeople exists with similar goals as this one.\n\n* https://github.com/anandology/subcommand/\n* https://github.com/simonw/optfunc/\n* http://code.google.com/p/cmdln/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fop%2Fargcmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fop%2Fargcmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fop%2Fargcmd/lists"}