{"id":14977174,"url":"https://github.com/sngjuk/argparse-to-class","last_synced_at":"2025-07-06T05:39:12.057Z","repository":{"id":129457871,"uuid":"102097301","full_name":"sngjuk/argparse-to-class","owner":"sngjuk","description":"Transform argparse into class format for Jupyter Notebook execution","archived":false,"fork":false,"pushed_at":"2021-02-17T18:39:32.000Z","size":116,"stargazers_count":21,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-07T23:07:01.948Z","etag":null,"topics":["argparse","argument-parser","arguments","ipython-notebook","jupyter","jupyter-notebook"],"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/sngjuk.png","metadata":{"files":{"readme":"README.md","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":"2017-09-01T09:30:13.000Z","updated_at":"2024-05-31T01:20:54.000Z","dependencies_parsed_at":"2023-04-08T06:47:04.081Z","dependency_job_id":null,"html_url":"https://github.com/sngjuk/argparse-to-class","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sngjuk/argparse-to-class","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sngjuk%2Fargparse-to-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sngjuk%2Fargparse-to-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sngjuk%2Fargparse-to-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sngjuk%2Fargparse-to-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sngjuk","download_url":"https://codeload.github.com/sngjuk/argparse-to-class/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sngjuk%2Fargparse-to-class/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263855232,"owners_count":23520447,"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","argument-parser","arguments","ipython-notebook","jupyter","jupyter-notebook"],"created_at":"2024-09-24T13:55:14.656Z","updated_at":"2025-07-06T05:39:12.006Z","avatar_url":"https://github.com/sngjuk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Argparse2class for Jupyter execution.\n\nArgparse transformation for Jupyter Notebook execution. (for quick testing in .ipynb)\u003cbr /\u003e\nCopy \u0026 paste class-formatted arguments to replace argparse. \u003cbr/\u003e\n\n\u003cb\u003eNotice!\u003c/b\u003e It's better to use ```args = parser.parse_args(args=[])``` syntax - \u003ca href=\"https://stackoverflow.com/a/47587545/3618853\"\u003ehttps://stackoverflow.com/a/47587545/3618853\u003c/a\u003e\u003cbr\u003e\n\n### quick web transformation :\nhttp://35.192.144.192:8000/arg2cls.html\n\n### usage : \n```\npython3 arg2cls.py [target.py] [target2.py(optional)] ...\n```\n\n### make argument parser into-\n```\nparser = argparse.ArgumentParser(description='PyTorch PennTreeBank RNN/LSTM Language Model')\nparser.add_argument('--data', type=str, default='./data/penn',\n                    help='location of the data corpus')\nparser.add_argument('--model', type=str, default='LSTM',\n                    help='type of recurrent net (RNN_TANH, RNN_RELU, LSTM, GRU)')\nparser.add_argument('--emsize', type=int, default=200,\n                    help='size of word embeddings')\nparser.add_argument('--nhid', type=int, default=200,\n                    help='number of hidden units per layer')\n```\n### class format\n```\nclass args:\n    data = './data/penn'\n    model = 'LSTM'\n    emsize = 200\n    nhid = 200\n```\n\n### input (argparse lines) :\n\n![alt text](http://pds27.egloos.com/pds/201709/01/00/c0134200_59a941fb9501e.png)\n\n\n### ouput (args class) :\n\n![alt text](http://thumbnail.egloos.net/600x0/http://pds25.egloos.com/pds/201709/01/00/c0134200_59a936974c78f.png)\n\n\n### transformed usage : \nIf there's no default value for argument, It will have warning value. (###manual_setting_required###)\n\n![alt text](http://pds21.egloos.com/pds/201709/01/00/c0134200_59a937f65f737.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsngjuk%2Fargparse-to-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsngjuk%2Fargparse-to-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsngjuk%2Fargparse-to-class/lists"}