{"id":20598339,"url":"https://github.com/kkirsche/os-exitcodes","last_synced_at":"2026-04-21T14:04:41.070Z","repository":{"id":56843351,"uuid":"526267082","full_name":"kkirsche/os-exitcodes","owner":"kkirsche","description":"Cross OS exit codes","archived":false,"fork":false,"pushed_at":"2022-08-18T15:39:16.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-16T18:48:02.592Z","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/kkirsche.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}},"created_at":"2022-08-18T15:25:21.000Z","updated_at":"2024-04-18T18:02:27.000Z","dependencies_parsed_at":"2022-09-09T02:32:14.421Z","dependency_job_id":null,"html_url":"https://github.com/kkirsche/os-exitcodes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkirsche%2Fos-exitcodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkirsche%2Fos-exitcodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkirsche%2Fos-exitcodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkirsche%2Fos-exitcodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kkirsche","download_url":"https://codeload.github.com/kkirsche/os-exitcodes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242232795,"owners_count":20093875,"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-11-16T08:26:23.102Z","updated_at":"2026-04-21T14:04:41.034Z","avatar_url":"https://github.com/kkirsche.png","language":"Python","readme":"# Exit Codes\n\nThis package is a cross-operating-system compatible version of the `os` library's EX\\_\\* constants.\n\nIf these constants are available, they will be re-exported directly from `os`, otherwise the integer version will be provided from this library.\n\nThis library also provides an enum version of the exit codes, if that is of value.\n\nApologies for the weird PyPi name, they're a bit overly restrictive and don't point to what specifically is the conflicting package.\n\n## Installation\n\n```shell\npython -m pip install -U os-exitcodes\n```\n\n## Usage\n\n### Constants\n\n```python\nfrom os_exitcodes import (\n    EX_OK,\n    EX_USAGE,\n)\nfrom random import choice\n\ndef is_valid_usage() -\u003e bool:\n    # check if the user is using this properly\n    # for a working example, this is random\n    return choice([True, False])\n\ndef main() -\u003e None:\n    invalid_usage = random\n    if not is_valid_usage():\n        raise SystemExit(EX_USAGE)\n    raise SystemExit(EX_OK)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Enumeration\n\n```python\nfrom os_exitcodes import ExitCode\nfrom random import choice\n\ndef is_valid_usage() -\u003e bool:\n    # check if the user is using this properly\n    # for a working example, this is random\n    return choice([True, False])\n\ndef main() -\u003e None:\n    invalid_usage = random\n    if not is_valid_usage():\n        raise SystemExit(ExitCode.EX_USAGE)\n    raise SystemExit(ExitCode.EX_OK)\n\nif __name__ == \"__main__\":\n    main()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkirsche%2Fos-exitcodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkkirsche%2Fos-exitcodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkirsche%2Fos-exitcodes/lists"}