Exit Codes
This package is a cross-operating-system compatible version of the os library's EX_* constants.
If these constants are available, they will be re-exported directly from os, otherwise the integer version will be provided from this library.
This library also provides an enum version of the exit codes, if that is of value.
Apologies for the weird PyPi name, they're a bit overly restrictive and don't point to what specifically is the conflicting package.
Installation
python -m pip install -U os-exitcodes
Usage
Constants
from os_exitcodes import (
EX_OK,
EX_USAGE,
)
from random import choice
def is_valid_usage() -> bool:
# check if the user is using this properly
# for a working example, this is random
return choice([True, False])
def main() -> None:
invalid_usage = random
if not is_valid_usage():
raise SystemExit(EX_USAGE)
raise SystemExit(EX_OK)
if __name__ == "__main__":
main()
Enumeration
from os_exitcodes import ExitCode
from random import choice
def is_valid_usage() -> bool:
# check if the user is using this properly
# for a working example, this is random
return choice([True, False])
def main() -> None:
invalid_usage = random
if not is_valid_usage():
raise SystemExit(ExitCode.EX_USAGE)
raise SystemExit(ExitCode.EX_OK)
if __name__ == "__main__":
main()
Metadata
Release files for os-exitcodes 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| os_exitcodes-1.0.1.tar.gz | 4.7 kB | Without provenance | Details for os_exitcodes-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| os_exitcodes-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for os_exitcodes-1.0.1-py3-none-any.whl |
Total release size: 10.5 kB
Release files / os_exitcodes-1.0.1.tar.gz
| Download URL | os_exitcodes-1.0.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b3c8dcd1acf4fc0f1549b7259d0071e0f7d0bfc3d9e0754a49b884d80f2e32e
|
|
BLAKE2b-256 checksum How to use checksums |
6d8bec0199561ff560b219742e235b7caec76b7aa21f571f5b6892732e9e30bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.6 Darwin/21.6.0
|
Release files / os_exitcodes-1.0.1-py3-none-any.whl
| Download URL | os_exitcodes-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
959398824a4e15d019a4bebd1404f4801c311ddfc67fc1a8561a1d4dcc6a79ff
|
|
BLAKE2b-256 checksum How to use checksums |
7fdea3ff60f849f298353275b69e85fa07bf908c145f08409366c96df85bda1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.6 Darwin/21.6.0
|
Security for os-exitcodes 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.