onboot


Nameonboot JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryCross-platform autostart installer library for Python
upload_time2025-10-21 23:22:32
maintainernbdy
docs_urlNone
authornbdy
requires_python>=3.8
licenseMIT License
keywords autostart boot cross-platform persistence startup
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🚀 onboot

[![PyPI version](https://badge.fury.io/py/onboot.svg)](https://badge.fury.io/py/onboot)
[![Python Support](https://img.shields.io/pypi/pyversions/onboot.svg)](https://pypi.org/project/onboot/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

> Cross-platform autostart installer library for Python

**onboot** provides a unified interface to install and manage autostart entries across different operating systems and initialization methods. Whether you need to configure startup scripts on Linux, launch agents on macOS, or registry entries on Windows, onboot has you covered.

---

## ✨ Features

### 🐧 Linux
- ✅ **XDG** - XDG Autostart standard
- ✅ **Cron** - Cron jobs (@reboot)
- ✅ **Profile.d** - Shell profile scripts
- ✅ **KDE Plasma** - KDE autostart
- ✅ **Init.d** - System V init scripts

### 🍎 macOS (Darwin)
- ✅ **PList** - Launch Agents/Daemons
- ✅ **Cron** - Cron jobs (@reboot)

### 🪟 Windows
- ✅ **StartMenu** - Startup folder
- ✅ **Registry** - Windows Registry
  - ✅ HKCU (Current User)
  - ✅ HKLM (Local Machine)
  - ⏳ IFEO (Image File Execution Options)
  - ⏳ UserInit (Winlogon)
- ✅ **Task Scheduler** - Windows Task Scheduler
- ⏳ **WMIC** - Windows Management Instrumentation

---

## 📦 Installation

Install onboot using pip:

```bash
pip install onboot
```

Or with [uv](https://github.com/astral-sh/uv):

```bash
uv add onboot
```

---

## 🔧 Usage

### Quick Start - Auto-detect Best Installer

Let onboot automatically try all available installers for your operating system:

```python
from onboot import install_linux, InstallerConfiguration

# Create configuration
config = InstallerConfiguration("/home/user/myapp", "myapp")

# Install - tries all available installers until one succeeds
install_successful, used_installer = install_linux(config)

# Uninstall using the same installer
if install_successful:
    used_installer.uninstall()
```

### Platform-Specific Functions

```python
from onboot import install_windows, install_darwin, InstallerConfiguration

# Windows
success, installer = install_windows(InstallerConfiguration("C:\\myapp", "myapp"))

# macOS
success, installer = install_darwin(InstallerConfiguration("/Users/user/myapp", "myapp"))
```

### Use a Specific Installer

For more control, use a specific installer directly:

```python
from onboot.windows import HKCUInstaller
from onboot import InstallerConfiguration

# Create configuration
config = InstallerConfiguration("C:\\myapp", "myapp")

# Use Windows Registry (HKCU) installer
installer = HKCUInstaller(config)
installer.install()

# Later, uninstall
installer.uninstall()
```

### Available Installers by Platform

**Linux:**
```python
from onboot.linux import (
    XDGInstaller,              # XDG autostart (.desktop files)
    CrontabInstaller,          # Crontab @reboot
    ProfileInstaller,          # /etc/profile.d/
    KDEPlasmaInstaller,        # KDE Plasma autostart scripts
    InitInstaller,             # /etc/init.d/
    SystemdUserInstaller,      # ~/.config/systemd/user/ services
    SystemdSystemInstaller,    # /etc/systemd/system/ services
    BashrcInstaller,           # ~/.bashrc
    RcLocalInstaller           # /etc/rc.local
)
```

**macOS:**
```python
from onboot.darwin import (
    PListInstaller,            # ~/Library/LaunchAgents/
    LaunchDaemonInstaller,     # /Library/LaunchDaemons/ (system-wide)
    ProfileInstaller           # /etc/profile
)
```

**Windows:**
```python
from onboot.windows import (
    HKCUInstaller,             # HKEY_CURRENT_USER registry
    HKLMInstaller,             # HKEY_LOCAL_MACHINE registry
    StartMenuInstaller,        # Start Menu startup folder
    SchTaskInstaller,          # Task Scheduler
    UserInitInstaller          # Winlogon UserInit
)
```

---

## 📝 Configuration

The `InstallerConfiguration` class accepts the following parameters:

- **`directory`** (Path): Directory containing the executable or script
- **`name`** (str): Name of the application/service (filename)

Example:
```python
from pathlib import Path
from onboot import InstallerConfiguration

config = InstallerConfiguration(
    directory=Path("/usr/local/bin"),
    name="myapp"
)

# The full path will be: /usr/local/bin/myapp
print(config.get_path())
```

---

## 🛠️ Development

This project uses [uv](https://github.com/astral-sh/uv) for dependency management.

```bash
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync

# Run tests
uv run pytest
```

---

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "onboot",
    "maintainer": "nbdy",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "autostart, boot, cross-platform, persistence, startup",
    "author": "nbdy",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/14/31/d8f7d7b25b739078974738a9d0216bcdf845b88c1d007f34b19a533d098a/onboot-1.0.2.tar.gz",
    "platform": null,
    "description": "# \ud83d\ude80 onboot\n\n[![PyPI version](https://badge.fury.io/py/onboot.svg)](https://badge.fury.io/py/onboot)\n[![Python Support](https://img.shields.io/pypi/pyversions/onboot.svg)](https://pypi.org/project/onboot/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n> Cross-platform autostart installer library for Python\n\n**onboot** provides a unified interface to install and manage autostart entries across different operating systems and initialization methods. Whether you need to configure startup scripts on Linux, launch agents on macOS, or registry entries on Windows, onboot has you covered.\n\n---\n\n## \u2728 Features\n\n### \ud83d\udc27 Linux\n- \u2705 **XDG** - XDG Autostart standard\n- \u2705 **Cron** - Cron jobs (@reboot)\n- \u2705 **Profile.d** - Shell profile scripts\n- \u2705 **KDE Plasma** - KDE autostart\n- \u2705 **Init.d** - System V init scripts\n\n### \ud83c\udf4e macOS (Darwin)\n- \u2705 **PList** - Launch Agents/Daemons\n- \u2705 **Cron** - Cron jobs (@reboot)\n\n### \ud83e\ude9f Windows\n- \u2705 **StartMenu** - Startup folder\n- \u2705 **Registry** - Windows Registry\n  - \u2705 HKCU (Current User)\n  - \u2705 HKLM (Local Machine)\n  - \u23f3 IFEO (Image File Execution Options)\n  - \u23f3 UserInit (Winlogon)\n- \u2705 **Task Scheduler** - Windows Task Scheduler\n- \u23f3 **WMIC** - Windows Management Instrumentation\n\n---\n\n## \ud83d\udce6 Installation\n\nInstall onboot using pip:\n\n```bash\npip install onboot\n```\n\nOr with [uv](https://github.com/astral-sh/uv):\n\n```bash\nuv add onboot\n```\n\n---\n\n## \ud83d\udd27 Usage\n\n### Quick Start - Auto-detect Best Installer\n\nLet onboot automatically try all available installers for your operating system:\n\n```python\nfrom onboot import install_linux, InstallerConfiguration\n\n# Create configuration\nconfig = InstallerConfiguration(\"/home/user/myapp\", \"myapp\")\n\n# Install - tries all available installers until one succeeds\ninstall_successful, used_installer = install_linux(config)\n\n# Uninstall using the same installer\nif install_successful:\n    used_installer.uninstall()\n```\n\n### Platform-Specific Functions\n\n```python\nfrom onboot import install_windows, install_darwin, InstallerConfiguration\n\n# Windows\nsuccess, installer = install_windows(InstallerConfiguration(\"C:\\\\myapp\", \"myapp\"))\n\n# macOS\nsuccess, installer = install_darwin(InstallerConfiguration(\"/Users/user/myapp\", \"myapp\"))\n```\n\n### Use a Specific Installer\n\nFor more control, use a specific installer directly:\n\n```python\nfrom onboot.windows import HKCUInstaller\nfrom onboot import InstallerConfiguration\n\n# Create configuration\nconfig = InstallerConfiguration(\"C:\\\\myapp\", \"myapp\")\n\n# Use Windows Registry (HKCU) installer\ninstaller = HKCUInstaller(config)\ninstaller.install()\n\n# Later, uninstall\ninstaller.uninstall()\n```\n\n### Available Installers by Platform\n\n**Linux:**\n```python\nfrom onboot.linux import (\n    XDGInstaller,              # XDG autostart (.desktop files)\n    CrontabInstaller,          # Crontab @reboot\n    ProfileInstaller,          # /etc/profile.d/\n    KDEPlasmaInstaller,        # KDE Plasma autostart scripts\n    InitInstaller,             # /etc/init.d/\n    SystemdUserInstaller,      # ~/.config/systemd/user/ services\n    SystemdSystemInstaller,    # /etc/systemd/system/ services\n    BashrcInstaller,           # ~/.bashrc\n    RcLocalInstaller           # /etc/rc.local\n)\n```\n\n**macOS:**\n```python\nfrom onboot.darwin import (\n    PListInstaller,            # ~/Library/LaunchAgents/\n    LaunchDaemonInstaller,     # /Library/LaunchDaemons/ (system-wide)\n    ProfileInstaller           # /etc/profile\n)\n```\n\n**Windows:**\n```python\nfrom onboot.windows import (\n    HKCUInstaller,             # HKEY_CURRENT_USER registry\n    HKLMInstaller,             # HKEY_LOCAL_MACHINE registry\n    StartMenuInstaller,        # Start Menu startup folder\n    SchTaskInstaller,          # Task Scheduler\n    UserInitInstaller          # Winlogon UserInit\n)\n```\n\n---\n\n## \ud83d\udcdd Configuration\n\nThe `InstallerConfiguration` class accepts the following parameters:\n\n- **`directory`** (Path): Directory containing the executable or script\n- **`name`** (str): Name of the application/service (filename)\n\nExample:\n```python\nfrom pathlib import Path\nfrom onboot import InstallerConfiguration\n\nconfig = InstallerConfiguration(\n    directory=Path(\"/usr/local/bin\"),\n    name=\"myapp\"\n)\n\n# The full path will be: /usr/local/bin/myapp\nprint(config.get_path())\n```\n\n---\n\n## \ud83d\udee0\ufe0f Development\n\nThis project uses [uv](https://github.com/astral-sh/uv) for dependency management.\n\n```bash\n# Install uv\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Install dependencies\nuv sync\n\n# Run tests\nuv run pytest\n```\n\n---\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Cross-platform autostart installer library for Python",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/nbdy/onboot",
        "Issues": "https://github.com/nbdy/onboot/issues",
        "Repository": "https://github.com/nbdy/onboot.git"
    },
    "split_keywords": [
        "autostart",
        " boot",
        " cross-platform",
        " persistence",
        " startup"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c59bb5288dc88e4c96895c22f552eba9fddda47d69fcb474bd4e91d692764a95",
                "md5": "702f678cd79d9358f57dbb624d1a8c9f",
                "sha256": "5fae95d6330872fb0ed7a707ebc38816af58a5043f9791a4df5f016ba34ee5e5"
            },
            "downloads": -1,
            "filename": "onboot-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "702f678cd79d9358f57dbb624d1a8c9f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10664,
            "upload_time": "2025-10-21T23:22:30",
            "upload_time_iso_8601": "2025-10-21T23:22:30.831096Z",
            "url": "https://files.pythonhosted.org/packages/c5/9b/b5288dc88e4c96895c22f552eba9fddda47d69fcb474bd4e91d692764a95/onboot-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1431d8f7d7b25b739078974738a9d0216bcdf845b88c1d007f34b19a533d098a",
                "md5": "09fe6d674f5ca5900fedfada724004ee",
                "sha256": "3a77adc016b368bef3f066ed47bf8f88d95eafae5f9bb34818e38dd2b69f11c4"
            },
            "downloads": -1,
            "filename": "onboot-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "09fe6d674f5ca5900fedfada724004ee",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9463,
            "upload_time": "2025-10-21T23:22:32",
            "upload_time_iso_8601": "2025-10-21T23:22:32.175160Z",
            "url": "https://files.pythonhosted.org/packages/14/31/d8f7d7b25b739078974738a9d0216bcdf845b88c1d007f34b19a533d098a/onboot-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-21 23:22:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nbdy",
    "github_project": "onboot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "onboot"
}
        
Elapsed time: 1.53711s