skillfed

pylnk3

Windows LNK File Parser and Creator

pylnk3 v0.4.3 101.6K downloads/30d#12,924 on PyPI111
Copyleft license GNU Library or Lesser General Public License (LGPL) AGING released

What it is and what it does

pylnk3 is a Python library for parsing, modifying, and creating Windows .lnk shortcut files. It exposes the internal structure of .lnk files through a programmatic API (LNK objects that can be loaded, altered, and saved) and provides a command-line tool for quick inspection and creation. The library supports shortcuts to local files and folders, network paths, and UWP apps, with convenience functions to handle the complexity of the .lnk binary format.

The package requires Python 3.9 or later and has no external runtime dependencies, making installation straightforward. It is maintained but aging—the last release was in April 2025 and the repository shows activity through August 2025. The LGPL license means any modifications or derivative works must remain open-source under compatible terms.

Use it for:

  • Automate creation of Windows shortcuts in deployment scripts or system administration tools without manual GUI interaction.
  • Parse existing .lnk files to extract metadata (target path, arguments, icon, working directory) for inventory or auditing.
  • Build cross-platform tools that generate Windows shortcuts from configuration files or data sources.
  • Modify shortcut properties (window mode, description, icon) programmatically in bulk operations.
  • Integrate shortcut handling into Python-based Windows automation or system provisioning workflows.

Worth the install?

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

Reads, writes, and creates Windows .lnk shortcut files from Python, supporting file and folder shortcuts on local machines with a CLI tool and programmatic API.

Yes, if you need to read or create Windows .lnk files from Python. The library is stable, dependency-free, and actively maintained enough for production use. The LGPL license is a consideration for proprietary projects. Not suitable if you need support for network or UWP shortcuts beyond what the changelog describes—verify compatibility with your specific shortcut types first.

Install

pylnk3 on PyPI

pip

pip install pylnk3

uv

uv add pylnk3

poetry

poetry add pylnk3

Installing pylnk3

Before you install

Low friction install with no runtime dependencies. Aging maintenance status (last release 473 days ago, last commit 2025-08-08) but repository remains active and not archived; supports current Python versions 3.9–3.13.

License in practice

Licensed under LGPL (copyleft). Derivative works and modifications must be distributed under compatible terms; proprietary use requires careful licensing review.

Quickstart

pip install pylnk3

from pylnk3 import LNK

# Parse an existing .lnk file
lnk = LNK.load('shortcut.lnk')
print(lnk.path)

# Create and save a new shortcut
new_lnk = LNK.create_lnk('C:\\target.exe', 'My Shortcut.lnk')
new_lnk.save()

Windows .lnk file format is Windows-specific; library can construct links on Linux but targets Windows paths and formats.

Verify before relying

  • Whether the library correctly handles all modern Windows shortcut variants beyond local file/folder targets
  • Performance characteristics when parsing or creating large numbers of .lnk files
  • Compatibility with UWP app shortcuts beyond what the changelog indicates

Package facts

License GNU Library or Lesser General Public License (LGPL) (copyleft)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 473 days since the last release
Last repo commit
First released
Downloads 101,604/month — #12,924 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pylnk3-0.4.3-py3-none-any.whl

Keywords: lnk, shortcut, windows

Intended Audience :: DevelopersLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Operating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

windows lnk shortcut parserread write .lnk files pythoncreate windows shortcuts programmaticallylnk file manipulation librarywindows shortcut file formatparse lnk metadata python
windows-interopfile-format-parsercli-tool

More Python Modules packages