{"id":21486369,"url":"https://github.com/dnknth/basecmd","last_synced_at":"2025-07-24T10:37:05.057Z","repository":{"id":57710350,"uuid":"511906816","full_name":"dnknth/basecmd","owner":"dnknth","description":"Logging boilerplate for command line programs in Python","archived":false,"fork":false,"pushed_at":"2025-05-07T21:27:23.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-16T23:29:05.536Z","etag":null,"topics":["command-line","logging","python3"],"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/dnknth.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2022-07-08T13:33:45.000Z","updated_at":"2025-05-07T21:27:26.000Z","dependencies_parsed_at":"2025-05-07T22:24:32.610Z","dependency_job_id":"fb946100-3a22-4123-a382-253ec8753106","html_url":"https://github.com/dnknth/basecmd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dnknth/basecmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fbasecmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fbasecmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fbasecmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fbasecmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnknth","download_url":"https://codeload.github.com/dnknth/basecmd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fbasecmd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266828745,"owners_count":23991220,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["command-line","logging","python3"],"created_at":"2024-11-23T13:20:34.937Z","updated_at":"2025-07-24T10:37:05.008Z","avatar_url":"https://github.com/dnknth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# basecmd\n\nBoilerplate for the command line.\n\nClasses inheriting from `BaseCmd` have a `self.log` attribute\nthat is a standard Python logger. A basic logging configuration to `sys.stdout`\nis provided.\n\nFor command line options controlling the logging verbosity\nand output to a log file, call the command with `-h` or `--help`.\n\nDefaults for logging options can be also provided as environment variables\nor in a `.emv` file:\n\n* `LOG_LEVEL`: the logging verbosity, one of `error`, `warn`, `info`, or `debug`; default: `info`.\n' `LOG_FILE`: path to a log file, defaults to the standard output for easy redirection.\n* `LOG_FORMAT`: a standard Python logging format, defaults to `%(asctime).19s  %(message)s` when logging to a file or a terminal and `%(message)s` otherwise.\n\nWhen logging to a terminal, the output is colored by log level.\n\n## Example usage\n\n```python\nfrom basecmd import BaseCmd\n\nclass MyCmd(BaseCmd):\n\n    def add_arguments(self):\n        self.parser.add_argument('--foo',\n            help='Custom command line option')\n\n    def __call__(self):\n        self.log.debug(self.options.foo)\n\nif __name__ == '__main__':\n    cmd = MyCmd\n    cmd()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnknth%2Fbasecmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnknth%2Fbasecmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnknth%2Fbasecmd/lists"}