Skip to main content

arb_launcher

arb_launcher is a Python package that provides a simple yet powerful way to launch and manage detached programs and methods. It allows you to run external programs or Python methods in a completely detached process, making them independent of the parent process.

Features

  • Launch external programs and Python methods as detached processes
  • Redirect the stdout and stderr of the detached process to specific files (/dev/null by default so that the output is never printed to the console)
  • Terminate matching processes based on their names and arguments
  • Fully daemonized processes, making them independent of the parent process and allowing them to run in the background

Installation

To install arb_launcher, simply clone the repository and run the following command:

pip install arb_launcher

Usage

arb_launcher provides a simple command-line interface for launching detached programs. You can also use it as a method or library in your Python projects.

Command-Line Interface

To use the command-line interface, simply run:

arb_launcher <program> [args] [--stdout <stdout_file>] [--stderr <stderr_file>]

Simplified Launch Method

The arb_launcher package also provides a simplified method, launch_detached, for quickly launching detached programs or methods:

from arb_launcher.launcher import launch_detached

launch_detached(target, args, stdout=None, stderr=None)

target can be either a string representing the command or a callable Python method.

args should be a list of arguments, if any.

stdout and stderr are optional parameters to redirect the output to specific files.

Example

Here's an example of how to use the simplified launch_detached method to launch a detached Python method:

from arb_launcher.launcher import launch_detached

def my_method(arg1, arg2):
    # Your code here

launch_detached(my_method, args=['arg1', 'arg2'], stdout='output.log', stderr='error.log')

Python API

To use the arb_launcher package in your Python project, first import the ProgramHandler class:

from arb_launcher.program_handler import ProgramHandler

Then, create a ProgramHandler object and call the launch() method:

handler = ProgramHandler(target, args, stdout, stderr)
handler.launch()

target can be either a string representing the command or a callable Python method.

args should be a list of arguments, if any.

stdout and stderr are optional parameters to redirect the output to specific files.

Example

Here's an example of how to use the arb_launcher package to launch a detached Python method:

from arb_launcher.program_handler import ProgramHandler

def my_method(arg1, arg2):
    # Your code here

handler = ProgramHandler(my_method, args=['arg1', 'arg2'], stdout='output.log', stderr='error.log')
handler.launch()

Metadata

Release files for arb-launcher 1.1.0

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

Source distribution (sdist)

Source distribution for arb-launcher 1.1.0
File Size Uploaded Provenance Actions
arb_launcher-1.1.0.tar.gz 3.9 kB Without provenance Details for arb_launcher-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for arb-launcher 1.1.0
File Interpreter ABI Platform Actions
arb_launcher-1.1.0-py3-none-any.whl Python 3 none any Details for arb_launcher-1.1.0-py3-none-any.whl

Total release size: 8.6 kB

Release files / arb_launcher-1.1.0.tar.gz

Download URL arb_launcher-1.1.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
864afbbb37981bf0231a24bdc784ea9b1c9634e081fff0420723e9c32d91f6ca
BLAKE2b-256 checksum
How to use checksums
8a840bf750dd3a017bd1bd736bbc32239537423343077c0e50fd3a9aca437d3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / arb_launcher-1.1.0-py3-none-any.whl

Download URL arb_launcher-1.1.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
332693dc1bca85ca4eb6bab8f6e7772c9d9ae610061327dc37a5064eb910d01d
BLAKE2b-256 checksum
How to use checksums
c102ec07eba89d5f027c7b1b09a9494793874438b1922a40376959d6804b4e8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Security for arb-launcher 1.1.0

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.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

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