Skip to main content

Test Coverage Stable Version Pre-release Version PyPI - Python Version PyPI Downloads

app-runtime

This project provides cross-platform tools for handling the context of a Python application, including getting system, user and application info.

Example

from runtime.application import (
    get_main_module_name, get_application_path, hook_terminate,
    is_interactive, is_python_shell, single_instance,
    SingleInstanceException, TerminateException
)
from runtime.user import get_username, is_elevated

hook_terminate()
username = get_username()
module = get_main_module_name()
app_path = get_application_path()
interactive = is_interactive()
is_shell = is_python_shell()

def output(line: str):
    if interactive:
        print(line)

try:
    with single_instance():
        try:
            output(f"Hello {'admin ' if is_elevated() else ''}{username}, this is {module} located in {app_path}")
            output(f"I can tell that you're{' not' if not is_shell else ''} running this script in a python shell")
        except TerminateException:
            output(f"Bye {username}")
        except:
            output("An unexpected error ocurred")
except SingleInstanceException:
    output("Another instance of this application is already running!")

Full documentation

Go to documentation

Metadata

Release files for app-runtime 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for app-runtime 0.0.2
File Size Uploaded Provenance Actions
app_runtime-0.0.2.tar.gz 13.2 kB With provenance Details for app_runtime-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for app-runtime 0.0.2
File Interpreter ABI Platform Actions
app_runtime-0.0.2-py3-none-any.whl Python 3 none any Details for app_runtime-0.0.2-py3-none-any.whl

Total release size: 30.0 kB

Release files / app_runtime-0.0.2.tar.gz

Download URL app_runtime-0.0.2.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4378d1ef1f73d0894e29091db637b2b85fc7e62192918a8b6e2a0ba45270f41a
BLAKE2b-256 checksum
How to use checksums
8b75cbbfd6539eb3667827e4cd73d13d1650c129ef6e2cbd5f031d3d4f773b05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / app_runtime-0.0.2-py3-none-any.whl

Download URL app_runtime-0.0.2-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
828ee43a86bfbf852b83393c2f54868d86f59ebad1bcc6e8b60931cdbae7ebf9
BLAKE2b-256 checksum
How to use checksums
12d2d2f8bdc02cf7edbed19fe6e9c46c43d554e1c68ef2f42ca9b9565b69f509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for app-runtime 0.0.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for app_runtime-0.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page