skillfed

universal-startfile

A cross-platform version of 'os.startfile' from the standard library.

universal-startfile v0.4 121.8K downloads/30d#11,972 on PyPI5
Permissive license MIT Active released

What it is and what it does

universal-startfile is a thin cross-platform wrapper that mimics the behavior of Python's os.startfile function (which only works on Windows) on macOS and Linux. It lets you open a file or URL by invoking the operating system's default handler—the same action as double-clicking a file or clicking a link in a browser. The package has no runtime dependencies and installs as a pure Python wheel, making it lightweight and portable.

You import a single function, startfile, and pass it a file path or URL. The package handles the platform-specific logic internally, delegating to the appropriate system command (xdg-open on Linux, open on macOS, os.startfile on Windows). It's useful in desktop automation, file management utilities, or any script that needs to hand off a resource to the user's preferred application without knowing which one that is.

Use it for:

  • Open a downloaded file in its default application from within a Python script or CLI tool.
  • Launch a URL in the user's default browser without hardcoding browser names.
  • Implement a cross-platform 'open with default app' feature in a desktop utility.
  • Trigger file-manager or document-viewer actions from automation scripts on multiple OS platforms.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a cross-platform wrapper around os.startfile that opens files and URLs with their default system applications on Windows, macOS, and Linux.

Yes. The package solves a genuine cross-platform gap in the standard library with zero dependencies, active maintenance, and a permissive license. It is stable despite its Alpha classifier and has been in use since 2022. Install it if you need to open files or URLs with system defaults in a portable way.

Install

universal-startfile on PyPI

pip

pip install universal-startfile

uv

uv add universal-startfile

poetry

poetry add universal-startfile

Installing universal-startfile

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits; marked Alpha but has been stable since first release in 2022.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.

Quickstart

pip install universal-startfile

from startfile import startfile

startfile("~/Downloads/example.png")
startfile("http://example.com")

Requires Python 3.9 or later.

Verify before relying

  • Whether the package handles edge cases like non-existent files or malformed URLs gracefully.
  • Performance characteristics when opening many files in rapid succession.
  • Behavior on less common desktop environments (e.g., Wayland, headless systems).

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 298 days since the last release
Last repo commit
First released
Downloads 121,750/month — #11,972 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: universal_startfile-0.4-py3-none-any.whl

Keywords: files, startfile, utilities

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Desktop Environment :: File ManagersTopic :: Software Development :: LibrariesTopic :: System :: FilesystemsTopic :: Utilities

Tags

open file with default applicationcross-platform startfilelaunch url in browsersystem file openeros.startfile alternative
cross-platformfile-handlingsystem-integration

More Libraries packages