pylnk3
Windows LNK File Parser and Creator
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 pylnk3uv
uv add pylnk3poetry
poetry add pylnk3Installing 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pyshortcutsCreates desktop and Start Menu shortcuts for…
permissive · top 15,000 on PyPI
wmctrlwmctrl provides programmatic control over…
permissive · top 15,000 on PyPI
vsdxvsdx reads, modifies, and creates Microsoft…
permissive · top 15,000 on PyPI
pyinstxtractor-ngExtracts Python bytecode and resources from…
copyleft · top 15,000 on PyPI
dnfileParses .NET executable files to extract and…
permissive · top 15,000 on PyPI
pyrainbirdCommunicates with Rain Bird WiFi LNK irrigation…
permissive · top 15,000 on PyPI
PyGetWindowPyGetWindow provides functions to query,…
permissive · top 5,000 on PyPI
docxCreates, reads, and writes Microsoft Office…
unclear · top 15,000 on PyPI
python-minifierTransforms Python source code into compact,…
permissive · top 15,000 on PyPI
ipyfilechooserA Jupyter/IPython widget that lets users browse…
permissive · top 15,000 on PyPI